You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A meta issue to keep track of the experimental refactor of the core of hive into rust.
The current branch for all this work is explore-rust. All work should be branched off here and then merged back into it via a PR.
We should also periodically merge main back into this branch to keep it up to date.
setup
To build the rust backend, you can use maturin like this:
cd rust/
pip install maturin
maturin develop
Then, when running the main hive command, you can pass the USE_RUST environment variable to load the rust python objects:
USE_RUST=True hive denver_demo.yaml
testing
In addition to passing the unit tests, each PR should test running the hive base model hive denver_demo.yaml against the new rust additions: USE_RUST=True hive denver_demo.yaml to make sure the results are similar.
scope
The scope of this work is to move the core of hive into rust, exposed via python. At a high level this includes:
In order to support our design choice of maintaining immutable copies of the simulation state, we need to use structural sharing whenever we modify state. In python, we've used the replace method for data classes:
summary
A meta issue to keep track of the experimental refactor of the core of hive into rust.
The current branch for all this work is
explore-rust
. All work should be branched off here and then merged back into it via a PR.We should also periodically merge main back into this branch to keep it up to date.
setup
To build the rust backend, you can use
maturin
like this:cd rust/ pip install maturin maturin develop
Then, when running the main
hive
command, you can pass theUSE_RUST
environment variable to load the rust python objects:testing
In addition to passing the unit tests, each PR should test running the hive base model
hive denver_demo.yaml
against the new rust additions:USE_RUST=True hive denver_demo.yaml
to make sure the results are similar.scope
The scope of this work is to move the core of hive into rust, exposed via python. At a high level this includes:
notes
In order to support our design choice of maintaining immutable copies of the simulation state, we need to use structural sharing whenever we modify state. In python, we've used the
replace
method for data classes:hive/nrel/hive/model/base.py
Lines 139 to 149 in 96ec422
In rust, we're using
Arc
to allow for shared references of state without deep copies:hive/rust/src/base.rs
Lines 165 to 174 in 96ec422
progress
Right now, we're just focusing on moving the model into rust:
The text was updated successfully, but these errors were encountered: