From 8d2b9ee77cb513ead338467474af5ee2fc147254 Mon Sep 17 00:00:00 2001 From: Kyle Carow Date: Wed, 21 Feb 2024 11:33:11 -0700 Subject: [PATCH] v2.1.2 --- .github/workflows/release.yaml | 9 +++++---- .github/workflows/wheels.yaml | 9 +++++---- README.md | 19 ++++++++++++++----- pyproject.toml | 2 +- rust/fastsim-core/Cargo.toml | 2 +- .../fastsim-proc-macros/Cargo.toml | 2 +- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c5294617..5d77e331 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 @@ -44,7 +44,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: stable override: true - run: cd rust/ && cargo test @@ -71,9 +71,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" @@ -83,6 +83,7 @@ jobs: rustup default stable && rustup show CIBW_BEFORE_BUILD_LINUX: > + apk update && apk add 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 diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index df51fab9..3e04ace0 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -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 @@ -46,7 +46,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: stable override: true - run: cd rust/ && cargo test @@ -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" @@ -85,6 +85,7 @@ jobs: rustup default stable && rustup show CIBW_BEFORE_BUILD_LINUX: > + yum 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 diff --git a/README.md b/README.md index 7cbf50d8..85b9ba74 100644 --- a/README.md +++ b/README.md @@ -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 FASTSimTM](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. @@ -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 @@ -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. @@ -147,6 +155,7 @@ Rust versions of classes have limited Language Server Protocol integration, and Chad Baker -- Aaron Brooker -- Kyle Carow -- +Robin Steuteville -- Jeffrey Gonder -- Jacob Holden -- Jinghu Hu -- diff --git a/pyproject.toml b/pyproject.toml index 05f3d5e4..91dd7017 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/rust/fastsim-core/Cargo.toml b/rust/fastsim-core/Cargo.toml index 261739e9..48842210 100644 --- a/rust/fastsim-core/Cargo.toml +++ b/rust/fastsim-core/Cargo.toml @@ -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 "] diff --git a/rust/fastsim-core/fastsim-proc-macros/Cargo.toml b/rust/fastsim-core/fastsim-proc-macros/Cargo.toml index 5bf3f071..7956e0ed 100644 --- a/rust/fastsim-core/fastsim-proc-macros/Cargo.toml +++ b/rust/fastsim-core/fastsim-proc-macros/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["NREL/MTES/CIMS/MBAP Group "] name = "fastsim-proc-macros" -version = "0.1.5" +version = "0.1.6" edition = "2021" license = "Apache-2.0" readme = "../../../README.md"