Skip to main content

ORIGEN Library Manager: A tool for building and managing ORIGEN reactor data libraries

Project description

ORIGEN Library Manager (OLM)

OLM is a command-line utility that streamlines aspects of using the SCALE/ORIGEN library to solve nuclide inventory generation problems. See the docs for details on using OLM.

Locations

The main development repository is hosted on GitHub with a read-only mirror on the ORNL-hosted GitLab.

Developing

The remainder of this README is for developers The script dev.sh is provided to initialize the development environment.

$ git clone https://code.ornl.gov/scale/code/olm
$ cd olm
$ source dev.sh

Developer details

This section contains additional details on developing OLM.

Enable virtual environment

$ virtualenv venv
$ . venv/bin/activate
$ which python

If you get an error about missing virtualenv, you may need to install it.

$ pip install virtualenv

Install requirements

After enabling the virtual environment, run this command to install dependencies.

$ pip install -r requirements.txt

NOTE: if you need to regenerate the requirements file after adding dependencies.

$ pip freeze | grep -v '^\-e'>requirements.txt

Enable a local install for testing

This command will enable any changes you make to instantly propagate to the executable you can run just with olm.

$ pip install --editable .
$ olm
$ which olm

Creating docs

With the development environment installed, the docs may be created within the docs directory. With the following commands.

$ cd docs
$ make html
$ open build/html/index.html

Alternatively the PDF docs may be generated using the make latexpdf command. Note that the HTML docs are intended as the main documentation.

The following greatly simplifies iterating on documentation. Run this command and open your browser to http://localhost:8000.

sphinx-autobuild docs/source/ docs/build/html/

Notebooks

There are notebooks contained in notebooks which may be helpful for debugging or understanding how something is working. You may need to install your virtual environment kernel for the notebooks to work. You should use the local venv kernel instead of your default Python kernel so you have all the local packages at the correct versions.

$ ipython kernel install --name "venv" --user

Now, you can select the created kernel "venv" when you start Jupyter notebook or lab.

Notes about development

Click for CLI

We use the Click python library for command line. Here's a nice video about click.

Commit messages

Follow these guidelines for commit messages.

Version updates

OLM uses semantic versioning. You should commit the relevant code with the usual description commit message. Then run bumpversion major, bumpversion minor, or bumpversion patch which will automatically create a new commit message and version tag. When you push you need to git push --tags or configure your repo to always push tags:

#.git/config
[remote "origin"]
    push = +refs/tags/*:refs/tags/*

Pytest for unit tests

Locally for unit tests we use the pytest framework under the testing directory. All tests can be run simply like this from the root directory. Not we are using the pytest-xdist extension which allows parallel testing.

$ pytest -n 6 .

Black for commit formatting

The first time you do work on a clone, do this.

$ pre-commit install

This will use the Black formatter.

Docstrings and Doctest

Our goal is to have each function, module, and class with standard docstrings and a few doctests. You can run verbose tests on a specific module as follows.

$ pytest -v scale/olm/core.py

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

scale-olm-0.10.7.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

scale_olm-0.10.7-py3-none-any.whl (67.9 kB view details)

Uploaded Python 3

File details

Details for the file scale-olm-0.10.7.tar.gz.

File metadata

  • Download URL: scale-olm-0.10.7.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for scale-olm-0.10.7.tar.gz
Algorithm Hash digest
SHA256 bb456dc12932cace3fa624d732c5c0e71af306b5cbbc830270b736a71ad6ad93
MD5 10ff17906b3e107a57061fb6ba74c2ab
BLAKE2b-256 44114cd5aeb458b7dbfc22ad3f8ad5093e238b0e7c8f7cb7f921cb1a1d8fecc6

See more details on using hashes here.

File details

Details for the file scale_olm-0.10.7-py3-none-any.whl.

File metadata

  • Download URL: scale_olm-0.10.7-py3-none-any.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for scale_olm-0.10.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ec1fe91814d20b6cae39134fb4920c957beb475bd4a2eee32376a625ec7744cb
MD5 ff72c9aa4d533d9d2d7dceaab1f2b799
BLAKE2b-256 8f149055e17358578a2be27e0da6dc1fd8440a48ba2d9cb01f1a1ab674825b1f

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