Optical model Scattering & Reaction Software
A fast, modern nuclear reaction code with a python
interface using xtensor-python, built for uncertainty quantificaiton and model order reduction of parametric nucleon-nuclear interactions. Contains two main components; a c++
library osiris_lib
containing the core solvers and physics functionality, and a python
front end; osiris
.
osiris
is available at pypi.org/project/osiris-py:
pip install osiris-py
import osiris
For more in-depth examples and tutorials, see examples/
osiris
supports CMake integration using FetchContent. Add the following to your CMakeLists.txt
:
FetchContent_Declare(
osiris
GIT_REPOSITORY https://github.com/beykyle/osiris.git
GIT_TAG "origin/main"
)
FetchContent_MakeAvailable(osiris)
Now you can #include
files like "potential/params.hpp"
into your project, as long as you link osiris_lib
to the relevant target in your CMakeLists.txt
, e.g.
target_link_libraries(<MY_TARGET> osiris_lib)
osiris
can also be used as a standalone application, with an example main
function living inexec/osiris_example_app.cpp
. To build:
git clone git@github.com:beykyle/osiris.git
cd osiris
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make test
make docs
From the docs/
directory:
make html
Following a build, run:
make docs
from the build/
directory.
Running the tests requires pytest
.
py.test .
Following a build, run:
make test
from the build/
directory.
- CMake >= 3.18
- a modern
c++
compiler and tool chain. This was tested and built primarily with the following compilers, running on Ubuntu, using a dependency stack fromconda-forge
:
clang version 15.0.7 (https://github.com/conda-forge/clangdev-feedstock fc523913ae327dfa0a91bb2b45a36c810e0f55d0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
and
g++ (conda-forge gcc 10.4.0-19) 10.4.0
If you only want to use osiris_lib
as a library for your project, these are the only dependencies. To use the python
bindings, you will also need:
pytest
to run thepython
unit tests
It is recomended to use use a package, dependency and environment manager like mamba or conda. Then, setting up an environment to run osiris
with python
is as easy as (e.g. using mamba
), from pypi
:
mamba create -n osirenv python cmake compilers numpy pytest
mamba activate osirenv
pip install osiris
Alternatively, to install for development purposes, clone the repository and create an editable install:
mamba create -n osirenv python cmake compilers pybind11 numpy xtensor-python
mamba activate osirenv
git clone git@github.com:beykyle/osiris.git
cd osiris
py setup.py build -j{nproc}
pip install -e .
import osiris
import mpi4py
Using ipyparallel
, notebooks can be run with a parallel backend.
On Windows, the Visual c++
2015 redistributable packages are a runtime
requirement for this project. It can be found here.
If you use the Anaconda python distribution, you may require the Visual Studio runtime as a platform-dependent runtime requirement for you package:
requirements:
build:
- python
- setuptools
- pybind11
run:
- python
- vs2015_runtime # [win]
@software{Beyer_OSIRIS,
author = {Beyer, Kyle},
license = {BSD-3-Clause},
title = {{OSIRIS}},
url = {https://github.com/beykyle/osiris},
version = {0.1}
}