lava-optimization icon indicating copy to clipboard operation
lava-optimization copied to clipboard

Builder.py: Use future-proof interface to set implements_process, required_resources, implements_protocol

Open phstratmann opened this issue 2 years ago • 0 comments

User story

As a user, I want to ensure that the solvers will also run in case that the Process decorators are integrated differently in the future. But at the moment, the builder.py replaces decorators in this non-future-proof way: setattr(solver_model, "implements_process", self.solver_process) # Get requirements of parent class super_res = solver_model.required_resources.copy() # Set new requirements not overwriting parent class requirements. setattr(solver_model, "required_resources", super_res + requirements) setattr(solver_model, "implements_protocol", protocol)

Conditions of satisfaction

  • Above-mentioned code should use the clean interface developed as solution to issue #580

phstratmann avatar Jan 23 '23 18:01 phstratmann