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, pandas, SciPy, xarray, 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[all]"       # both optional features

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 7.4.2

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 7.4.2
File Size Uploaded Provenance
jcmsuite-7.4.2.tar.gz 223.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 514.2 kB

Release files / jcmsuite-7.4.2.tar.gz

Download URL jcmsuite-7.4.2.tar.gz
Size 223.5 kB
Tags Source
SHA-256 checksum
How to use checksums
505bb7c6e17068b4a97a4148e650ba419ef7987aa448ed12915de0f35e697d42
BLAKE2b-256 checksum
How to use checksums
f9ae01b072b7dc8716743fa6fa9b6b3bbf1c1ae9f83d982e5b1cf59048c22b38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.9

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

Download URL jcmsuite-7.4.2-py3-none-any.whl
Size 290.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d871aa88dfd19304d28d08c92b21fe51c07538b8623a308d888dd6f192fbbe4b
BLAKE2b-256 checksum
How to use checksums
3e76a7d7996dff5e48c2321c5d69670269b1de96d0137ba7ed660c274a823893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.9

Security for jcmsuite 7.4.2

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.

Release history Release notifications | RSS feed

This release

7.4.2 This release

2 release files No provenance

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