Skip to main content

Petri net simulation and analysis framework

Project description

Petri Net Core

Core Petri net simulation and analysis framework for modeling discrete event systems.

About

This repository contains the core Petri net functionality for simulation and analysis. It provides:

  • Basic Petri Net Implementation (petrinet/)
  • Object Petri Net Support (object_petrinet/)
  • Validation and Schema Support
  • Testing Framework

Installation

From Source

git clone https://github.com/lhcnetop/petri_net.git
cd petri_net
pip install -e .

Development Installation

pip install -e .[dev]

Usage

from petrinet.pnet import PetriNet
from object_petrinet.opnet import ObjectPetriNet

# Create and use Petri nets

Testing

Run tests with:

# Run all tests
default: python -m unittest discover -p "test_*.py" -v

# Run specific test files
python -m unittest tests/test_pnet.py
python -m unittest tests/test_opnet.py
python -m unittest tests/test_pnet_simulation_helper.py
  • test_pnet.py: Unit tests for the core PNet class
  • test_opnet.py: Unit tests for the Object Petri Net implementation
  • test_pnet_simulation_helper.py: Tests for simulation history export to Parquet using polars

Related Projects

License

Apache-2.0 License

Release & PyPI Publishing

PyPI publishing is now fully automated and only happens when you push a version tag (e.g., v0.2.0) to the repository. This ensures that only intentional releases are published.

How to release a new version:

  1. Bump the version in pyproject.toml.
  2. Commit and push your changes to main.
  3. Create and push a tag matching the new version:
    git tag v0.2.0
    git push origin v0.2.0
    
  4. The GitHub Actions workflow will build and publish the package to PyPI automatically.

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

petri_net_core-0.3.4.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

petri_net_core-0.3.4-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file petri_net_core-0.3.4.tar.gz.

File metadata

  • Download URL: petri_net_core-0.3.4.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for petri_net_core-0.3.4.tar.gz
Algorithm Hash digest
SHA256 29d3c0342c64d7f946d4b3aead24a7015d55aa172be0e6c1b6483aae866033d7
MD5 7bcb3c951056c395e22d8388df48aeb2
BLAKE2b-256 25d689fac73622e458d45c48a9e470e9881448a5cc98337e8094a1303b06d71f

See more details on using hashes here.

File details

Details for the file petri_net_core-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: petri_net_core-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for petri_net_core-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c05cc4faaa03b9a3c374516afb6565848ab63e6de64c835124e0cfe14b955d78
MD5 ef15b85c63171b5550253b28b322f6e4
BLAKE2b-256 8ab70b1b947d7766870c34cacb12dc55da8ddbd90b2a371b45f1d2997093944a

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