Skip to main content

ALTRIOS

Altrios Logo

Tests wheels Release Python

Model Framework Schematic

The Advanced Locomotive Technology and Rail Infrastructure Optimization System (ALTRIOS) is a tool for simulating and optimizing the rollout of advanced locomotive technologies and associated infrastructure with the goal of decarbonizing freight rail. ALTRIOS-lite will be released no later than June 2023, but for a richer, full-featured experience, we recommend using ALTRIOS through the Python API user interface, and we offer full installation instructions and numerous usage examples.

Installation

Python Setup

  1. Python installation options:
  2. Setup a python environment. ALTRIOS can work with Python 3.8, 3.9, or 3.10, but we recommend 3.10 for better performance and user experience. Create a python environment for ALTRIOS with either of two methods:
    • Option 1 -- Python Venv
      1. Navigate to the ALTRIOS folder you just cloned or any folder you'd like for using ALTRIOS. Remember the folder you use!
      2. Assuming you have Python 3.10 installed, run python3.10 -m venv altrios-venv in your terminal enviroment (we recommend PowerShell in Windows, which comes pre-installed). This tells Python 3.10 to use the venv module to create a virtual environment (which will be ignored by git if named altrios-venv) in the ALTRIOS/altrios-venv/.
      3. Activate the environment you just created to install packages or anytime you're running ALTRIOS:
        • Mac and Linux: source altrios-venv/bin/activate
        • Windows: altrios-venv/Scripts/activate.bat in a windows command prompt or power shell or source ./altrios-venv/scripts/activate in git bash terminal
        • When the environment is activated, your terminal session will have a decorator that looks like (altrios-venv).
    • Option 2 -- Anaconda:
      1. Open an Anaconda prompt (in Windows, we recommend Anaconda Powershell Prompt) and run the command conda create -n altrios python=3.10 to create an Anaconda environment named altrios.
      2. Activate the environment to install packages or anytime you're running ALTRIOS: run conda activate altrios.

ALTRIOS Setup

ALTRIOS can be install from PyPI. With your Python environment activated run:

pip install altrios

Congratulations, you've completed installation! Whenever you need to use ALTRIOS, be sure to activate your python environment created above.

How to run ALTRIOS

With your activated Python environment with ALTRIOS fully installed, you can run several scripts in ALTRIOS/applications/demos/.

You can run the Simulation Manager through a multi-week simulation of train operations with ALTRIOS/applications/demos/sim_manager_demo.py by running python sim_manager_demo.py in ALTRIOS/applications/demos/. This will create a plots subfolder in which the plots will be saved. To run interactively, fire up a Python IDE (e.g. VS Code, Spyder), and run the file. If you're in VS Code, you can run the file as a virtual jupyter notebook because of the "cells" that are marked with the # %% annotation. You can click on line 2, for example, and hit <Shift> + <Enter> to run the current cell in an interactive terminal (which will take several seconds to launch) and advance to the next cell. Alternatively, you can hit <Ctrl> + <Shift> + p to enable interactive commands and type "run current cell".

Developers

Cloning the GitHub Repo

Clone the repository:

  1. Download and install git -- accept all defaults when installing.
  2. Create a parent directory in your preferred location to contain the repo -- e.g. <USER_HOME>/Documents/altrios_project/.
  3. Open git bash, and inside the directory you created, clone the ALTRIOS repository with e.g. git clone https://github.com/NREL/ALTRIOS.git.

Installing the Python Package

Within the ALTRIOS folder, run pip install -e ".[dev]"

Using Pinned Package Versions

If you want to use pinned package versions to make sure you're environment is the same as the developers, you can do:

pip install -r requirements-dev.txt

Updating Pinned Package Versions

If you add a new package as a dependency, you should update the pinned requirements files. To do this you can install pip tools: pip install pip-tools and then:

pip-compile && pip-compile requirements-dev.in

This will generate two files: requirements.txt and requirements-dev.txt which you can check into the repository.

Rust Installation

Install Rust: https://www.rust-lang.org/tools/install.

Automated Building and Testing

There is a shortcut for building and running all tests, assuming you've installed the python package with develop mode. In the root of the ALTRIOS/ folder, run the build_and_test.sh script. In Windows bash (e.g. git bash), run sh build_and_test.sh, or in Linux/Unix, run ./build_and_test.sh. This builds all the Rust code, runs Rust tests, builds the Python-exposed Rust code, and runs the Python tests.

Manually Building the Python API

Run maturin develop --release. Note that not including --release will cause a significant computational performance penalty.

Manually Testing

Whenever updating code, always run cargo test --release inside ALTRIOS/rust/ to ensure that all tests pass. Also, be sure to rebuild the Python API regularly to ensure that it is up to date. Python unit tests run with python -m unittest discover in the root folder of the git repository.

Releasing

To release the package, you can following these steps:

  1. Create a new branch in the format v<major>.<minor>.<patch>. For example v0.2.1.
  2. Update the version number in the pyproject.toml file.
  3. Open a pull request into the main branch and make sure all checks pass.
  4. Once the pull request is merged into the main branch, create a new GitHub release and create a tag that matches the branch name. Once the release is created, a GitHub action will be launched to build the wheels and publish them to PyPI.

Metadata

