SNEWS2 / snewpy

A Python package for working with supernova neutrinos
https://snewpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
26 stars 19 forks source link

Allow more levels in the ModelRegistry YAML configuration tree #269

Closed Sheshuk closed 10 months ago

Sheshuk commented 1 year ago

What we have now

All models are listed in models section of the model_files.yml: https://github.com/SNEWS2/snewpy/blob/e0e47f500185fe71c801a6495d9526cad74e830c/python/snewpy/models/model_files.yml#L8-L14

That's ok for the ccsn case, but for adding the preSN models I would like to have them in a separate list.

What I suggest

Make a tree like

models: 
    ccsn:  
        Bollig_2016: 
            repository: *snewpy 
        Fornax_2019:  
            repository: *snewpy 
    presn:
        ...

and make the _model_downloader search not only by the model name, but also its module (ccsn or presn).

This will keep more order than just having all the models in one list.

sybenzvi commented 11 months ago

This sounds fine if we feel it's useful to track the different emission models.

If we're going this route, would it be useful to rename the new repository snewpy-models-ccsn to snewpy-models and create ccsn and presn top-level folders in that repo?

JostMigenda commented 11 months ago

Note that we already have a (currently private) repo called snewpy-models-presn. I have no strong opinions on whether we want to merge those model files into the new repo or keep the two repos separate; but if we're worried about the file size in the longer term as we add more and more models, keeping them separate would help a bit with that.