You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LarvaDataset is the main dataset class located in lib.process.dataset.py.
Ideally it should be available for import in various modules including in lib.reg in order to specify argument type in methods or functions that take a LarvaDataset object as an argument
BUT when trying to import it in eg lib.reg.parFunc.py there is an import error namely partially initialized module 'larvaworld.lib.reg'
See the failed test in the workflow
What refactoring should be done to make this possible?
The text was updated successfully, but these errors were encountered:
As the error suggests - to core issue is resolving circular dependencies.
dataset imports reg => reg imports dataset => circle
Probably the only way to resolve this is to refactor to keep the DataSet class pure (no dependencies to other modules).
It would basically just be an empty class to define the interface of "dataset" types. And then each actual dataset implementation us a sub-class of that parent type.
Then you would only use that pure DataSet class for type hinting method arguments / return types.
LarvaDataset is the main dataset class located in lib.process.dataset.py.
Ideally it should be available for import in various modules including in lib.reg in order to specify argument type in methods or functions that take a LarvaDataset object as an argument
BUT when trying to import it in eg lib.reg.parFunc.py there is an import error namely
partially initialized module 'larvaworld.lib.reg'
See the failed test in the workflow
What refactoring should be done to make this possible?
The text was updated successfully, but these errors were encountered: