Availsim4 is a tool to predict reliability and availability of modern particle accelerators and their related systems.
Project description
AvailSim4
Availsim 4 is a software to predict reliability and availability of modern particle accelerators and the related technical systems. It is based on a Monte Carlo Discrete Event Simulation algorithm and allows for advanced availability and reliability statistics.
Requirements
Python >=3.7 with external dependencies; the requirements are listed in pyproject.toml file and grouped into 4
options: graphs, quasi-mc, test, dev. See the user guide for details on how to use them.
Installation
The default installation process does not feature optional dependencies for visualization and optimized sampling options. To make those available, make sure to follow the instriuctions for installation of optional elements listed below.
AvailSim4 can be installed as whole Python project by clonning this repository or as a Python package through a package manager. Below you can find instructions for both possibilities.
PyPI repository
Use the package manager pip to install AvailSim4.
pip install availsim4
To install all optional dependencies, follow the instructions provided in sections below and then use the following command:
pip install 'availsim4[graphs, quasi-mc, test]'
The optional groups of dependencies are graphs, quasi-mc and test:
graphsenables theGRAPHSexporter to produce graphs of the components. Additional pre-requirements described below.quasi-mcinstalls the QmcPy library for some optimized sampling features. Additional pre-requirements described below.testadds dependencies required to run the test suite (not related to standard use of the framework).
You can also select groups of dependencies, for instance [graphs, quasi-mc] to only use a selected subset of the optional dependencies.
Gitlab
To clone and set up the Python project:
- Clone the project from https://gitlab.cern.ch/availsim4/availsim4core and enter the projects directory.
- Optionally, create a dedicated virtual environment (
python -m venv envwill create an environment namedenv). - Trigger an editable installation with setuptools from the local directory using
pip install -e '.[quasi-mc, graphs, test]'. You can modify the list in the brackets to select only desired groups of dependencies.
Visualization tools (optional)
To generate a diagram of the architecture tree, AvailSim4 relies on PyGraphviz package and Graphviz tool. For more information and OS-specific installation guide, please refer to the Graphviz webpage: https://graphviz.org/download/ and PyGraphviz: https://pygraphviz.github.io/documentation/stable/install.html.
General instructions:
- Linux: install Graphviz through your system package manager and then make sure to install PyGraphviz with
pip:apt-get update,apt-get install libgraphviz-dev,pip install pygraphviz. - Windows: Graphviz installation wizard can be downloaded manually from the website. Then proceed to install PyGraphviz with
piporconda. Make sure thatdotprogram's plugins are configured by runningdot -ccommand in your environment. May also require Microsoft C++ Build Tools. - MacOS: you can install Graphviz using Homebrew package manager by running command
brew install graphvizand thenpip install pygraphviz.
Pre-requirement for Windows users (optional)
The external library used for Quasi-Monte Carlo requires Windows users to install Microsoft Visual C++ 14.0 or greater. It can be downloaded from "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/, this requirement is needed to use the Quasi-Monte-Carlo algorithm. CERN's Windows users might prefer to use SWAN notebooks which are running on Linux machines.
Usage
To run AvailSim4 from a command line, you can use the following:
availsim4 [-h]
--system SYSTEM
--simulation SIMULATION
--output_folder OUTPUT_FOLDER
[--sensitivity_analysis SENSITIVITYANALYSIS]
[--HTCondor]
[--HTCondor_extra_argument OPTIONAL_EXTRA_ARGUMENT]
[--nb_processes NB_PROCESS]
[--children_logic PYTHON_FILE]
Example call starting one of the end-to-end tests manually:
python availsim4.py --system availsim4core/test/E2E/input/convergence/convergence_test_system.xlsx --simulation availsim4core/test/E2E/input/convergence/N1000_simulation.xlsx --output_folder output/E2E_example/
You can see the results after the execution finishes in the output/E2E_example directory.
Alternatively, Availsim4 can be used as a module from within Python scripts or notebooks:
import availsim4core.main
availsim4core.main.start(path_simulation = 'path/simulation/file.xlsx',
path_system = 'path/system/file.xlsx',
output_folder = 'path/output/folder/',
path_sensitivity_analysis="",
HTCondor=False,
nb_processes=1)
A notebook, notebook_example_availsim4.ipynb, provides more examples of how to use the framework as a module. It shows basic steps that can be performed with AvailSim4. To use it, you can clone the entire project or download the file separately -- to use with AvailSim4 already installed in your Python environment.
Support features for running AvailSim4 on the HTCondor grid are described in the user guide.
Documentation
A user guide is provided in the user guide. It lists all functionalities of the AvailSim4, along with options and relevant descritions.
For developers wishing to contribute to the code, a dedicated developer guide is being created to provide useful explanations of general implementation concepts and gather all development-specific aspects of the project, such as chosen coding conventions and other decisions - to support coherent approach in the long run.
Contributing
Contributions are welcome. For any such inquiries please reach out via email.
This project requires contributors to agree to Developer Certificate of Origin (DCO) by adding a dedicated Signed-off-by: line to all commits. Please use git commit –signoff in order to automate this. All merge requests must include a signature in the form: Signed-off-by: Firstname Lastname <email.address@domain.org>.
License
Copyright © CERN 2021. Released under the GPL 3.0 only license. All rights not expressly granted are reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file availsim4-2.2.1.tar.gz.
File metadata
- Download URL: availsim4-2.2.1.tar.gz
- Upload date:
- Size: 6.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a4b38250d7fc140313e9cb1222511461970b64ad203d1f0a31426dac83c9db4
|
|
| MD5 |
c979a757af0465378a4361f60ecd1a5e
|
|
| BLAKE2b-256 |
eed68194dfcd007aba5c5bb2efc25e2cf3502b86978cb5c332e3752ce8804217
|
File details
Details for the file availsim4-2.2.1-py3-none-any.whl.
File metadata
- Download URL: availsim4-2.2.1-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6528e509aa7c50b8b182f8f8b722e1c60113b35ff782565d5c016d16397fa0f2
|
|
| MD5 |
f16bc35267b15405162d41f408adbd43
|
|
| BLAKE2b-256 |
9b3d7273d13b60497aa957e61c2beb504bd0af99c52e80ccae03e17ff70298bf
|