Release files for altrios 0.1.0.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for altrios 0.1.0.post2
File Size Uploaded
altrios-0.1.0.post2.tar.gz 2.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for altrios 0.1.0.post2
File
altrios-0.1.0.post2-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
altrios-0.1.0.post2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
altrios-0.1.0.post2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64 Details
altrios-0.1.0.post2-cp39-none-win_amd64.whl CPython 3.9 none Windows x86-64 Details
altrios-0.1.0.post2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
altrios-0.1.0.post2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64 Details
altrios-0.1.0.post2-cp38-none-win_amd64.whl CPython 3.8 none Windows x86-64 Details
altrios-0.1.0.post2-cp38-cp38-manylinux_2_34_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.34+ x86-64 Details
altrios-0.1.0.post2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
altrios-0.1.0.post2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64 Details

Total release size: 72.9 MB

Release files / altrios-0.1.0.post2.tar.gz

Download URL altrios-0.1.0.post2.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
eaf0af98924107bcb72ef7422448fc39665ae94c13c92ef7fc12d90780ce6c91
BLAKE2b-256 checksum
How to use checksums
d56dc102a4324ce1e8a64b22297acc99ff441fc60e9d79b5f73d0f091c8867b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp310-none-win_amd64.whl

Download URL altrios-0.1.0.post2-cp310-none-win_amd64.whl
Size 3.9 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
3c6cb9d15a4e373e3994564c0e71c3c6ed77ff6fe83e010a104dd2da0792f840
BLAKE2b-256 checksum
How to use checksums
c180ab0314ce8d613654d397d3224e02568640fc5c6e45447bde92cb36ed9fff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL altrios-0.1.0.post2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
678b29fafa77a2d8e344105a3ebdb6d3574b2e4d965898fa170ab1c6d9b166fb
BLAKE2b-256 checksum
How to use checksums
6709598912cf7643a023a3c56bd2fd193caa9259d0978dce8e1651067bd9858e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL altrios-0.1.0.post2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.3 MB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
12d1c8854062cad1551004294e92ae505fcd404f462203c8517138d7ee5f1c1a
BLAKE2b-256 checksum
How to use checksums
8ee4587af63580b1411a89430f4999ce697720d7ae5efaaffae61833ed63b7e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp39-none-win_amd64.whl

Download URL altrios-0.1.0.post2-cp39-none-win_amd64.whl
Size 3.9 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e26994a9b525fe28d9d44f2d3b9a0770afa688bb82f94d945d641271eb614037
BLAKE2b-256 checksum
How to use checksums
3468f83c0bac960e5f93df7d4bbc953232dd2827656b638b9fccdd546598dbf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL altrios-0.1.0.post2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
75f412ab0110c243ad6eef4fc0b2effa5c7ede6275a4c7a740eca31297f52f02
BLAKE2b-256 checksum
How to use checksums
f81c8d60d5f34a0ad83c59182e94a95d825e5fde1f57b07806d3d64ccfba525b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL altrios-0.1.0.post2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.3 MB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3414fe88eb09d2a8b1cc78f1a9dcc475318627d6549487ac31a78ade0eca2ec4
BLAKE2b-256 checksum
How to use checksums
1ef6a7c53b9f5da4f81e3657e997fb54df76a74f41a5060075fe405c131e60e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp38-none-win_amd64.whl

Download URL altrios-0.1.0.post2-cp38-none-win_amd64.whl
Size 3.9 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
b67e978497e399943830bf13b9e5150e3838dcb76392450050574d60db2df5ab
BLAKE2b-256 checksum
How to use checksums
5f8a5f268a6617d5bdfef7b1d37ce9b9649b2fc6e4942e5c08900e4b9ae4cef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp38-cp38-manylinux_2_34_x86_64.whl

Download URL altrios-0.1.0.post2-cp38-cp38-manylinux_2_34_x86_64.whl
Size 24.5 MB
Tags CPython 3.8 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
27828bc40c8a61a9bb270a2013ab780c051104d57e877efe42197a47f68762ae
BLAKE2b-256 checksum
How to use checksums
3befa588a6f5ae5324fdbbe31c42b1dbb4ffecf020fda136cb3ae15773a63954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL altrios-0.1.0.post2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f592ef11f1140d5208934785d672dfb72a74c717c290581d7d174b3fa1c6f510
BLAKE2b-256 checksum
How to use checksums
8d268014dfe57925f409c0de5e56f6bd42484e3ab45291b0467a6d83a8f66482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / altrios-0.1.0.post2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL altrios-0.1.0.post2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.3 MB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2f018d1323f673fcf6f11941fe644099a73b1edba27b85580cdc40da570a13b6
BLAKE2b-256 checksum
How to use checksums
959c1c57d3a6e12fd1e315d41adc5397bc0a0e08bb12cd51585ab0f01ce86d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release history Release notifications | RSS feed

1.1.0

8 release files

1.0.0

8 release files

0.3.0

8 release files

0.2.3

8 release files

0.2.2

8 release files

0.2.1

8 release files

0.2.0

8 release files

0.1.8

8 release files

0.1.7

8 release files

0.1.6

8 release files

0.1.5

8 release files

0.1.4

8 release files

0.1.3

8 release files

0.1.2

8 release files

0.1.1

5 release files

This release

0.1.0.post2 This release

11 release files

0.1.0

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page