This PR aims to fix #182 by implementing a dataset index.
It works exploiting mutual imports:
each dataset interface module imports the dataset_index module and register the dataset in the index;
the dataset_index module at the end imports the all datasets.
It works, but I acknowledge that the mutual import is quite inelegant and not very compliant with PEP8.
An alternative solution is to build the dataset index centrally in flarestack/data/__init__.py by adding each module by hand. All in all it does not really increase the maintenance efforts too much (just need to edit one more file when adding a new dataset).
Let me know if you have better ideas!
P.S.: we also fix a bug previously introduced by me in flarestack/data/icecube/ic_season.py
This PR aims to fix #182 by implementing a dataset index.
It works exploiting mutual imports:
dataset_index
module and register the dataset in the index;dataset_index
module at the end imports the all datasets.It works, but I acknowledge that the mutual import is quite inelegant and not very compliant with PEP8.
An alternative solution is to build the dataset index centrally in
flarestack/data/__init__.py
by adding each module by hand. All in all it does not really increase the maintenance efforts too much (just need to edit one more file when adding a new dataset).Let me know if you have better ideas!
P.S.: we also fix a bug previously introduced by me in
flarestack/data/icecube/ic_season.py