Skip to main content

JCMsuite Python Interface (jcmsuite)

Python interface for JCMsuite solver workflows. Run projects, manage local and daemon execution, and inspect or export result data from Python.

Features

  • Project execution: Generate meshes and run JCMsuite projects from Python.
  • Parameterized projects: Supply project keys to templates, including nested values and numeric arrays, to vary geometry, materials, and sources.
  • Parameter scans: Run ordered batches with isolated working directories.
  • Parallel execution: Schedule solves on local or remote workstations and configured cluster queues through the JCMsuite daemon.
  • Structured results: Inspect costs, eigenvalues, postprocesses, and exported fields. Supported result types export to dictionaries, pandas, and xarray.
  • Persistent results: Store and reuse matching solves with Resultbag.

Requirements

  • Python 3.13 or later.
  • A separate JCMsuite installation for solver operations.

Installing this Python package does not install the JCMsuite solver. Test licenses are available to try JCMsuite; you do not need an existing commercial license to get started. See the JCMsuite documentation for installation instructions and license information.

Installation

python -m pip install jcmsuite

The installation includes NumPy, SciPy, and the jcmsuite-data-tree support package. Optional features are available as extras:

python -m pip install "jcmsuite[progress]"  # tqdm progress bars
python -m pip install "jcmsuite[torch]"     # PyTorch integration
python -m pip install "jcmsuite[pandas]"    # DataFrame exports
python -m pip install "jcmsuite[xarray]"    # xarray exports
python -m pip install "jcmsuite[all]"       # all optional features

The Torch extra installs jcmsuite-torch at the exact core version. It provides the existing jcmsuite.torch namespace. Core-only installations do not contain the Torch implementation and do not require PyTorch. Install jcmsuite[pandas] to use DataFrame exports. The extra installs jcmsuite-pandas at the exact core version. Install jcmsuite[xarray] to use xarray exports. The extra installs jcmsuite-xarray at the exact core version.

Getting Started

Locate JCMsuite

Set the JCMROOT environment variable to your JCMsuite installation directory before starting Python. Then inspect the installation:

import jcmsuite

jcmsuite.info()

Alternatively, select an installation explicitly with a context. Replace the example path with your installation directory:

from jcmsuite.context import create_context

context = create_context(jcm_root="/path/to/JCMsuite")
with context:
    jcmsuite.info()

The context is active only inside the with block. The examples below use the default context configured through JCMROOT.

Run A Project And Inspect Results

Pass the path of an existing JCMsuite project to solve:

result = jcmsuite.solve("project.jcmp")

project.jcmp represents a project that you supply; it is not included in this package. By default, solve waits for completion and returns a SolveResult. The available data depends on the project and its declared postprocesses. For a project with at least one postprocess, inspect its first record:

postprocess = result.postprocesses[0]
print(postprocess.to_dict())

Field exports also support operations such as selecting a field and calculating its intensity. Use jcmsuite.view(result.file) to open an available solution fieldbag in JCMview. JCMview requires a graphical environment.

Pass Project Keys And Run A Scan

For a project whose templates already accept a radius key, pass its value through keys:

result = jcmsuite.solve("project.jcmp", keys={"radius": 0.3})

For a scan, pass a list of project-key dictionaries instead:

keys = [{"radius": radius} for radius in (0.3, 0.4, 0.5)]
results = jcmsuite.solve("project.jcmp", keys=keys, temporary=True, quiet=True)

The returned BatchSolveResult preserves input order. temporary=True gives each solve an isolated working directory so that scan entries do not overwrite each other's files. quiet=True suppresses local solver output. For compatible postprocess data, combine the scan results with results.postprocesses[0].to_xarray().

Run Solves In Parallel Or Reuse Results

To run the same scan through a local daemon, declare a resource and activate the handler around the solve:

handler = jcmsuite.daemon.handler()
handler.resources.add(
    jcmsuite.daemon.Workstation(hostname="localhost", multiplicity=2, n_threads=1)
)
with handler:
    results = jcmsuite.solve("project.jcmp", keys=keys, temporary=True, quiet=True)

This configuration allows two concurrent solves with one solver thread each. Choose values supported by your computer and available JCMsuite licenses. The handler disconnects and stops the daemon when the block ends.

For repeated scans, pass a Resultbag with resultbag= to store results and reuse entries that match the project, project keys, suffix pattern, and source-file state. Open Resultbag files only from trusted sources: loading them uses Python pickle and can execute code.

Documentation and Support

See the JCMsuite documentation for manuals, tutorials, and installation instructions. For product and support information, visit JCMwave.

The related jcmsuite-data-tree and jcmsuite-notebooks packages provide low-level tree helpers and notebook/Matlab conversion tools. They do not replace the main jcmsuite solver interface.

License

This Python package is licensed under the MIT License. JCMsuite solver licensing is separate.

Metadata

Release files for jcmsuite 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jcmsuite 1.0.1
File Size Uploaded Provenance Actions
jcmsuite-1.0.1.tar.gz 171.9 kB Without provenance Details for jcmsuite-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jcmsuite 1.0.1
File Interpreter ABI Platform Actions
jcmsuite-1.0.1-py3-none-any.whl Python 3 none any Details for jcmsuite-1.0.1-py3-none-any.whl

Total release size: 401.0 kB

Release files / jcmsuite-1.0.1.tar.gz

Download URL jcmsuite-1.0.1.tar.gz
Size 171.9 kB
Tags Source
SHA-256 checksum
How to use checksums
37575d9100921fe422570a95c162b239a2186afd4d582db519899080f1f69554
BLAKE2b-256 checksum
How to use checksums
abcafb55cef707095be16b1eb4b4eb9d5232606a9d65810e50684db537568bf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.10

Release files / jcmsuite-1.0.1-py3-none-any.whl

Download URL jcmsuite-1.0.1-py3-none-any.whl
Size 229.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c51dfce2b813fa45d823c134f3af50f93c83b4af26650445ad6e78666bfd65ae
BLAKE2b-256 checksum
How to use checksums
4e6f26768a10c9ef5ce071dabbfc2d5e834a283e18417517416954bc38fcaea1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.10

Security for jcmsuite 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page