chemparseplot.plot.structs#

Module Contents#

Classes#

UnitConverted

Protocol for the result of converting a unit-aware series.

UnitSeries

Protocol for pint-like data accepted by plotting helpers.

AxisUnits

Canonical axis-unit mapping for 2D plot helpers.

EnergyPath

Typed energy path with unit-aware distance and energy series.

XYData

Typed generic XY data with unit-aware axes.

StructurePlacement

Typed structure placement for strips and inset-aligned labels.

BasePlotter

Thin wrapper around a matplotlib figure and axes with defaults.

TwoDimPlot

Interactive 2D plotter with unit-aware axes and spline interpolation.

Functions#

to_magnitude

Convert a unit-aware series to magnitudes in the requested unit.

axis_label

Format a consistent axis label with units.

convert_energy

Convert energy-like values between supported presentation units.

convert_energy_curvature

Convert eigenvalue-like values while preserving the Angstrom denominator.

energy_axis_label

Format a canonical energy-axis label.

eigenvalue_axis_label

Format a canonical curvature-axis label.

Data#

API#

chemparseplot.plot.structs._ENERGY_FACTORS#

None

class chemparseplot.plot.structs.UnitConverted#

Bases: typing.Protocol

Protocol for the result of converting a unit-aware series.

property m: Any#
class chemparseplot.plot.structs.UnitSeries#

Bases: typing.Protocol

Protocol for pint-like data accepted by plotting helpers.

to(unit: str) chemparseplot.plot.structs.UnitConverted#
class chemparseplot.plot.structs.AxisUnits#

Bases: typing.TypedDict

Canonical axis-unit mapping for 2D plot helpers.

Initialization

Initialize self. See help(type(self)) for accurate signature.

distance: str#

None

energy: str#

None

chemparseplot.plot.structs.to_magnitude(values: chemparseplot.plot.structs.UnitSeries, unit: str) Any#

Convert a unit-aware series to magnitudes in the requested unit.

chemparseplot.plot.structs.axis_label(label: str, unit: str) str#

Format a consistent axis label with units.

chemparseplot.plot.structs.convert_energy(values: Any, unit: str, *, source_unit: str = 'eV') numpy.ndarray#

Convert energy-like values between supported presentation units.

Delegates to :func:chemparseplot.units.convert_energy_magnitude (pint-backed). Accepts plain arrays or pint Quantity instances (converted via .to).

chemparseplot.plot.structs.convert_energy_curvature(values: Any, unit: str, *, source_unit: str = 'eV') numpy.ndarray#

Convert eigenvalue-like values while preserving the Angstrom denominator.

chemparseplot.plot.structs.energy_axis_label(unit: str, *, label: str = 'Energy') str#

Format a canonical energy-axis label.

chemparseplot.plot.structs.eigenvalue_axis_label(unit: str, *, label: str = 'Eigenvalue') str#

Format a canonical curvature-axis label.

class chemparseplot.plot.structs.EnergyPath#

Typed energy path with unit-aware distance and energy series.

Added in version 0.0.3.

label: str#

None

distance: chemparseplot.plot.structs.UnitSeries#

None

energy: chemparseplot.plot.structs.UnitSeries#

None

class chemparseplot.plot.structs.XYData#

Typed generic XY data with unit-aware axes.

Added in version 0.0.3.

label: str#

None

x: chemparseplot.plot.structs.UnitSeries#

None

y: chemparseplot.plot.structs.UnitSeries#

None

class chemparseplot.plot.structs.StructurePlacement#

Typed structure placement for strips and inset-aligned labels.

atoms: Any#

None

x: float#

None

label: str#

None

y: float | None#

None

class chemparseplot.plot.structs.BasePlotter(figsize=(3.2, 2.5), dpi=200, pad=0.2, colormap=None, style='bmh')#

Thin wrapper around a matplotlib figure and axes with defaults.

Added in version 0.0.3.

Initialization

add_title(title='')#
class chemparseplot.plot.structs.TwoDimPlot(*args, **kwargs)#

Bases: chemparseplot.plot.structs.BasePlotter

Interactive 2D plotter with unit-aware axes and spline interpolation.

Added in version 0.0.3.

Initialization

set_labels(x_label, y_label)#
set_units(x_unit, y_unit)#
update_labels()#
redraw_plot()#
add_data(xy_data: chemparseplot.plot.structs.XYData)#
rmdat(labels_to_remove)#
__repr__()#