Application Interface Python API

Command-oriented PUQ, DIP, and MAT operations for Python applications.

class scinumtools3.api.dip.DIPParse

Command object for parsing and querying DIPL input.

argument_add(self: scinumtools3._snt.api.dip.DIPParse, add_type: str, add_value: collections.abc.Sequence[str]) → None

Add a DIPfile project, file, inline code, named source, custom unit, or named schema. schema_string and schema_file take a name and unwrapped body or file path. override_string takes an unwrapped body; override_file takes its file path. Both may accompany a project. A DIPfile may include schemas[] entries.

Args:

add_type: project, file, string, override_string, override_file, source, unit, schema_string, or schema_file. add_value: One value for project/file/string/override_string/override_file; [name, value] for the others.

argument_generate(self: scinumtools3._snt.api.dip.DIPParse, format: str, file: str) → None

Generate static parameters on execute().

Args:

format: cpp, c, fortran, rust, julia, json, or yaml. file: Output path; an existing file is overwritten.

argument_load(self: scinumtools3._snt.api.dip.DIPParse, file: str) → None

Load a DIPH5 environment on execute(), instead of DIPL inputs.

Args:

file: Input DIPH5 path.

argument_print(self: scinumtools3._snt.api.dip.DIPParse) → None

Request named, formatted output.

argument_request(self: scinumtools3._snt.api.dip.DIPParse, path: str) → None

Select a DIPL node path.

Args:

path: Reference query to print or return as a scalar.

argument_save(self: scinumtools3._snt.api.dip.DIPParse, file: str) → None

Save the full environment on execute(), overwriting the file; output filters do not limit the saved nodes.

Args:

file: Output DIPH5 path.

argument_tags(self: scinumtools3._snt.api.dip.DIPParse, tags: collections.abc.Sequence[str]) → None

Restrict printed output to nodes carrying at least one listed tag.

Args:

tags: Explicit node tags to match with any-tag semantics.

argument_value(self: scinumtools3._snt.api.dip.DIPParse, type: str = '') → None

Request one defined, unitless scalar.

Args:

type: Optional required type: bool, integer, float, or string.

execute(self: scinumtools3._snt.api.dip.DIPParse) → str

Execute the configured DIPL query.

class scinumtools3.api.puq.PUQEval

Command object for evaluating a PUQ expression.

argument_input_system(self: scinumtools3._snt.api.puq.PUQEval, isystem: str) → None

Set the input unit system.

argument_output_quantity(self: scinumtools3._snt.api.puq.PUQEval, quantity: str) → None

Set the output physical quantity.

argument_output_system(self: scinumtools3._snt.api.puq.PUQEval, osystem: str) → None

Set the output unit system.

argument_output_units(self: scinumtools3._snt.api.puq.PUQEval, units: str) → None

Set output units.

execute(self: scinumtools3._snt.api.puq.PUQEval) → str

Evaluate and return the PUQ expression.

class scinumtools3.api.puq.PUQConvert

Command object for converting a PUQ quantity between units.

argument_input_system(self: scinumtools3._snt.api.puq.PUQConvert, system: str) → None

Set the input unit system.

argument_output_quantity(self: scinumtools3._snt.api.puq.PUQConvert, quantity: str) → None

Set the physical quantity used for conversion.

argument_output_system(self: scinumtools3._snt.api.puq.PUQConvert, system: str) → None

Set the output unit system.

execute(self: scinumtools3._snt.api.puq.PUQConvert) → str

Convert and return the requested quantity.

class scinumtools3.api.puq.PUQInfo

Command object for querying PUQ expression information.

argument_input_system(self: scinumtools3._snt.api.puq.PUQInfo, isystem: str) → None

Set the input unit system.

execute(self: scinumtools3._snt.api.puq.PUQInfo) → str

Return information about the PUQ expression.

class scinumtools3.api.puq.PUQList

Command object for listing available PUQ definitions.

argument_system(self: scinumtools3._snt.api.puq.PUQList, system: str) → None

Set the unit system for the listing.

execute(self: scinumtools3._snt.api.puq.PUQList) → str

Return the requested PUQ definition list.

Materials

class scinumtools3.api.mat.ElementResult

Element facts and optional matter values.

property element
property matter
class scinumtools3.api.mat.MATElement

Command object for evaluating one element expression.

argument_mass(self: scinumtools3._snt.api.mat.MATElement, value: scinumtools3._snt.puq.Quantity) → None

