Skip to content

Nested specs #74

@swo

Description

@swo

@KOVALW works a lot with nested Specifications (in the jargon of #68). How to support that in a convenient schema, and whether it should even be in a schema, versus in pure Python, is a discussion I'm diverting here.


Since these parameters are properties of a normal distribution, not necessarily separate parameters, is there any automatic handling that you envision being done by the package or is that supposed to be on the user side? As you know, in a lot of ixa input files, we have Specifications like

{
    "Parameters": {
        "initial_cases": 1,
        "offspring_distribution": {
            "Poisson": {
                "mean": 1.0
              }
         },
        "generation_interval_distribution": {
                "Uniform": {
                    "min": 7.0, "max": 17.0
                 }
          }
  ...
    }
}

which have both atomic parameter values and nested schemes that assign properties to parameter keys.

Our workaround has been to flatten and unflatten nested dictionaries, using only flattened setups for griddles, such as

"offspring_distribution>>>NegativeBinomial>>>concentration": {
            "vary": [0.5, 1.0],
            "if": {
                "equals": {
                    "scenario_offspring_distribution": "NegativeBinomial"
                }
            }
        }

in the v0.3 JSON syntax, and leaving off fixed variable unions until they're combined with a native ixa input file. We then specify overwriting the upper level parameter, such as offspring_distribution in this case, where the whole nested chunk is replaced by the output of each griddle Specification to generate the Experiment set.

Providing this as a method would probably see a lot of common use and it might be worth figuring out a consistent internal method on Experiment so that we don't have to write out long flattened names

Originally posted by @KOVALW in #68 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions