encomp documentation

_images/logo.svg

Overview

General-purpose library for engineering computations, with focus on clean and consistent interfaces.

Main functionality of the encomp library:

  • Handles physical quantities with magnitude(s), dimensionality and units
    • Modules encomp.units, encomp.utypes

    • Extends the pint library

    • Uses Python’s type system to validate dimensionalities

    • Compatible with mypy and other type checkers

    • Integrates with with Numpy arrays, Pandas series and Polars series and expressions

    • JSON serialization and decoding via Pydantic

  • Implements a flexible interface to CoolProp
    • Module encomp.fluids

    • Uses quantities for all inputs and outputs (including dimensionless quantities)

    • Fluids are represented as class instances, the properties are class attributes

  • Extends Sympy
    • Module encomp.sympy

    • Adds convenience methods for creating symbols with sub- and superscripts

    • Additional functions to convert (algebraic) expressions and systems to Python code that supports Numpy arrays# add mock imports to avoid running modules:

The other modules implement calculations related to process engineering and thermodynamics.

Tip

This library can be used as a starting point when developing your own engineering calculations. For instance, using the encomp.units.Quantity class and decorating functions with @typeguard.typechecked will eliminate all unit-related errors in your calculations.

encomp also serves as an overview of commonly used Python libraries for engineering and science.

Contents