jNeqSim
Python interface for the NeqSim java package, with stubs. Java interface is created with jpype, and stubs are generated with stubgenj
PYPI
https://pypi.org/project/jneqsim/
Demo
Example
from jneqsim import neqsim
def pressurize_gas():
inlet_fluid = neqsim.thermo.system.SystemSrkEos()
neqsim.thermo.system.SystemSrkEos()
thermo_ops = neqsim.thermodynamicOperations.ThermodynamicOperations(inlet_fluid)
inlet_fluid.addComponent("methane", 100.0)
inlet_fluid.setTemperature(10, "C")
inlet_fluid.setPressure(20, "bara")
inlet_fluid.setMultiPhaseCheck(True)
inlet_fluid.setSolidPhaseCheck("methane")
thermo_ops.TPflash()
thermo_ops.bubblePointTemperatureFlash()
inlet_fluid.initProperties()
enthalpy = inlet_fluid.getEnthalpy()
inlet_fluid.setPressure(1.0, "bara")
thermo_ops.PHflash(enthalpy)
Dependencies
Version Management
jneqsim uses a controlled release process to ensure compatibility:
- Pinned Versions: Each jneqsim release is pinned to a specific, tested NeqSim JAR version
- Automated Updates: The nightly CI workflow automatically checks for new NeqSim releases and publishes updated jneqsim packages when available
- No Auto-Updates: Applications using jneqsim will not automatically download newer NeqSim versions - they use the tested version that comes with their installed jneqsim package
- Cache Management: Downloaded JARs are cached locally in
~/.jneqsim/cachefor faster subsequent usage
Development
Running Tests
The project uses pytest with custom markers to categorize tests. Test dependencies are already included in the development dependencies.
# Install development dependencies (includes pytest and pytest-mock)
poetry install
# Run unit tests (fast, excludes tests marked as slow)
pytest -v -m "not slow" tests/
# Run all tests (may download JARs for integration tests)
pytest -v tests/
# Run with coverage (requires pytest-cov)
poetry add --group dev pytest-cov
poetry run pytest --cov=jneqsim --cov-report=html tests/
Test markers:
slow: Tests that may download files or take longer to runintegration: Integration tests that require external dependenciesunit: Fast unit tests (default)
👍 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Release files for jneqsim 3.21.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jneqsim-3.21.0.tar.gz | 3.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jneqsim-3.21.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.0 MB
Release files / jneqsim-3.21.0.tar.gz
| Download URL | jneqsim-3.21.0.tar.gz |
|---|---|
| Size | 3.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
990b4e99a8784760512bcef6f580dbb7c71641fb25a0469deef1f9d2d5003cbc
|
|
BLAKE2b-256 checksum How to use checksums |
72d1e89831371dfe89190cfe297f0e50d0fcd7549784f126f0fddc2379897213
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / jneqsim-3.21.0-py3-none-any.whl
| Download URL | jneqsim-3.21.0-py3-none-any.whl |
|---|---|
| Size | 989.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a9b3673f7c71cc6a95449c030a3a099ee358ea2d0a216c92b92b163e358ba09
|
|
BLAKE2b-256 checksum How to use checksums |
5f67d2a6c66a384828ebb54ae8090fe7441917a6a9370ac8f4bacba394f9e2b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|