comnum.spec_conditions#

comnum.spec_conditions(spec)#

The conditions of a specification, in order, as dicts.

Parameters:

spec (str | os.PathLike | dict) – as for run_spec.

Returns:

one dict per condition, the last grid axis varying fastest.

Return type:

list[dict]

Raises:
  • FileNotFoundError – for a string that is neither a file nor a specification.

  • ValueError – for an invalid specification (the message names the field).

Examples

>>> import comnum
>>> comnum.spec_conditions({"name": "c", "grid": {"m": [4, 16], "snr_db": [0, 10]},
...                        "link": ["source"]})
[{'m': 4, 'snr_db': 0}, {'m': 4, 'snr_db': 10}, {'m': 16, 'snr_db': 0}, {'m': 16, 'snr_db': 10}]