Skip to main content

POEM

Performance pOlar Exchange forMat

PyPI - Status PyPI - License

C++ PyPI - Python Version PyPI version

C++ library and Python bindings defining an exchange format for performance polar in marine engineering, wind assisted vessels performance prediction, weather routing optimisation, embedded control systems, training simulators.

Introduction

  • what is a VPP
  • what is a digital twin
  • what is a performance polar
  • the different type of polars
  • how a polar is used

POEM in a nuttshel

  • why poem
  • what is poem
  • is poem for me

Python interface

The pypoem package that wraps poem is pypoem. It does not currently give acces to the whole C++ API but feature are progressively ported to Python.

Requirements

pypoem is tested with Python version >= 3.9.

Install from Pypi

pypoem is available on Pypi, so it can be installed as:

$ aws codeartifact login --tool pip --repository pypi-store --domain default --domain-owner 262093655153 --region eu-west-3
$ pip install pypoem
# or
$ uv add pypoem

Install from Nexus in another project

Internal releases are published to the Nexus repository pypi-tools. In the consuming project's pyproject.toml, declare that index and pin pypoem to it. explicit = true keeps the index out of the default package search: only packages listed under [tool.uv.sources] are taken from it.

[[tool.uv.index]]
name = "nexus-pypi-tools"
url = "https://nexus.internal.d-ice.net/repository/pypi-tools/simple/"
explicit = true

[tool.uv.sources]
pypoem = { index = "nexus-pypi-tools" }

Then add the dependency:

$ uv add pypoem

uv add, uv sync and uv lock authenticate with UV_INDEX_NEXUS_PYPI_TOOLS_USERNAME and UV_INDEX_NEXUS_PYPI_TOOLS_PASSWORD. The names follow the index name (nexus-pypi-tools). Decode them from NEXUS_AUTH_BASE64 (user:password encoded in base64):

export UV_INDEX_NEXUS_PYPI_TOOLS_USERNAME="$(echo "$NEXUS_AUTH_BASE64" | base64 -d | cut -d: -f1)"
export UV_INDEX_NEXUS_PYPI_TOOLS_PASSWORD="$(echo "$NEXUS_AUTH_BASE64" | base64 -d | cut -d: -f2-)"

Install from sources

pypoem relies on scikit-build-core for the packaging. The repository is a uv project: dependencies are declared in pyproject.toml and locked in uv.lock.

From the repository root, with a C++ compiler, Git and an SSH access to the private CMake dependencies:

$ uv sync --reinstall-package pypoem
$ uv run poem_version

uv sync creates .venv, installs the locked dependencies (including CMake and Ninja for local builds) and builds pypoem in isolation. The Python version is pinned by .python-version.

The optional service tool needs SciPy:

$ uv sync --extra service

Documentation dependencies:

$ uv sync --group docs

A manual C++ build uses the CMake provided by the environment:

$ uv run cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DPOEM_BUILD_PYTHON=OFF
$ uv run cmake -S . -B build-cpp -DPOEM_BUILD_PYTHON=OFF
$ uv run cmake --build build-cpp
$ uv build --wheel

Basic usage

Here is a simple example of the creation of a MPPP Polar with one PolarTable and its writing to a netCDF file compliant with POEM file format thanks the of POEM library.

from pypoem import pypoem
import numpy as np

# Declaring three dimensions
STW = pypoem.make_dimension("STW", "kt", "Speed Through Water")
TWS = pypoem.make_dimension("TWS", "kt", "True Wind Speed")
TWA = pypoem.make_dimension("TWA", "deg", "True Wind Angle")

# Creating a DimensionSet
dimension_set = pypoem.make_dimension_set((STW, TWS, TWA))

# Creating a DImensionGrid and filling the dimensions with values
dimension_grid = pypoem.make_dimension_grid(dimension_set)
dimension_grid.set_values("STW", np.linspace(8, 20, 13))
dimension_grid.set_values("TWS", np.linspace(0, 40, 9))
dimension_grid.set_values("TWA", np.linspace(0, 180, 13))

# Creating a Polar of type MPPP (Motor only Power Prediction)
polar_MPPP = pypoem.make_polar("MPPP", pypoem.MPPP, dimension_grid)

# Creating a PolarTable from the MPPP Polar
BrakePower = polar_MPPP.create_polar_table_double("BrakePower", "kW", "Brake Power", 
                                                  pypoem.POEM_DOUBLE)

# Generating a dummy NDArray with ones and the same shape as the DimensionGrid
# Note that NDArrays must be arranged in a row major order with respect the DimensionSet
# of the DimensionGrid. If you think in terms of nested for loop with Dimensions, 
# the last Dimension (here TWA) is moving fastest (most inner loop).
brake_power_data = np.ones(dimension_grid.shape())

# Setting the BrakePower PolarTable with the array
BrakePower.set_values(brake_power_data)
assert(np.all(brake_power_data == BrakePower.array()))

# Writing to netCDF
pypoem.to_netcdf(polar_MPPP, "polar_basic.nc")
  • Reading a POEM file
  • More complex example

Work In Progress

Integrating the C++ library

Work In Progress

Requirements

Work In Progress

CMake

Work In Progress

Basic usage

Work In Progress

Current limitations

POEM has been primarily developed under Linux OS. Port to other platforms is expected to come in the future but is not a current top priority. Contributors for a Windows port are welcome :)

Latest standard is available at: https://dice-poem.readthedocs.io/en/latest/

Metadata

Release files for pypoem 1.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pypoem 1.7.1
File Actions
pypoem-1.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for pypoem-1.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pypoem-1.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for pypoem-1.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pypoem-1.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for pypoem-1.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pypoem-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for pypoem-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pypoem-1.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for pypoem-1.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Total release size: 14.1 MB

Release files / pypoem-1.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pypoem-1.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a67e26835a38cb5eaa506936fc009cae6bd77a0a0109f478ae319ca7e9a7729c
BLAKE2b-256 checksum
How to use checksums
7193d4ef7b3523cc71358476d41cdabbed0841b7c6319a79dc225b64b3e9dffc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / pypoem-1.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pypoem-1.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b9e68ecc46cf6e040d871a084e90f6e1b64e1c63b3b5c871e35aa74b39b6691a
BLAKE2b-256 checksum
How to use checksums
11a02158f31035656807b15e26eecc8670bc05c107ebde8ba51dd5e0e100b8fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / pypoem-1.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pypoem-1.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3a01b543aa15024a2bc4e866b9063092a5a25b4fd07b66dd3d872e9aa03dc18f
BLAKE2b-256 checksum
How to use checksums
1cdd9b9af22c818782e44481c59951180b0193b36e1a5504ce93e24cdd82f378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / pypoem-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pypoem-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
471f3eea34d1de3cb36e230dcb16839f1848ccc113a1a9a462cff6e24a1026cf
BLAKE2b-256 checksum
How to use checksums
17c8839d841a8f6b4a78c5a0c6d8fead16ca0d04f6d616ab15facc123618f39e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / pypoem-1.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pypoem-1.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1ffb429a70966df13ecd3bee6d7a50fef7b987ce7ecb87deb6279f70e6a9f28e
BLAKE2b-256 checksum
How to use checksums
2c594c52fdaab16e45c0da7ec651e55346d4007ad43e8efb8b24d8b85997396b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for pypoem 1.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page