Skip to content

Loader fixes

Lee McCuller requested to merge lee-mcculler/pygwinc:loader-fixes into master

With this branch, or having it merged, there is now an example project that demonstrates an external library that adds the "MyIFO" interferometer to the gwinc listings: https://git.ligo.org/lee-mcculler/pygwinc-MyIFO. After merging, this example could be moved to the gwinc gitlab group and referenced from the gwinc docs.

This changes slightly the search system for load_budget to be more powerful and more general.

First, it allows it to load system-level module names. Such as if I have a gwinc budget as a submodule in external code, I can run it from

python -m gwinc ext_pkg.submodA.submodB.MyIFO

that is quite nice. It also now depreciates the use of the "IFOS" list. Instead, there are now functions subpackage_iter and get_ifos and a list ifo_search_namespaces which defaults to ['gwinc.ifo', 'gwinc_ifos']

subpackage_iter finds all of the subpackages of a namespace folder. Its specific implementation handles namespaces that are populated across many projects (the way "wield" works for instance).

get_ifos populates a dict of all of the ifos it finds in the search namespaces.

The additional folder gwinc_ifos is now included as a default namespace for user ifos. If they, in their own packages, add budgets to their own gwinc_ifos folder, then their budgets will be included in the master list. This (should) work even if both gwinc and the user package are installed in develop mode and have their own gwinc_ifos folder, due to the use of pep 420 namespace packages, see https://packaging.python.org/en/latest/guides/packaging-namespace-packages/.

Edited by Lee McCuller

Merge request reports