Application Interface Python API

Command-oriented PUQ and DIP 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.