Open jlvdb opened 1 year ago
What is the purpose of the abstract method here? Clearly the issue I tried to address is a design feature, but I was not able to figure it out.
Hi @jlvdb - thanks for looking at this! I'm not quite clear what you mean by your question - could you explain more?
Hi @joezuntz, I did not really understand this line here: https://github.com/LSSTDESC/ceci/blob/5c683f8fd6a8bdd2b36c1f6f03f4d24599307a54/ceci/stage.py#L293 Since the it checks for isabstractmethod, I thought that the @abstractmethod serves a purpose beyond indicating an abstract method that should be overwritten, since suddenly the unit tests were failing.
I don't really remember the details here, but I think the main reason I didn't go full-on with using the ABC superclass was that the error messages were much less informative for a typical user. So I guess I was manually using this test to make sure that the user overrode stuff so I could give a more useful custom error message.
This pull requests adds
abc.ABC
as meta classes forPipeline
andPipelineStage
.Both classes implement a few abstract methods, however they do not use
abc.ABC
as meta class, which would prevent to instantiate a subclass if it does not properly implement the abstract methods. Currently aNotImplementedError
is raised at a later point during runtime.