Set the total material mass.

argument_mass_density(self: scinumtools3._snt.api.mat.MATElement, value: scinumtools3._snt.puq.Quantity) → None

Set the material mass density.

argument_matter(self: scinumtools3._snt.api.mat.MATElement, matter: scinumtools3._snt.api.mat.MatterSpec) → None

Replace all optional matter inputs.

argument_natural(self: scinumtools3._snt.api.mat.MATElement, natural: bool = True) → None

Select natural isotope abundances or the deterministic default isotope.

argument_number_density(self: scinumtools3._snt.api.mat.MATElement, value: scinumtools3._snt.puq.Quantity) → None

Set the reference-unit number density.

argument_volume(self: scinumtools3._snt.api.mat.MATElement, value: scinumtools3._snt.puq.Quantity) → None

Set the material volume.

execute(self: scinumtools3._snt.api.mat.MATElement) → scinumtools3._snt.api.mat.ElementResult

Evaluate the configured element command.

class scinumtools3.api.mat.MATMaterial

Command object for evaluating one material mixture.

argument_mass(self: scinumtools3._snt.api.mat.MATMaterial, value: scinumtools3._snt.puq.Quantity) → None

Set the total material mass.

argument_mass_density(self: scinumtools3._snt.api.mat.MATMaterial, value: scinumtools3._snt.puq.Quantity) → None

Set the material mass density.

argument_matter(self: scinumtools3._snt.api.mat.MATMaterial, matter: scinumtools3._snt.api.mat.MatterSpec) → None

Replace all optional matter inputs.

argument_natural(self: scinumtools3._snt.api.mat.MATMaterial, natural: bool = True) → None

Select natural isotope abundances or the deterministic default isotope.

argument_normalization(*args, **kwargs)

Overloaded function.

  1. argument_normalization(self: scinumtools3._snt.api.mat.MATMaterial, normalization: str) -> None

Set the component normalization mode by name.

  1. argument_normalization(self: scinumtools3._snt.api.mat.MATMaterial, normalization: scinumtools3._snt.api.mat.Norm) -> None

Set the component normalization mode.

argument_number_density(self: scinumtools3._snt.api.mat.MATMaterial, value: scinumtools3._snt.puq.Quantity) → None

Set the reference-unit number density.

argument_volume(self: scinumtools3._snt.api.mat.MATMaterial, value: scinumtools3._snt.puq.Quantity) → None

Set the material volume.

execute(self: scinumtools3._snt.api.mat.MATMaterial) → scinumtools3._snt.api.mat.MaterialResult

Evaluate the configured material command.

class scinumtools3.api.mat.MATSubstance

Command object for evaluating one chemical formula.

argument_mass(self: scinumtools3._snt.api.mat.MATSubstance, value: scinumtools3._snt.puq.Quantity) → None

Set the total material mass.

argument_mass_density(self: scinumtools3._snt.api.mat.MATSubstance, value: scinumtools3._snt.puq.Quantity) → None

Set the material mass density.

argument_matter(self: scinumtools3._snt.api.mat.MATSubstance, matter: scinumtools3._snt.api.mat.MatterSpec) → None

Replace all optional matter inputs.

argument_natural(self: scinumtools3._snt.api.mat.MATSubstance, natural: bool = True) → None

Select natural isotope abundances or the deterministic default isotope.

argument_number_density(self: scinumtools3._snt.api.mat.MATSubstance, value: scinumtools3._snt.puq.Quantity) → None

Set the reference-unit number density.

argument_volume(self: scinumtools3._snt.api.mat.MATSubstance, value: scinumtools3._snt.puq.Quantity) → None

Set the material volume.

execute(self: scinumtools3._snt.api.mat.MATSubstance) → scinumtools3._snt.api.mat.SubstanceResult

Evaluate the configured substance command.

class scinumtools3.api.mat.MaterialResult

Mixture composition and optional matter values.

property composite
property expression
property matter
property normalization
property reference_count
class scinumtools3.api.mat.SubstanceResult

Formula composition and optional matter values.

property composite
property formula
property matter
scinumtools3.api.mat.normalization_name(normalization: scinumtools3._snt.api.mat.Norm) → str

Return the canonical name of a material normalization mode.

scinumtools3.api.mat.quantity_value(value: scinumtools3._snt.puq.Quantity, units: str) → float

Convert a quantity to units and return its scalar estimate.