CENOS Python package
This is a simple package that allows to interface with the cenos backend via a python API.
Quick-start
To use this package you will need:
- Python (> 3.10)
- CENOS simulation software installed.
Once you have those, you can install this package:
pip install cenos-py
How it works
While you use CENOS normally using the GUI, most of your actions are written out to a python_trace_script.py file inside of the case itself (File -> Show case in file explorer). It will look something like this:
import cenos_py
case = cenos_py.CenosCaseIH()
case = CenosCase("INDUCTION")
case.set_pre_processor('geomWizard', load_recent=True)
case.update_template_shape_type(1, 'workpieceTube')
case.update_template_property(1, 'diameter3', 32)
case.update_template_property(1, 'diameter4', 10)
case.update_tab_property('simulation', 'tend', 3)
case.update_tab_property('simulation', 'isAdaptive', True)
case.assign_group_material('workpiece', 'alloy_34Cr4')
case.update_physics_property('physicsThermal', 'boundary', 'workpiece_surface', 'hr', 0.9)
case.entered_meshing_window()
case.set_meshing_global_density('rough')
case.set_meshing_grading_surface(0.29)
case.set_meshing_domain_element_size('workpiece', 2)
case.set_meshing_domain_skin_layer('workpiece', True, 4.6, 10, 1.4)
case.generate_mesh()
case.calculate()
This trace file is also the best reference for the API: if you're not sure which function to call to change something, make that change once in the GUI and check what got added to the trace file.
How to use it
Let's look at two ways to run a case with different parameters.
Option 1: Build the whole case from scratch
The most obvious approach is to take the trace file and turn the parameter you care about into a variable, then repeat the whole thing in a loop:
import cenos_py
case = cenos_py.CenosCaseIH()
for i in [20, 30, 40, 50]:
case.set_pre_processor('geomWizard', load_recent=True)
case.update_template_shape_type(1, 'workpieceTube')
case.update_template_property(1, 'diameter3', i) # <-- parameter goes here
case.update_template_property(1, 'diameter4', 10)
case.update_tab_property('simulation', 'tend', 3)
case.update_tab_property('simulation', 'isAdaptive', True)
case.assign_group_material('workpiece', 'alloy_34Cr4')
case.update_physics_property('physicsThermal', 'boundary', 'workpiece_surface', 'hr', 0.9)
case.entered_meshing_window()
case.set_meshing_global_density('rough')
case.set_meshing_grading_surface(0.29)
case.set_meshing_domain_element_size('workpiece', 2)
case.set_meshing_domain_skin_layer('workpiece', True, 4.6, 10, 1.4)
case.generate_mesh()
case.calculate()
This works, but for a large case the script gets long, and it's easy to end up repeating steps that didn't actually need to change (like generating the mesh multiple times).
Option 2 (recommended): Open an existing case and only change what you need
Instead, you can open a case you've already built in the GUI, and only touch the properties you actually want to vary:
import cenos_py
case = cenos_py.CenosCaseIH()
your_case_path = r"C:\path\to\your_case"
for i in [20, 30, 40, 50]:
case.open(your_case_path)
# Create a copy first, so we don't overwrite the original case
case.save_case_as(f"C:/path/to/your_case_{i}")
case.update_template_property(1, "workpiece_height", i)
case.calculate()
This is the recommended approach: shorter scripts, and no wasted steps.
It also makes the base case easy to keep up to date. If you want to make a static, non-parametric change — a different material, a physics property, swapped-out geometry — just open your_case_path in the GUI, make the change, save it, and re-run your script. There's no need to touch the Python at all; every run will pick up the new base case automatically.
Result analysis
Actions performed in the CENOS GUI result viewer do not get written to the python trace script. Instead you can access all the results via case.results., for example:
case = cenos_py.CenosCaseIH()
case.open(r"C:\path\to\your_case")
case.results.get_active_power()
case.results.get_average_temperature("Solid1")
Each of the functions will have docstrings and argument and return type annotations, meaning if you start typing case.results.get_dielec then you should see the "parameter hints":
def get_dielectric_losses(
entity: str = "Total",
port: int = 1
) -> list[float]
Return the dielectric losses in the entity, in watts (W).
Release files for cenos-py 0.3.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 | |
|---|---|---|---|
| cenos_py-0.3.0.tar.gz | 30.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cenos_py-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.8 kB
Release files / cenos_py-0.3.0.tar.gz
| Download URL | cenos_py-0.3.0.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f0d34095c038c060283444b9c5e2c237af62d2e33b9c7b4d2278b414341b12a
|
|
BLAKE2b-256 checksum How to use checksums |
23485402899a93450d61cf455a2de6d6500e0b71c4511ab7d20bed3687df5d3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / cenos_py-0.3.0-py3-none-any.whl
| Download URL | cenos_py-0.3.0-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6de3329a3532cb06dd5128af6f360f1a9c3e72160c5eee139a141e9500e1b82a
|
|
BLAKE2b-256 checksum How to use checksums |
83bf509a2e2a82617c9efd6f0a39f31202b5b43dff92126ce6ab6438c441cdae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log