LSSTDESC / rail_pzflow

Rail algorithms that depend on PZFlow
MIT License
0 stars 0 forks source link

`flowEngine.py:FlowModeler` appears to do a lot of work in the __init__ method #8

Open drewoldag opened 1 year ago

drewoldag commented 1 year ago

As noted in the https://github.com/LSSTDESC/rail_base/issues/7 there are a few subclasses of RAIL stages that seem to do a lot of work in the init methods. Generally this is an antipattern. I don't have enough domain knowledge to say whether or not the code here (https://github.com/LSSTDESC/rail_pzflow/blob/main/src/rail/creation/engines/flowEngine.py#L72-L141) is considered "a lot of work" or not, but I wanted to flag it to be checked by someone with more context.

drewoldag commented 1 year ago

@jfcrenshaw I just wanted to get your take on the lines of code linked above. I realize that "a lof of work" is rather subjective, but would it make sense to move those lines of code into a new method, and call that method from the stage's run method?

jfcrenshaw commented 1 year ago

Yes I think that is a good idea