rgpycrumbs.eon.plot_config

Declarative TOML plot configuration for eOn CLIs.

Shared style/render knobs live under [shared] (or at the top level). Command-specific inputs/outputs live under [neb], [min], or [saddle].

Merge order (later wins for explicit CLI overrides only):

shared defaults < command defaults < [shared] + [command] from file
< Click parameters whose source is not DEFAULT

`{versionadded} 1.8.2 `

Attributes

Functions

load_plot_config(→ dict[str, Any])

Load a TOML plot config file into a plain dict of sections.

_coerce_value(→ Any)

_flatten_section(→ dict[str, Any])

extract_config_layers(→ tuple[dict[str, Any], ...)

Split a loaded TOML mapping into shared and command-specific layers.

merge_plot_settings(→ dict[str, Any])

Build the resolved settings mapping for a plot command.

click_nondefault_overrides(→ dict[str, Any])

Return Click parameters whose source is not the decorator default.

resolve_from_click(→ dict[str, Any])

Resolve settings for a Click command callback.

run_plot(→ Any)

Merge settings for command then call *runner*(settings).

run_from_click(→ Any)

CLI path: resolve_from_click then *runner*(settings).

library_plot(→ Any)

Build a keyword-only library entry that shares run_plot().

Module Contents

rgpycrumbs.eon.plot_config.msg = 'Reading plot config on Python <3.11 requires tomli'[source]
rgpycrumbs.eon.plot_config.SHARED_KEYS: frozenset[str][source]
rgpycrumbs.eon.plot_config.SHARED_DEFAULTS: dict[str, Any][source]
rgpycrumbs.eon.plot_config.COMMAND_DEFAULTS: dict[str, dict[str, Any]][source]
rgpycrumbs.eon.plot_config._PATH_KEYS: frozenset[str][source]
rgpycrumbs.eon.plot_config._LIST_PATH_KEYS: frozenset[str][source]
rgpycrumbs.eon.plot_config.load_plot_config(path: str | pathlib.Path) dict[str, Any][source]

Load a TOML plot config file into a plain dict of sections.

rgpycrumbs.eon.plot_config._coerce_value(key: str, value: Any) Any[source]
rgpycrumbs.eon.plot_config._flatten_section(section: dict[str, Any]) dict[str, Any][source]
rgpycrumbs.eon.plot_config.extract_config_layers(data: dict[str, Any], command: str) tuple[dict[str, Any], dict[str, Any]][source]

Split a loaded TOML mapping into shared and command-specific layers.

rgpycrumbs.eon.plot_config.merge_plot_settings(command: str, *, config_path: str | pathlib.Path | None = None, config_data: dict[str, Any] | None = None, cli_overrides: dict[str, Any] | None = None, passthrough: dict[str, Any] | None = None) dict[str, Any][source]

Build the resolved settings mapping for a plot command.

Parameters

command

One of neb, min, saddle.

config_path

Optional TOML file path (ignored when config_data is given).

config_data

Already-loaded TOML mapping (for tests).

cli_overrides

Parameters explicitly set on the CLI (non-default Click source).

passthrough

Remaining Click parameter values (defaults) used to fill gaps for command-specific path/identity options that are not in the schema.

rgpycrumbs.eon.plot_config.click_nondefault_overrides(ctx: Any, params: dict[str, Any]) dict[str, Any][source]

Return Click parameters whose source is not the decorator default.

rgpycrumbs.eon.plot_config.resolve_from_click(command: str, ctx: Any, *, config: str | pathlib.Path | None, **params: Any) dict[str, Any][source]

Resolve settings for a Click command callback.

rgpycrumbs.eon.plot_config.run_plot(command: str, runner: Any, *, config: str | pathlib.Path | None = None, **overrides: Any) Any[source]

Merge settings for command then call *runner*(settings).

Shared by the library plot_* entry points. runner is typically plot_*_from_settings.

rgpycrumbs.eon.plot_config.run_from_click(command: str, runner: Any, ctx: Any, *, config: str | pathlib.Path | None = None, **params: Any) Any[source]

CLI path: resolve_from_click then *runner*(settings).

rgpycrumbs.eon.plot_config.library_plot(command: str, runner: Any) Any[source]

Build a keyword-only library entry that shares run_plot().

rgpycrumbs.eon.plot_config.MINIMAL_CONFIG_EXAMPLE = Multiline-String[source]
Show Value
"""# Minimal rgpkgs eOn plot config (TOML)
# Use: rgpycrumbs eon plt-neb --config plot.toml
#      rgpycrumbs eon plt-min --config plot.toml
#
# Prefer this file for surface-fit knobs instead of growing CLI flags.
# auto_thin defaults to false (opt-in); max_surface_points caps the GP fit set.

[shared]
energy_unit = "eV"
theme = "ruhi"
dpi = 200
figsize = [5.37, 5.37]
strip_renderer = "xyzrender"
xyzrender_config = "paton"
ira_kmax = 14.0
# Surface fit (chemparseplot plot_landscape_surface / single-ended landscapes)
auto_thin = false
max_surface_points = 64

[neb]
con_file = "neb.con"
plot_type = "landscape"
output_file = "neb_landscape.pdf"
title = "NEB path"
plot_structures = "crit_points"
surface_type = "grad_imq"

[min]
job_dir = ["minimization_run"]
plot_type = "landscape"
output = "min_landscape.pdf"
prefix = "minimization"
surface_type = "grad_imq"
# Opt in for dense eOn write_movies force-eval clouds:
# auto_thin = true
# max_surface_points = 64

[saddle]
job_dir = ["saddle_run"]
plot_type = "profile"
output = "saddle_profile.pdf"
"""