Extended PyYAML
loader and dumper for properties with physical units used in scientific computing.
This utility extends PyYAML with the following YAML tags:
!array
: Takes ayaml.SequenceNode
and converts it into the array or tensor object of your preference witharray_yaml_constructor()
. The default array constructor isnumpy.array
.!numexpr
: Leverages thenumexpr
library to evaluatenumpy
expressions from a YAML mapping node with anexpr
key and an optionalalias
key for resolving aliases within the expression.!lambda
: Creates aLambda
expression vianumexpr
from a YAML mapping node withargs
,expr
, andalias
keys.
These basic utilities are then used to define physical properties with physical unit conversions handled by pint
using the UNITS
registry:
!constant
: Creates a constant physical property represented by aConstantProperty
.!table
: Creates a lookup table physical property based on an underlyingscipy.interpolate.RegularGridInterpolator
. SeeTableProperty
.!function
: Wraps around aLambda
object and performs unit conversions. Refer toFunctionProperty
.
The basic utilities and physical properties are included in PropertyLoader
and PropertyDumper
.
Copyright (c) 2024-, The University of Texas at Austin
All Rights reserved. See file COPYRIGHT for details.
This file is part of the yaml_prop package. For more information see https://github.com/bechrist/yaml_prop
yaml_prop is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (as published by the Free Software Foundation) version 3.0 dated June 2007.