Skip to main content

Tools to process MCNP models and results

Project description

https://img.shields.io/badge/Maintained%3F-yes-green.svg https://github.com/MC-kit/mckit/workflows/Tests/badge.svg https://codecov.io/gh/MC-kit/mckit/branch/devel/graph/badge.svg?token=05OFBQS3RX https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 https://img.shields.io/github/license/MC-kit/mckit Security Status

MCKIT: MCNP model and results processing utilities

The mckit package provides a programming framework and command line tools to manipulate complex MCNP models. When a model is rather complex and its description occupies thousands of text lines it becomes hard to modify it and integrate several model manually. The package automates integration process.

Usage

Command line interface

Usage: mckit [OPTIONS] COMMAND [ARGS]...

  Tools to process MCNP models and results

Options:
  --override / --no-override
  --version                   Show the version and exit.
  -v, --verbose               Log debugging info to stderr.  [default: False]
  -q, --quiet                 Suppress info to stderr.  [default: False]
  --logfile / --no-logfile    Log to file.  [default: True]
  --profile_mem               Profile peak memory use.  [default: False]
  --help                      Show this message and exit.

Commands:
  check      Read MCNP model(s) and show statistics and clashes.
  compose    Merge universes and envelopes into MCNP model using merge...
  concat     Concat text files.
  decompose  Separate an MCNP model to envelopes and filling universes
  split      Splits MCNP model to text portions (opposite to concat)
  transform  Transform MCNP model(s) with one of specified transformation.

Library

The library allows subtraction and merging models, renaming objects (cells, surfaces, compositions, universes), simplification of cell expressions (removing redundant surfaces), homogenization, computation of cell volumes and material masses, and more.

LOG.info("Loading c-model envelopes")
envelopes = load_model(str(CMODEL_ROOT / "c-model.universes/envelopes.i"))

cells_to_fill = [11, 14, 75]
cells_to_fill_indexes = [c - 1 for c in cells_to_fill]

LOG.info("Attaching bounding boxes to c-model envelopes %s", cells_to_fill)
attach_bounding_boxes(
    [envelopes[i] for i in cells_to_fill_indexes], tolerance=5.0, chunk_size=1
)
LOG.info("Backing up original envelopes")
envelopes_original = envelopes.copy()

antenna_envelop.rename(start_cell=200000, start_surf=200000)

LOG.info("Subtracting antenna envelop from c-model envelopes %s", cells_to_fill)
envelopes = subtract_model_from_model(
    envelopes, antenna_envelop, cells_filter=lambda c: c in cells_to_fill
)
LOG.info("Adding antenna envelop to c-model envelopes")
envelopes.add_cells(antenna_envelop, name_rule="clash")
envelopes_path = "envelopes+antenna-envelop.i"
envelopes.save(envelopes_path)
LOG.info("The model of HFSR in envelopes is saved to %s", envelopes_path)

Installation

Installing from pypi:

pip3 install mckit

Installing from github.com:

pip3 install git+https://github.com/MC-kit/mckit.git

Versioning

This software follows Semantic Versioning

Contributors

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

mckit-0.8.3.tar.gz (231.7 kB view details)

Uploaded Source

Built Distributions

mckit-0.8.3-cp313-cp313-win_amd64.whl (583.5 kB view details)

Uploaded CPython 3.13 Windows x86-64

