Skip to content

added tests, inheritance and some docs

Added three things:

  • pytest support: using my (moderately documented) canonical set of pytest fixtures
  • documentation folder: boilerplate documentation and setup taken from dttxml, to be filled in a bit more primarily with apidoc using sphinx-autodoc
  • simple inheritance in yaml files

the inheritance should be used to make IFO variants that load either the canonical IFO's or other variants. They have a top-level attribute in their yaml "inherit: <load_name>" where load name is either a path or a canonical budget. Upon seeing the inherit key, it is deleted, and its target is loaded using load_budget recursively. Then, the ifo of the targeted budget is Struct.update'd with the remainder of the source yaml, and subsituted into the target budget and returned. See the diff on gwinc/__init__.py for that logic.

To do this, the Struct.update() call had to be improved a bit. It now is more fully recursive through sub-lists and it is more pedantic about checking that source and target types are similar containers. See diffs on gwinc/struct.py for that. A couple other things were improved in struct as well. Struct.update now handles "None" values in a special way, in that they are always overwritten if in the target, but never assign in the source. This is necessary so that subelements of lists like Suspension.Stage can be recursively updated in a sane manner.

There are a couple of tests now in the test/ folder, so check those out to see how Suspension.Stage is handled.

Edited by Jameson Rollins

Merge request reports

Loading