The latest stable version is v0.14.2.
OLM is a command-line utility that streamlines aspects of using the SCALE/ORIGEN library to solve nuclide inventory generation problems.
To install, use pip.
pip install scale-olmThe main development repository is hosted on GitHub with a read-only mirror on the ORNL-hosted GitLab.
The script dev.sh is provided to initialize the development environment.
$ git clone https://github.com/wawiesel/olm
$ cd olm
$ source dev.shThis is all you should need to do. The following sections explain in more detail
what happens when you run dev.sh.
This section contains additional details on developing OLM.
$ virtualenv venv
$ . venv/bin/activate
$ which pythonIf you get an error about missing virtualenv, you may need to install it.
$ pip install virtualenvAfter enabling the virtual environment, run this command to install dependencies.
$ pip install -r requirements.txtNOTE: if you need to regenerate the requirements file after adding dependencies.
$ pip freeze | grep -v '^\-e'>requirements.txtThis command will enable any changes you make to instantly propagate to the executable
you can run just with olm.
$ pip install --editable .
$ olm
$ which olmWith 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.htmlAlternatively 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/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" --userNow, you can select the created kernel "venv" when you start Jupyter notebook or lab.
We use the Click python library for command line. Here's a nice video about click.
Follow these guidelines for commit messages.
OLM uses semantic versioning. You should commit the relevant code with the usual description commit message.
Then run
bumpversion patchif you are fixing a bugbumpversion minorif you are adding a new featurebumpversion majorif you are breaking backwards compatibility
When you push you need to git push --tags or configure your repo to always push tags:
#.git/config
[remote "origin"]
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
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. Note we are using the
pytest-xdist extension which allows parallel testing.
$ pytest -n 6 .To run tests with coverage reporting:
$ pytest --cov=scale --cov-report=term-missing -n 6 .To generate an HTML coverage report:
$ pytest --cov=scale --cov-report=html --cov-report=term-missing -n 6 .
$ open htmlcov/index.htmlThe first time you do work on a clone, do this.
$ pre-commit installThis will use the Black formatter.
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