Skip to main content

Unofficial Python bindings for the ASAM OpenCRG C API

Reason this release was yanked:

superseded by 1.0.0

Project description

pycrg

Unofficial Python bindings for the ASAM OpenCRG C API.

Features

  • Full non-visual OpenCRG C API coverage in Python
  • High-level DataSet, ContactPoint, and RoadSurface APIs
  • Stable message callback support
  • Experimental allocator callback support behind PYCRG_ENABLE_UNSAFE_CALLBACKS=1
  • Demo scripts and smoke tests

Exposed functionality includes:

  • dataset lifecycle and consistency checks
  • dataset metadata printing and range/increment queries
  • dataset modifier set/get/remove/apply/default operations
  • contact point lifecycle and option set/get/remove/default/history operations
  • evaluation and transforms: (u, v) <-> (x, y), (u, v) -> z, (x, y) -> z, (u, v)/(x, y) -> (phi, curv)
  • global controls: OpenCRG release info, memory release, message level and limits

Public callback APIs:

  • Stable/public:
    • set_message_callback
    • clear_message_callback
  • Experimental/unsafe (pycrg.experimental):
    • set_calloc_callback
    • set_realloc_callback
    • set_free_callback
    • clear_unsafe_callbacks

Unsafe allocator callbacks are disabled by default and require PYCRG_ENABLE_UNSAFE_CALLBACKS=1.

Legal notice

pycrg is an unofficial community wrapper and is not affiliated with or endorsed by ASAM e.V.

ASAM OpenCRG® is a registered trademark of ASAM e.V.

This package redistributes parts of OpenCRG under Apache License 2.0 and includes required attribution files:

  • LICENSE
  • NOTICE
  • vendored source license files under src/pycrg/vendor/opencrg/

Installation

pip install pycrg

Development

0) Install development dependencies

pip install -r requirements-dev.txt

1) Refresh vendor snapshot (before building wheel/sdist)

python tools/vendor_snapshot.py --source ../OpenCRG

--source may point to any local clone of OpenCRG.

2) Build

python -m build

3) Install locally

pip install dist/*.whl

Changelog

Release notes are maintained in CHANGELOG.md.

Minimal usage

from pycrg import ContactPoint, DataSet, RoadSurface

dataset = DataSet.open("tests/data/sample.crg")
cp: ContactPoint = dataset.create_contact_point()

print(dataset.u_range())
print(cp.uv_to_z(0.0, 0.0))
cp.close()
dataset.close()

road = RoadSurface.open("tests/data/sample.crg")
print(road.u_range())
print(road.v_range())
print(road.uv_to_z(0.0, 0.0))
road.close()

Example scripts

Run from project root after install/build.

  • C demo ports (simple, eval_z, eval_xyuv, eval_options) are exception-safe: evaluation/conversion failures are handled as warnings and execution continues.
  • This behavior is implemented via non-throwing try_* API methods on ContactPoint / RoadSurface.
  • python examples/scripts/basic_roadsurface_demo.py
  • python examples/scripts/dataset_contactpoint_demo.py
  • python examples/scripts/message_callback_demo.py
  • python examples/scripts/simple_demo.py
  • python examples/scripts/reader_demo.py
  • python examples/scripts/eval_z_demo.py
  • python examples/scripts/eval_xyuv_demo.py
  • python examples/scripts/eval_options_demo.py
  • python examples/scripts/curvature_demo.py
  • PYCRG_ENABLE_UNSAFE_CALLBACKS=1 python examples/scripts/unsafe_allocator_callbacks_demo.py
  • PYCRG_ENABLE_UNSAFE_CALLBACKS=1 python examples/scripts/experimental_allocator_api_demo.py

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

pycrg-0.1.1.tar.gz (81.3 kB view details)

Uploaded Source

Built Distributions

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

pycrg-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (243.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pycrg-0.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (231.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pycrg-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (244.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pycrg-0.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (232.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pycrg-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (244.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pycrg-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (232.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

File details

Details for the file pycrg-0.1.1.tar.gz.

File metadata

  • Download URL: pycrg-0.1.1.tar.gz
  • Upload date:
  • Size: 81.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-0.1.1.tar.gz
Algorithm Hash digest
SHA256 969ba79b23255326bf82b98dfba8659021c9ad111b0a034a1a7ee99fd2301d50
MD5 d9686ed7998408a17d64a2866771c652
BLAKE2b-256 40729c36ada001ce959866726957cd1f529a70f839e4a0dc6b79dc7620af16ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1.tar.gz:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycrg-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 417562394fa67767b567c05c7244ec3f32fbcb5f89a61e787aa026d4b5e951c1
MD5 25af07e537be125168c32dab33bce6d8
BLAKE2b-256 aab60e2cf908d4f5810f93f461d93930e730a539b252e1d190d8259b72bd9dc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-0.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pycrg-0.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d0a67adcc89fd096f569a72da31a50da66f67bd001f984d213d217b7066ebf1f
MD5 11610cbc18a8b7c2769a9aed98433b17
BLAKE2b-256 4cebd2b7d2cbb9789055df73f7d29ed80beb3591dd149b010cea411044210395

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycrg-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54c31fd3e27f0c6b0d4c2085ec82b0bd73eb46974fd78ab9a44ed9de8ad1a2a9
MD5 242de585a564abf412246f62b5237b87
BLAKE2b-256 c09cdc624473110c774cec7d65e6b716d311e07df891c345a54e5859f0e151a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-0.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pycrg-0.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e86f77e69ae524ec5e7567d2aa9a3ffc7efb6a038558ccf7b21c8b5763ac5364
MD5 c76911fc45cac4110551dca0049f6bb9
BLAKE2b-256 3c3ebb8994d395b2c3db3d0ec62071d1b59bfb8cbc7cfc2c25bcc10c6a01de63

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycrg-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3085d3bf290e50e47b19c8ab96367ce46bea67c9f4378a49e4582662c7b9c20e
MD5 875fe6bfbd156cef6f3fa79e5ff54962
BLAKE2b-256 7948f50f5f44493d0b5b2dee6d0bfaea5f34333b6d1839074d1b4d52085965c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pycrg-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 616f8d72765b4e61d765d30da12bf1f2c55b07fd5b63a2672c69f73b764838e8
MD5 98f262308325eee5e802122a315a96f1
BLAKE2b-256 ee7056477aa438ee81d5516141bde07101b15148aeeeef8184e32f5fdc7a56be

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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