icecube / flarestack

Unbinned likelihood analysis code for astroparticle physics datasets
https://flarestack.readthedocs.io/en/latest/?badge=latest
MIT License
8 stars 7 forks source link

Retrieve dataset by name instead of importing object (build a dataset index) #182

Closed mlincett closed 2 years ago

mlincett commented 2 years ago

Is your feature request related to a problem? Please describe. Aside from navigating the source code, there is no easy way (as far as I know) to see which data sets are available. In addition, datasets must be always retrieved by explicit imports and cannot be loaded by name (see #178).

Describe the solution you'd like Every created dataset could take care of indexing itself in a central location. Such index will be exposed to the user, that will be allowed to load a dataset by key or name.

This could be achieved by instantiating a dictionary inside a module under flarestack.data, to which every dataset will "register" (more or less like it is done do for subclasses of the core modules).

Describe alternatives you've considered Well, the current design works but it's less user friendly and provides little flexibility.

robertdstein commented 2 years ago

I love this idea!