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 22, 2024
1 parent 8ca1b3f commit 0a0600b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 16 deletions.
9 changes: 5 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 @@ -71,14 +71,15 @@ 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"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_BEFORE_BUILD: >
sudo apt install libssl-dev pkg-config
pip install -U setuptools-rust &&
rustup default stable &&
rustup show
Expand Down
9 changes: 5 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 @@ -73,9 +73,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 All @@ -85,6 +85,7 @@ jobs:
rustup default stable &&
rustup show
CIBW_BEFORE_BUILD_LINUX: >
sudo apt install libssl-dev pkg-config
pip install -U setuptools-rust &&
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y &&
rustup show
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 -- <[email protected]>
Aaron Brooker -- <[email protected]>
Kyle Carow -- <[email protected]>
Robin Steuteville -- <[email protected]>
Jeffrey Gonder -- <[email protected]>
Jacob Holden -- <[email protected]>
Jinghu Hu -- <[email protected]>
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 = "[email protected]" }]
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 <[email protected]>"]
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 <[email protected]>"]
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 0a0600b

Please sign in to comment.