fastsim_core/
lib.rs

1//! Core crate for performing FASTSim simulations.
2//!
3//! # Crate Specific Coding Practices
4//! - `#[non_exhaustive]` macro is invoked to force any downstream crate to use
5//!    the `Init` trait to initialize structs that implement this macro
6//! - `#[fastsim_api]` -- used to expose the struct to python and provides assorted other features related to usability
7
8#![allow(clippy::field_reassign_with_default)]
9// TODO: uncomment when docs are somewhat mature to check for missing docs
10// #![warn(missing_docs)]
11// #![warn(missing_docs_in_private_items)]
12
13//! Crate containing models for second-by-second fuel and energy consumption of simulation
14//! of vehicles
15//! # Feature Flags
16#![doc = document_features::document_features!()]
17
18#[macro_use]
19pub mod macros;
20
21extern crate uom;
22
23pub mod drive_cycle;
24pub mod error;
25pub mod gas_properties;
26pub mod imports;
27pub mod prelude;
28// #[cfg(feature = "pyo3")] -- feature gate provided inside module
29pub mod pyo3;
30pub mod si;
31pub mod simdrive;
32#[cfg(feature = "simdrivelabel")]
33pub mod simdrivelabel;
34pub mod traits;
35pub mod uc;
36pub mod utils;
37pub mod vehicle;
38
39/// List enabled features
40#[cfg_attr(feature = "pyo3", imports::pyfunction)]
41pub fn enabled_features() -> Vec<String> {
42    vec![
43        #[cfg(feature = "default")]
44        "default".into(),
45        #[cfg(feature = "resources")]
46        "resources".into(),
47        #[cfg(feature = "web")]
48        "web".into(),
49        #[cfg(feature = "serde-default")]
50        "serde-default".into(),
51        #[cfg(feature = "csv")]
52        "csv".into(),
53        #[cfg(feature = "json")]
54        "json".into(),
55        #[cfg(feature = "toml")]
56        "toml".into(),
57        #[cfg(feature = "yaml")]
58        "yaml".into(),
59    ]
60}