Skip to content

Commit

Permalink
v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Carow authored and Kyle Carow committed Feb 21, 2024
1 parent 8ca1b3f commit 3d1f866
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 16 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: stable
override: true

- run: rustup target add aarch64-apple-darwin
Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: stable
override: true
- run: cd rust/ && cargo test

Expand All @@ -62,6 +62,11 @@ jobs:
pip install -U setuptools-rust
python -c "import setuptools; setuptools.setup()" sdist
- name: install openssl
if: matrix.os == 'ubuntu'
run: |
sudo apt install pkg-config openssl libssl-dev openssl-dev openssl-devel
- name: build ${{ matrix.platform || matrix.os }} binaries
run: cibuildwheel --output-dir dist
env:
Expand All @@ -71,9 +76,9 @@ jobs:
# TODO: why doesn't pytest work with cibuildwheel?
# CIBW_TEST_COMMAND: "pytest -v {project}/python/fastsim/tests"
CIBW_TEST_COMMAND: "python -m unittest discover {project}/python/fastsim/tests"
CIBW_ARCHS_MACOS: 'universal2'
CIBW_ARCHS_MACOS: "universal2"
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#universal2
CIBW_TEST_SKIP: '*_universal2:arm64'
CIBW_TEST_SKIP: "*_universal2:arm64"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: stable
override: true

- run: rustup target add aarch64-apple-darwin
Expand All @@ -46,7 +46,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: stable
override: true
- run: cd rust/ && cargo test

Expand All @@ -64,6 +64,15 @@ jobs:
pip install -U setuptools-rust
python -c "import setuptools; setuptools.setup()" sdist
- name: install openssl
if: matrix.os == 'ubuntu'
# https://github.com/sfackler/rust-openssl/issues/649
run: |
sudo apt install libssl-dev pkg-config
# openssl version -d
# /usr/lib/ssl
# sudo apt install pkg-config libssl-dev

- name: build ${{ matrix.platform || matrix.os }} binaries
run: cibuildwheel --output-dir dist
env:
Expand All @@ -73,9 +82,9 @@ jobs:
# TODO: why doesn't pytest work with cibuildwheel?
# CIBW_TEST_COMMAND: "pytest -v {project}/python/fastsim/tests"
CIBW_TEST_COMMAND: "python -m unittest discover {project}/python/fastsim/tests"
CIBW_ARCHS_MACOS: 'universal2'
CIBW_ARCHS_MACOS: "universal2"
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#universal2
CIBW_TEST_SKIP: '*_universal2:arm64'
CIBW_TEST_SKIP: "*_universal2:arm64"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

[![homepage](https://img.shields.io/badge/homepage-fastsim-blue)](https://www.nrel.gov/transportation/fastsim.html) [![tests](https://github.com/NREL/fastsim/actions/workflows/tests.yaml/badge.svg)](https://github.com/NREL/fastsim/actions/workflows/tests.yaml) [![wheels](https://github.com/NREL/fastsim/actions/workflows/wheels.yaml/badge.svg)](https://github.com/NREL/fastsim/actions/workflows/wheels.yaml?event=release) [![python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue)](https://pypi.org/project/fastsim/) [![documentation](https://img.shields.io/badge/documentation-book-blue.svg)](https://nrel.github.io/fastsim/) [![github](https://img.shields.io/badge/github-fastsim-blue.svg)](https://github.com/NREL/fastsim)


## Description

This is the python/rust flavor of [NREL's FASTSim<sup>TM</sup>](https://www.nrel.gov/transportation/fastsim.html), which is based on the original Excel implementation. Effort will be made to keep the core methodology between this software and the Excel flavor in line with one another.
Expand Down Expand Up @@ -59,17 +58,25 @@ Developers might want to install the code in place so that FASTSim files can be

To see and run examples, navigate to `./python/fastsim/demos` and run the various *demo.py files to see fastsim use cases. There are other examples in fastsim/tests.

## Adding FASTSim as a Depency in Rust
## Adding FASTSim as a Dependency in Rust

### Via GitHub

Add this line:
`fastsim-core = { git = "https://github.nrel.gov/MBAP/fastsim", branch = "rust-port" }`
Add this line:

```
fastsim-core = { git = "https://github.com/NREL/fastsim/", branch = "fastsim-2" }
```

to your Cargo.toml file, modifying the `branch` key as appropriate.

### Via Cargo

This has not been implemented yet.
FASTSim is [available as a Rust crate](https://crates.io/crates/fastsim-core), which can be added to your dependencies via the following command:

```
cargo add fastsim-core
```

## List of Abbreviations

Expand Down Expand Up @@ -104,6 +111,7 @@ Rust versions of classes have limited Language Server Protocol integration, and

## Release Notes

2.1.2 -- SerdeAPI revamp with many new functions, various new vehicles, calibration demo, better error propagation, demo testing
2.1.1 -- license changed to Apache 2.0, default cycle grade and road type to zero if not provided, defaults to regenerative braking parameters, optional documentation fields now generated in Rust
2.1.0 -- release and installation improvements, RustVehicle init cleanup, calibration improvements
2.0.11 - 2.0.22 -- PyPI fixes. Also, Rust version is now >100x faster than Python version.
Expand Down Expand Up @@ -147,6 +155,7 @@ Rust versions of classes have limited Language Server Protocol integration, and
Chad Baker -- <Chad.Baker@nrel.gov>
Aaron Brooker -- <Aaron.Brooker@nrel.gov>
Kyle Carow -- <Kyle.Carow@nrel.gov>
Robin Steuteville -- <Robin.Steuteville@nrel.gov>
Jeffrey Gonder -- <Jeff.Gonder@nrel.gov>
Jacob Holden -- <Jacob.Holden@nrel.gov>
Jinghu Hu -- <Jinghu.Hu@nrel.gov>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "fastsim"
version = "2.1.1"
version = "2.1.2"
authors = [{ name = "NREL/MTES/CIMS/MBAP Group", email = "fastsim@nrel.gov" }]
description = "Tool for modeling vehicle powertrains"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion rust/fastsim-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fastsim-core"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
license = "Apache-2.0"
authors = ["NREL/MTES/CIMS/MBAP Group <fastsim@nrel.gov>"]
Expand Down
2 changes: 1 addition & 1 deletion rust/fastsim-core/fastsim-proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["NREL/MTES/CIMS/MBAP Group <fastsim@nrel.gov>"]
name = "fastsim-proc-macros"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
license = "Apache-2.0"
readme = "../../../README.md"
Expand Down

0 comments on commit 3d1f866

Please sign in to comment.