mckit-0.8.3-cp313-cp313-manylinux_2_35_x86_64.whl (630.1 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.35+ x86-64

mckit-0.8.3-cp313-cp313-manylinux_2_31_x86_64.whl (630.5 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.31+ x86-64

mckit-0.8.3-cp312-cp312-win_amd64.whl (583.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

mckit-0.8.3-cp312-cp312-manylinux_2_35_x86_64.whl (630.1 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.35+ x86-64

mckit-0.8.3-cp312-cp312-manylinux_2_31_x86_64.whl (630.6 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.31+ x86-64

mckit-0.8.3-cp311-cp311-win_amd64.whl (583.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

mckit-0.8.3-cp311-cp311-manylinux_2_35_x86_64.whl (629.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.35+ x86-64

mckit-0.8.3-cp311-cp311-manylinux_2_31_x86_64.whl (630.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.31+ x86-64

mckit-0.8.3-cp310-cp310-win_amd64.whl (583.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

mckit-0.8.3-cp310-cp310-manylinux_2_35_x86_64.whl (629.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.35+ x86-64

mckit-0.8.3-cp310-cp310-manylinux_2_31_x86_64.whl (630.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

File details

Details for the file mckit-0.8.3.tar.gz.

File metadata

  • Download URL: mckit-0.8.3.tar.gz
  • Upload date:
  • Size: 231.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Linux/6.5.0-1025-azure

File hashes

Hashes for mckit-0.8.3.tar.gz
Algorithm Hash digest
SHA256 1f4c46526bcd810eda86d09fc85f5d68f28b99b1a0b6498287bba114e64059fa
MD5 12e4a64b1ab19cdd6845a0c344b14cec
BLAKE2b-256 8d39e3eeab1ca0f1caf10a741e594b441f0e21776dc119baa14703a9fd214ae7

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 583.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Windows/2022Server

File hashes

Hashes for mckit-0.8.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3215359cb3b5acc36bc3e3e2475bd59aec2d93c4ae2d2a68fdbdef2af371c1ca
MD5 5e3cb4708d266884fac538bd80bb6f29
BLAKE2b-256 b7a1bc3dbc04cb36a0e5a71c02d463a13e2d54a91ccc1bf9d80d31b519457f44

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp313-cp313-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp313-cp313-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 630.1 kB
  • Tags: CPython 3.13, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Linux/6.5.0-1025-azure

File hashes

Hashes for mckit-0.8.3-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3b473f344afb64c872056e370787862755d48ce59e4b5b639d9add333232737e
MD5 18de982d12139595b12dbeaaab9fbcc1
BLAKE2b-256 7c778680a4bec158c9f635c8e010cb73dc57f785b226f5f9e79637ae1f511aca

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp313-cp313-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 630.5 kB
  • Tags: CPython 3.13, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Linux/5.15.0-1073-azure

File hashes

Hashes for mckit-0.8.3-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 45189513407bf7b0147bef85a8ded8770fad3f2c8be292eb0823dc03720d5543
MD5 3a5328524618b227b1875ed0fc754fe7
BLAKE2b-256 2b653464f2a86fa81faf54edd4f5430653d240c427888ddab4fe5c929a5f6921

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 583.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Windows/2022Server

File hashes

Hashes for mckit-0.8.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9d778a37338c7d9f6024ae6528100405d5eddc57c12042dd0e9f86cc4e3bd0b0
MD5 1c983db043652e6b205193e75338bd87
BLAKE2b-256 d5576659722d9d5348ba679df9d074535e72d407547d4efae04b19ae9a2072d4

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp312-cp312-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 630.1 kB
  • Tags: CPython 3.12, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for mckit-0.8.3-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3ac48ad873ff4303ac27f7d0675a906a143e5eff85b8eeca8a3fa0030e99ad5d
MD5 a99964403f7034313d7142f4142d6ba3
BLAKE2b-256 a451c125ab973e26cf3b3fe81ba72681a8972d27d7f75beba7153d856ef81e7f

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp312-cp312-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 630.6 kB
  • Tags: CPython 3.12, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/5.15.0-1073-azure

File hashes

Hashes for mckit-0.8.3-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 9c276669ca815e3aca1e924acce800ff46df6974af82fafaccd759cf4f0ed670
MD5 9d5ff620cd1f52392568518bdb7a8292
BLAKE2b-256 231bf1d69a051d7cdc114f0fd1783ce1805c2b9575988c6fc6d4c480a098c754

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 583.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Windows/10

File hashes

Hashes for mckit-0.8.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd9ee024be9ed0680d192c6e279705a25a8f3e651377d5c2e24c731bbb3cd10f
MD5 0e429a65d156f561323d24437c8108bf
BLAKE2b-256 b9b9102a182146d90d0c96b10a28fa31efdb04e843092dcc7ab1ca2e6c3d6203

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp311-cp311-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 629.9 kB
  • Tags: CPython 3.11, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for mckit-0.8.3-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 eb366fee850df63130049ddd76b44798f19a1a741a4a3fef9f2db383ebddfbc4
MD5 6fb3499581dafe698caa7f07cb1821b9
BLAKE2b-256 9606adb01916d2f4538317850df8faad959e22da5f81681beb6639fa804de3f8

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp311-cp311-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 630.4 kB
  • Tags: CPython 3.11, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Linux/5.15.0-1073-azure

File hashes

Hashes for mckit-0.8.3-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d460e6937fdde04a30559ad12f67a942f5207506b7c067f6ab93a9ee2f8bab93
MD5 1fbaef00c95ffef4076c644e2b2c963b
BLAKE2b-256 e3548da4406c073cfe6a0edc32a2b9c7990d244ee377569784d60f9bf815399a

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 583.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for mckit-0.8.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0b82136f52b1c9faf73e5650ad2d84533ff71f76a554c87a8fa380fc384411b4
MD5 24f6d215de98e8509b1b4e6ebc3bb588
BLAKE2b-256 b547be2f710158eb7c0619a95e1652fcfe37a5f3848cac971a4be2e1f2931349

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp310-cp310-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 629.9 kB
  • Tags: CPython 3.10, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for mckit-0.8.3-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0cb068b6e9d1a34d72cfd61cecee3a7f4bbfe1d9d4aecdcfdafa71c7be6d13d0
MD5 1f082ff574b684615152ccdb26b56904
BLAKE2b-256 6e67edf61691e922edaf437743ce13a160f36be825843ab3029faa4d792f1ea6

See more details on using hashes here.

File details

Details for the file mckit-0.8.3-cp310-cp310-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: mckit-0.8.3-cp310-cp310-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 630.4 kB
  • Tags: CPython 3.10, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/5.15.0-1073-azure

File hashes

Hashes for mckit-0.8.3-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d78b066ba99f478deb8dc2b6c70773ec478b643d02b70f604449ef9baa937c1e
MD5 a24a8b8eb6230ce48e15a1cd31616659
BLAKE2b-256 19a9f0a41407775bea49ecc6c8e5beac02b1aa51a083eda8bb070731f4072a27

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page