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.1.2.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

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

cadet_python-1.1.2-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cadet_python-1.1.2.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for cadet_python-1.1.2.tar.gz
Algorithm Hash digest
SHA256 58a4184637f493c48823a795a0b3ed35a4a83de3d618ba4d0453b4f6e88926cd
MD5 f64f958c83a42f0502c3e1c645020e45
BLAKE2b-256 a30e85d8c2a59b145b68d1d6f0500094de90ae10919f783a4faca01aa5f4b719

See more details on using hashes here.

File details

Details for the file cadet_python-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: cadet_python-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for cadet_python-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11df0df35e8f1aff1ec30df9a141015e9ab70bec7f34193a552ad0e29f65ec9d
MD5 390c509ffc12cd66447c1e562ce21bea
BLAKE2b-256 b0f914b3d4113f1b2bcedc48053256bc7698554c5c742a7901005be0cb89c9ea

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