lava icon indicating copy to clipboard operation
lava copied to clipboard

AbstractRunCondition is not implemented as an abstract class, refactor blocking as abstract property.

Open GaboFGuerra opened this issue 3 years ago • 0 comments

Objective of issue: Refactor AbstractRunCondition into an actual abstract class.

Lava version:

  • [ ] 0.3.0 (feature release)
  • [ ] 0.2.1 (bug fixes)
  • [x] 0.2.0 (current version)
  • [ ] 0.1.2

I'm submitting a ...

  • [x] bug report
  • [ ] feature request
  • [ ] documentation request

Current behavior:

  • AbstractRuncondition does not have any abstract method, this means that instantiation is allowed. In particular, the blocking attribute is set on the abstract class constructor, then subclasses pass it into super's constructor.

Expected behavior:

  • AbstractRunCondition should have at least one abstract method, this can be achieved by refactoring blocking as an abstract property which the subclasses should define.

Steps to reproduce:

  • Import AbstractRunCondition from lava.magma.core.run_conditions
  • instantiate AbstractRunCondition, e.g.:
    • my_condition = AbstractRunCondition(blocking=True)
  • this should not be allowed. I would expect a TypeError to be raised.

Related code:

insert short code snippets here

Other information:

insert the output from lava debug here

GaboFGuerra avatar Jan 26 '22 14:01 GaboFGuerra