Skip to content

bechrist/yaml_prop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaml_prop

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 a yaml.SequenceNode and converts it into the array or tensor object of your preference with array_yaml_constructor(). The default array constructor is numpy.array.
  • !numexpr: Leverages the numexpr library to evaluate numpy expressions from a YAML mapping node with an expr key and an optional alias key for resolving aliases within the expression.
  • !lambda: Creates a Lambda expression via numexpr from a YAML mapping node with args, expr, and alias keys.

These basic utilities are then used to define physical properties with physical unit conversions handled by pintusing the UNITS registry:

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages