Can't dynamically register an IFO model
See #39 (closed) for context.
I'd like to re-use the nice pygwinc CLI so I can easily plot stuff, and run my own IFO's noise budget as well as the standard ones. Ideally I'd like to be able to add my IFO to the list of available IFOs in my own project's __main__
module before calling pygwinc's __main__.main()
, so that it can be called with e.g. python -m myifo MY_IFO
:
/path/to/my/project/__main__.py
:
"""Run AEI prototype noise budget."""
from . import MyIFO # <- My nb.Budget class
from gwinc import register_ifo
from gwinc.cli import main # <- currently this is in __main__.py but could be moved so that external
# libraries don't need to import __main__
register_ifo(MyIFO)
if __name__ == "__main__":
main()
Proposed solution: ideally it should be possible to register an IFO so that it is contained in the list returned by gwinc.ifo.available_ifos
. That way the CLI is able to run the custom budget simply using the IFO's name.