Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F3/document features #149

Merged
merged 8 commits into from
Aug 9, 2024
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ opt-level = 3

[workspace.dependencies]
# TODO: uncomment and correct version `version = "~0.0.1"`
document-features = "0.2.10"
fastsim-core = { path = "fastsim-core" }
anyhow = "1.0.71"
pyo3 = "0.19"
Expand Down
21 changes: 17 additions & 4 deletions fastsim-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ uom = { workspace = true }
paste = "1.0.7"
easy-ext = "1.0.0"
rayon = "1.5.3"
document-features = { workspace = true }
bincode = { version = "1.3.3", optional = true }
log = { version = "0.4.17", optional = true }
anyhow = { workspace = true }
Expand Down Expand Up @@ -47,15 +48,27 @@ name = "interp_bench"
harness = false

[features]
default = ["resources", "serde-default", "web", "serde-default"]
default = ["resources", "web", "serde-default"]
## Enables logging messages that can be passed to Python if `pyo3` is also
## enabled.
logging = ["dep:log"]
## Enables `pyo3` to provide fastsim-3 structs, methods, and functions to Python
pyo3 = ["dep:pyo3", "fastsim-2/pyo3"]
## Compiles external resources (e.g. vehicle files or cycle files) to be
## available in the binary
resources = ["dep:include_dir"]
web = ["dep:ureq", "dep:url"] # internet-querying dependencies
logging = ["dep:log"]
# serde formats
## Enables internet-querying dependencies
web = ["dep:ureq", "dep:url"]
## Enables several text file formats for serialization and deserialization
serde-default = ["csv", "json", "toml", "yaml"]
## Enables binary serialization and deserialization -- somewhat experimental and
## may eventually be deprecated
bincode = ["dep:bincode"]
## Enables csv serialization and deserialization
csv = ["dep:csv"]
## Enables json serialization and deserialization
json = ["dep:serde_json"]
## Enables toml serialization and deserialization
toml = ["dep:toml"]
## Enables yaml serialization and deserialization
yaml = ["dep:serde_yaml"]
4 changes: 2 additions & 2 deletions fastsim-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

//! Crate containing models for second-by-second fuel and energy consumption of simulation
//! of vehicles
//! # Features:
//! - pyo3: enable this feature to expose FASTSim structs, methods, and functions to Python
//! # Feature Flags
#![doc = document_features::document_features!()]

#[macro_use]
pub mod macros;
Expand Down
Loading