A companion command line interface for nonos
Project description
nonos-cli
nonos-cli is a companion command line interface (CLI) to create nonos plots
directly from the terminal, adding a nonos command to your environment.
Installation
The recommended method is to install nonos-cli globally, but still in isolation,
with uv. Get a minimal install with
uv tool install nonos-cli
You may want to include optional dependencies too, which is achieved with
uv tool install 'nonos-cli[all]'
Alternatively, use pipx (which also supports the addition of [all])
pipx install nonos-cli
Install in development (editable) mode
If you want to hack around the CLI and run some manual tests without re-installing it between edits, you'll need to first clone the source repository, then, from the top level, run
uv tool install --editable ./cli
or
pipx install --editable ./cli
Alternatively, and using uv, you can also run the in-tree version of the CLI without installing it globally with the following workflow
uv sync --all-packages
uv run nonos <...>
Usage
The nonos CLI gets its parameters from three sources:
- command line parameters
- a configuration file
- default values
Command line parameters take priority over the configuration file, which itself takes priority over default values.
To get help, run
nonos --help
usage: nonos [-h] [-dir DATADIR] [-field FIELD]
[-geometry {polar,cylindrical,spherical,cartesian}]
[-operation {vm,vp,vz,lt,lp,aa,ap,apl,rr} [{vm,vp,vz,lt,lp,aa,ap,apl,rr} ...]]
[-plane PLANE [PLANE ...]] [-corotate COROTATE] [-range RANGE [RANGE ...]]
[-vmin VMIN] [-vmax VMAX] [-theta THETA] [-z Z] [-phi PHI]
[-distance DISTANCE] [-cpu NCPU] [-on ON [ON ...] | -all] [-diff] [-log]
[-pbar] [-scaling SCALING] [-cmap CMAP] [-title TITLE]
[-uc UNIT_CONVERSION] [-fmt FORMAT] [-dpi DPI] [-input INPUT | -isolated]
[-d | -version | -logo | -config] [-v]
Visualization tool for idefix/pluto/fargo3d (M)HD simulations of protoplanetary disks
options:
-h, --help show this help message and exit
-dir DATADIR location of output files and param files (default: '.').
-field FIELD name of field to plot (default: 'RHO').
-geometry {polar,cylindrical,spherical,cartesian}
if the geometry of idefix outputs is not recognized (default:
'unset').
-operation {vm,vp,vz,lt,lp,aa,ap,apl,rr} [{vm,vp,vz,lt,lp,aa,ap,apl,rr} ...]
operation to apply to the fild (default: 'unset').
-plane PLANE [PLANE ...]
abscissa and ordinate of the plane of projection (default:
'unset'), example: r phi
-corotate COROTATE planet number that defines with which planet the grid corotates.
-range RANGE [RANGE ...]
range of matplotlib window (default: unset), example: x x -2 2
-vmin VMIN min value (default: unset)
-vmax VMAX max value (default: unset)
-theta THETA if latitudinal operation (default: unset)
-z Z if vertical operation (default: unset)
-phi PHI if azimuthal operation (default: unset)
-distance DISTANCE if radial operation (default: unset)
-cpu, -ncpu NCPU number of parallel processes (default: 1).
-on ON [ON ...] output number(s) (on) to plot. This can be a single value or a
range (start, end, [step]) where both ends are inclusive.
(default: last output available).
-all save an image for every available snapshot (this will force
show=False).
-scaling SCALING scale the overall sizes of features in the graph (fonts,
linewidth...) (default: 1).
-cmap CMAP choice of colormap for the 2D maps (default: 'RdYlBu_r').
-title TITLE name of the field in the colorbar for the 2D maps (default:
'unset').
-uc, -unit_conversion UNIT_CONVERSION
conversion factor for the considered quantity (default: '1').
-fmt, -format FORMAT select output image file format (default: unset)
-dpi DPI image file resolution (default: 200)
boolean flags:
-diff plot the relative perturbation of the field f, i.e. (f-f0)/f0.
-log plot the log10 of the field f, i.e. log(f).
-pbar display a progress bar
CLI-only options:
-input, -i INPUT specify a configuration file.
-isolated ignore any existing 'nonos.ini' file.
-d, -display open a graphic window with the plot (only works with a single
image)
-version, --version show raw version number and exit
-logo show Nonos logo with version number, and exit.
-config show configuration and exit.
-v, -verbose, --verbose
increase output verbosity (-v: info, -vv: debug).
The -operation command allows you to choose what operation is applied to the data, and can be paired with -z, -theta, -phi, or -distance depending on the operation.
vm: vertical_at_midplanevz: vertical_at_z, can be paired with-zto give the altitude at which the vertical slice is performed.vp: vertical_projection, can be paired with-zto give the interval of the vertical integral.lt: latitudinal_at_theta, can be paired with-thetato give the latitude at which the latitudinal slice is performed.lp: latitudinal_projection, can be paired with-thetato give the interval of the latitudinal integral.ap: azimuthal_at_phi, can be paired with-phito give the azimuth at which the azimuthal slice is performed.apl: azimuthal_at_planet, has to be paired with-corotateto perform a slice at the planet azimuth.aa: azimuthal_averagerr: radial_at_r, can be paired with-distanceto give the distance at which the radial slice is performed. You can cumulate some operations, likelpandaawhich will given for example for-field=RHOthe gas surface density.
Note that for old idefix outputs, you will need to add the -geometry command to process the data.
Using a configuration file
The CLI will read parameters from a local file named nonos.ini if it exists,
or any other name specified using the -i/-input parameter.
To ignore any existing nonos.ini file, use the -isolated flag.
One way to configure nonos is to use
nonos -config
which prints the current configuration to stdout. You can then redirect it to get a working configuration file as
nonos -config > nonos.ini
This method can also be used to store a complete configuration file from command line arguments:
nonos -ncpu 8 -cmap viridis -operation vm -diff -vmin=-10 -vmax=+100 -config
As of nonos 0.19.0 + nonos-cli 0.1.0, this will print
# Generated with nonos 0.19.0 + nonos-cli 0.1.0
datadir .
field RHO
operation vm
theta unset
z unset
phi unset
distance unset
geometry unset
on unset
diff True
log False
range unset
vmin -1e1
vmax 1e2
plane unset
progressBar False
corotate unset
ncpu 8
scaling 1
cmap viridis
title unset
unit_conversion 1
format unset
dpi 200
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonos_cli-0.1.1.tar.gz.
File metadata
- Download URL: nonos_cli-0.1.1.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1dcf31a146cebd7ee895463c84889e02297ab3fb8e26e7b533dd5b7c0f89634
|
|
| MD5 |
e026c322a872d3db2417db514b4ec6ee
|
|
| BLAKE2b-256 |
7b3977e05fac64b59fe296eab1be4ab2e0ea72c58d9f93e41cee203b65a203b7
|
Provenance
The following attestation bundles were made for nonos_cli-0.1.1.tar.gz:
Publisher:
cd.yml on la-niche/nonos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonos_cli-0.1.1.tar.gz -
Subject digest:
e1dcf31a146cebd7ee895463c84889e02297ab3fb8e26e7b533dd5b7c0f89634 - Sigstore transparency entry: 1003790333
- Sigstore integration time:
-
Permalink:
la-niche/nonos@b5c95da43a35de71d73636af68c41d81b350b604 -
Branch / Tag:
refs/tags/cli-v0.1.1 - Owner: https://github.com/la-niche
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@b5c95da43a35de71d73636af68c41d81b350b604 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonos_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nonos_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
304aec2c86b0f14153dfa56db8012caace13c6de12a03064f6e63c30f6a421e3
|
|
| MD5 |
3798df0ac74fb908cf51c475a8daeb4c
|
|
| BLAKE2b-256 |
0204b15429860f2f15b65c669968a9656f416c6b539a97499fff9b04194d4851
|
Provenance
The following attestation bundles were made for nonos_cli-0.1.1-py3-none-any.whl:
Publisher:
cd.yml on la-niche/nonos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonos_cli-0.1.1-py3-none-any.whl -
Subject digest:
304aec2c86b0f14153dfa56db8012caace13c6de12a03064f6e63c30f6a421e3 - Sigstore transparency entry: 1003790335
- Sigstore integration time:
-
Permalink:
la-niche/nonos@b5c95da43a35de71d73636af68c41d81b350b604 -
Branch / Tag:
refs/tags/cli-v0.1.1 - Owner: https://github.com/la-niche
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@b5c95da43a35de71d73636af68c41d81b350b604 -
Trigger Event:
push
-
Statement type: