Skip to main content

Python utilities, including material definition and unit system handling with pint

Project description

pyMatUnits - Python Materials and Units handling package

Package for handling units systems and conversion, leveraging the pint package, as well as material property definition for use with in physics-based modeling.

Installation

Once the appropriate conda or virtual environment is activated, navigate to the main directory and run:

pip install --editable .

This should install the dependencies if not already installed

Documentation

In order to view the detailed documentation as a site:

  • Verify that mkdocs is installed
  • Navigate to /docs folder
  • Either:
    • Run mkdocs serve and open http://127.0.0.1:8000/
    • OR run mkdocs build which will compile it into a site folder, then just open site/index.html

Changelog

v1.3: Installation and documentation update

  • Move from setup.py to pyproject.toml
  • Add mkdocs setup and files for initial version of documentation website

v1.2: Encoding improvements, material unit system conversion

to/read_json: allow for saving unit string in JSON files

Material.unit_system can be set, which will convert all quantities

Built-In/Saved Materials and Unit Systems

mat_prop and units modules have builtin_dir and builtin_paths to lead to saved JSON files

Unit Systems

Module name : units

Works on top of the pint package. UnitSystem class allows for storage of system of units (length, mass, time, etc.), as well as the ability to check for internal consistency of said system using check_consistency method. Logs consistency issues as well as returning conversion factors to be used when converting inconsistent units.

Unit systems can be stored or read from JSON file format using .to_json/.read_json, similar to Pandas.

  • Main class : UnitSystem
  • Unit conversion function : convert

Materials

Module name : mat_prop

Allows for material definitions, based on those defined in Abaqus. Can create materials in Abaqus CAE or Nastran input file (bdf) if the appropriate dependencies are in place (Abaqus API or Nastran Utils package).

Materials can be stored or read from JSON file format using .to_json/.read_json, similar to Pandas.

Apps

Dash apps (units_app.py and mat_app.py) for creating, reading, or writing unit systems or material objects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymatunits-1.3.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymatunits-1.3-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file pymatunits-1.3.tar.gz.

File metadata

  • Download URL: pymatunits-1.3.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for pymatunits-1.3.tar.gz
Algorithm Hash digest
SHA256 22f10af91baa40dacd3e05e6c64890d1d22789927304bc97cc5bd506e32e86a8
MD5 37a8b0409b921c8b74f834154e582830
BLAKE2b-256 a6fe1b8502fbd1759234623494ae78f32cf2073945ee8fb9d2f207aca1d7e8f1

See more details on using hashes here.

File details

Details for the file pymatunits-1.3-py3-none-any.whl.

File metadata

  • Download URL: pymatunits-1.3-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for pymatunits-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 26ac7732809720b1bdd01e683c3745298b6c2d8134a58ab1f9583b8031f5c605
MD5 0b43d8598a6674fddf1d4f02e02b2a63
BLAKE2b-256 9fc597e0f46a3d75ad16b90d73f43ac2c65bc167c1903fb9e3345d2f0c31d09f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page