Skip to main content

CADET-Python is a Python interface to the CADET-Core simulator

Project description

CADET-Python

CADET-Python provides a file-based Python interface for CADET-Core, which must be installed separately. For this, please refer to the installation instructions and the CADET-Core repository.

The CADET-Python package simplifies access by mapping to the CADET interface, with all dataset names in lowercase.

Installation

To install CADET-Python, use:

pip install cadet-python

Usage Example

The package includes two primary classes:

  • CADET: The main class to configure and run simulations.
  • H5: A general-purpose HDF5 interface.

Setting Up a Simulation

To set a simulation parameter, such as the column porosity for column 1.

Referring to this path in the CADET interface:

/input/model/unit_001/COL_POROSITY

In CADET-Python, this is now set as:

from cadet import Cadet

# Initialize simulation
sim = Cadet()

# Set column porosity for unit 001
sim.root.input.model.unit_001.col_porosity = 0.33

Saving the Simulation File

Before running, save the simulation configuration to a file:

sim.filename = "/path/to/your/file.hdf5"
sim.save()

Setting the Path to CADET

To execute the simulation, specify the path to CADET-Core. On Windows, set the path to cadet-cli.exe:

sim.cadet_path = '/path/to/cadet-cli'

Running the Simulation and Loading Data

Run the simulation and load the output data with:

print(sim.run())
sim.load()

Reading Data from a Pre-Simulated File

If you have a pre-simulated file, you can read it directly:

# Initialize a new simulation object
sim = Cadet()

# Set the filename for the existing simulation data
sim.filename = "/path/to/your/file.hdf5"
sim.load()

At this point, any data in the file can be accessed.

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

cadet_python-1.0.1.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

CADET_Python-1.0.1-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file cadet_python-1.0.1.tar.gz.

File metadata

  • Download URL: cadet_python-1.0.1.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for cadet_python-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6640b5a21747bc1c24f467698c82f4857407b716b062b3daeb30ec3c6e5cbc69
MD5 00ba77fba65adc88f591b6239c33f65c
BLAKE2b-256 715ffc207dd1726fe30933c8b4c29bda180786e347822400ad65e3b666f515a7

See more details on using hashes here.

File details

Details for the file CADET_Python-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: CADET_Python-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for CADET_Python-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b8db25c74fe36ee6322cd3b20262f9d19e268040b35bab8ca970929ab28e085
MD5 718e381fdf0a51359e8bdf9dbdb17ff3
BLAKE2b-256 90d3b5df4acb0421143836308a3841af2ba8306878977aa3662020751e7bac95

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page