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

Decouple `cat_dtype` from `flarestack__data` #175

Closed mlincett closed 2 years ago

mlincett commented 2 years ago

The catalogue data type (cat_dtype) is currently part of utils.prepare_catalogue.py, that in turns imports from flarestack.shared, triggering the creation of the flarestack__data directory tree.

I would like to separate the definition of the catalogue data type in a separate module, so that importing cat_dtype is independent of flarestack__data and does not attempt to write to disk.

Such module could be called data_types and located in a directory of our choice (please advise!)

robertdstein commented 2 years ago

I think that there was no use case for this previously, and therefore I never separated it out. But if you have one, that's a good enough motivation!

I guess the other question is whether there flarestack__data creation is overzealous. If there are cases where you do not want to trigger the flaresctack__data creation, that place where the creation-trigger is done could be changed to a different file or behaviour.

mlincett commented 2 years ago

My use case was creating the flarestack catalogue in a script (or notebook) that is not necessarily the same used for setting up the analysis.

On the other hand I see how it is preferable to have the catalogue stored inside flarestack__data in the first place so it would make sense that the script creating the catalogue is aware of the data dir.

All in all this is not essential, I just still like the idea of dataformat specifications having their own place and not be mixed up with "functional" code :)