Skip to main content

niess

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install niess

License

niess is distributed under the terms of the BSD-3-Clause license.

Motivation

This package is intended to hold information about the Neutron Insruments of the European Spallation Source for use in defining Monte Carlo ray-tracing simulations, file-layout information for use by the ESS file-writers, and other yet-undefined uses; in a use-agnostic approach.

The information required about an instrument for McStas and NeXusStructure is similar but not identical -- the latter attempts to hold all information needed to produce a valid NeXus file, which requires geometry information inspired by the McCode implementation used by McStas.

The two uses each have their own vocabulary, and the vocabulary used here is more closely in line with that of McCode. The basic building block of the two uses is the Comp in McCode and the NXclass in NeXus; here the term 'component' is used to refer to such a building block. Since there are sometimes slight differences between the 'same' Comp and NXclass in how equivalent information is stored, niess is intended to be component-aware as a single translation between the two is not possible globally.

Rather than attempting to store one implementation or the other, niess components are an independent low-level representation of the properties of a component. This representation can be written as a dictionary with pre-defined keys, and it is intended that serializing to and deserializing from such a representation can be used to provide calibrated instrument information to McStas and NeXusStructure.

Use

niess describes an instrument once, as calibration data, and emits it as a McStas instrument, ESS NeXus Structure JSON, or CAD geometry:

from niess.bifrost import Primary, Tank
from niess.bifrost.parameters import primary_parameters, tank_parameters
from niess.instrument import Instrument, Mount
from niess.nexus import to_nexus_structure
from niess.nexus.bifrost import BIFROST_REGISTRY

bifrost = Instrument(name='bifrost', origin='sample_origin', parts=(
    Mount(name='primary', content=Primary.from_calibration(primary_parameters())),
    Mount(name='tank', content=Tank.from_calibration(tank_parameters()),
          relative_to='sample_origin'),
))

structure = to_nexus_structure(bifrost, registry=BIFROST_REGISTRY)

Full documentation, including how to translate an existing McStas .instr into a niess submodule and how to write your own NeXus translators, is at https://mcdotstar.github.io/niess/.

Metadata

Release files for niess 0.11.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 niess 0.11.1
File Size Uploaded
niess-0.11.1.tar.gz 843.6 kB Details

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / niess-0.11.1.tar.gz

Download URL niess-0.11.1.tar.gz
Size 843.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4e144fa096f4630a80312e3473017ba744f96dfb62b8d79333f41aaa13f94ff5
BLAKE2b-256 checksum
How to use checksums
70ed9cfddb36debfdeeae92b5d7abb5a03cc0d53da14f0ecde47f9349d69a2ae
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 Oct 13, 2026.

Transparency log

Release files / niess-0.11.1-py3-none-any.whl

Download URL niess-0.11.1-py3-none-any.whl
Size 258.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2e078a719cd541ccb753a1b7db473584125b1e07bc1d08d67b45767b52dc31c
BLAKE2b-256 checksum
How to use checksums
dcbcf4e7722d53343989f3e1c7368c8fd7d73efa76f17234170c1b47fdbbecf4
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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.12.0

2 release files

This release

0.11.1 This release

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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