magnus.cli
cli.py
Command-line calculator for Mag$nu$s: computes a single neutrino
oscillation probability (or probability matrix) from the command line,
without writing any Python. Wraps the same osc_prob_{2,3,4,5}nu_*
functions used by the Python API (see magnus.oscprob
and Command-Line Calculator), dispatching to the right one based on --flavors,
--environment, --scenario and --density-profile.
Installed as the magnus console script (see [project.scripts]
in pyproject.toml) and also runnable as python -m magnus.
Routine listings
main - Entry point: parses argv, dispatches, prints the result
build_parser - Builds the argparse.ArgumentParser
- FLAVOR_NAME_TO_INDEX - Maps flavor names (e, mu, tau, s, s1, s2)
to their globaldefs index
- ENERGY_UNITS, LENGTH_UNITS - Unit-name to \(\text{eV}\) / \(\text{eV}^{-1}\)
conversion factors
FLAVOR_LABELS - Row and column names used by the printed table
ALWAYS_FORWARD - Numerics keywords forwarded to every wrapper
- DENSITY_PROFILES - Values
--density-profileaccepts: ‘constant’, ‘exp’, andevery tabulated solar model in
magnus.solarmodels
Attributes
Functions
|
Builds the |
|
Entry point for the |
Module Contents
- magnus.cli.DENSITY_PROFILES = ('constant', 'exp', 'BP2000', 'BP04', 'BS05-OP', 'BS05-AGS-OP', 'B16-GS98', 'B16-AGSS09met',...[source]
- magnus.cli.build_parser() argparse.ArgumentParser[source]
Builds the
magnuscommand-line argument parser.Added in version 1.0.0.
- Returns:
The top-level parser, with the
probsubcommand attached.- Return type:
- magnus.cli.main(argv=None) int[source]
Entry point for the
magnusconsole script /python -m magnus.Added in version 1.0.0.
- Parameters:
argv (list of str, optional) – Arguments to parse instead of
sys.argv[1:](mainly for testing).- Returns:
Always 0. Every failure leaves through
SystemExitinstead, so this function has no non-zero return.- Return type:
- Raises:
SystemExit – Exit code 2 for an argparse error or a value the library rejects, and 1 for a combination of flags that
_env_kwargsor_wrapper_namerefuses.