Giter Club home page Giter Club logo

montepy's Introduction

MontePy

MontePY: a cute snek on a red over white circle

license Coverage Status PyPI version

MontePy is a python library to read, edit, and write MCNP input files.

Installing

See the Installing section in the user guide.

User Documentation

MontePy has a sphinx website. This has a getting started guide for users, as well as API documentation. There is also a developer's guide covering the design and approach of MontePy, and how to contribute.

Features

  • Handles almost all MCNP input syntax including: message blocks, & continue, comments, etc.
  • Parses Cells, surfaces, materials, and transforms very well.
  • Can parse the following surfaces exactly P(X|Y|Z), C(X|Y|Z), C/(X|Y|Z) (I mean it can do PX, and PY, etc.)
  • Can read in all other inputs but not understand them
  • Can write out full MCNP problem even if it doesn't fully understand an input.
  • Can write out the MCNP problem verbatim, and try to match the original user formatting.
  • Can quickly access cells, surfaces, and materials by their numbers. For example: cell = problem.cells[105].
  • Can quickly update cell importances. For example cell.importance.neutron = 2.0.
  • Has over 240 test cases right now

Quick example for renumbering all of the cells in a problem:

import montepy
foo = montepy.read_input("foo.imcnp")
i = 9500
for cell in foo.cells:
  cell.number = i
  i = i + 5
  
foo.write_to_file("foo_update.imcnp")

Limitations

Here a few of the known bugs and limitations:

  • Cannot handle vertical input mode.
  • Does not support tallies in an easy way.
  • Does not support source definition in an easy way.

Bugs, Requests and Development

So MontePy doesn't do what you want? Right now development is done with a Just-In-Time development approach, as in features are added JIT for a developer to use them on my current projects. If there's a feature you want add an issue here with the feature request tag. If you want to add a feature on your own talk to Micah Gale (but still add the issue). The system is very modular and you should be able to develop it pretty quickly. Also read the developer's guide.

Version Numbering Scheme

  • Software on develop and feature branches are subject to change without a version number increment. These version may be suffixed as dev (e.g., 0.1.0.dev2) and may change as features and bug fixes are implemented.

  • Versions are official if and only if they are:

    1. on the branch main.
    2. has a release git tag assigned
    3. has distribution packages created and released Official shall not change. New merges to main shall have a version number incremented.

Finally: make objects not regexes!

montepy's People

Contributors

micahgale avatar tjlaboss avatar inl-labtrack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.