Skip to content

Commit

Permalink
Merge branch 'fastsim-3' into f3/fix-pytest-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Keefe authored and Michael O'Keefe committed Nov 15, 2024
2 parents f831879 + 30c2f69 commit 1afacc2
Show file tree
Hide file tree
Showing 85 changed files with 2,015 additions and 1,535 deletions.
29 changes: 14 additions & 15 deletions .subtrees/ninterp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ pub mod three;
pub mod two;

pub use error::*;
pub use n::*;
pub use one::*;
pub use three::*;
pub use two::*;
pub use n::*;

#[cfg(feature = "serde")]
pub(crate) use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -172,7 +172,6 @@ pub enum Interpolator {
/// 3-dimensional interpolation
Interp3D(Interp3D),
/// N-dimensional interpolation
InterpND(InterpND),
}

Expand Down Expand Up @@ -263,7 +262,7 @@ impl Interpolator {
};
interp.interpolate(point)
}

Self::InterpND(interp) => {
match interp.extrapolate {
Extrapolate::Clamp => {
Expand Down Expand Up @@ -317,7 +316,7 @@ impl Interpolator {
Self::Interp1D(_) => 1,
Self::Interp2D(_) => 2,
Self::Interp3D(_) => 3,

Self::InterpND(interp) => interp.ndim(),
}
}
Expand All @@ -340,7 +339,7 @@ impl Interpolator {
Interpolator::Interp1D(interp) => Ok(interp.set_x(new_x)?),
Interpolator::Interp2D(interp) => Ok(interp.set_x(new_x)?),
Interpolator::Interp3D(interp) => Ok(interp.set_x(new_x)?),

Interpolator::InterpND(interp) => Ok(interp.set_grid_x(new_x)?),
_ => Err(Error::NoSuchField),
}
Expand Down Expand Up @@ -370,7 +369,7 @@ impl Interpolator {
Interpolator::Interp1D(interp) => Ok(&interp.strategy),
Interpolator::Interp2D(interp) => Ok(&interp.strategy),
Interpolator::Interp3D(interp) => Ok(&interp.strategy),

Interpolator::InterpND(interp) => Ok(&interp.strategy),
_ => Err(Error::NoSuchField),
}
Expand All @@ -384,7 +383,7 @@ impl Interpolator {
Interpolator::Interp1D(interp) => interp.strategy = new_strategy,
Interpolator::Interp2D(interp) => interp.strategy = new_strategy,
Interpolator::Interp3D(interp) => interp.strategy = new_strategy,

Interpolator::InterpND(interp) => interp.strategy = new_strategy,
_ => return Err(Error::NoSuchField),
}
Expand All @@ -397,7 +396,7 @@ impl Interpolator {
Interpolator::Interp1D(interp) => Ok(&interp.extrapolate),
Interpolator::Interp2D(interp) => Ok(&interp.extrapolate),
Interpolator::Interp3D(interp) => Ok(&interp.extrapolate),

Interpolator::InterpND(interp) => Ok(&interp.extrapolate),
_ => Err(Error::NoSuchField),
}
Expand All @@ -411,7 +410,7 @@ impl Interpolator {
Interpolator::Interp1D(interp) => interp.extrapolate = new_extrapolate,
Interpolator::Interp2D(interp) => interp.extrapolate = new_extrapolate,
Interpolator::Interp3D(interp) => interp.extrapolate = new_extrapolate,

Interpolator::InterpND(interp) => interp.extrapolate = new_extrapolate,
_ => return Err(Error::NoSuchField),
}
Expand All @@ -434,7 +433,7 @@ impl Interpolator {
match self {
Interpolator::Interp2D(interp) => interp.set_y(new_y)?,
Interpolator::Interp3D(interp) => interp.set_y(new_y)?,

Interpolator::InterpND(interp) => interp.set_grid_y(new_y)?,
_ => return Err(Error::NoSuchField),
}
Expand Down Expand Up @@ -473,7 +472,7 @@ impl Interpolator {
pub fn set_z(&mut self, new_z: Vec<f64>) -> Result<(), Error> {
match self {
Interpolator::Interp3D(interp) => Ok(interp.set_z(new_z)?),

Interpolator::InterpND(interp) => Ok(interp.set_grid_z(new_z)?),
_ => Err(Error::NoSuchField),
}
Expand All @@ -498,7 +497,7 @@ impl Interpolator {
}

/// Function to get grid variable from enum variants
pub fn grid(&self) -> Result<&[Vec<f64>], Error> {
match self {
Interpolator::InterpND(interp) => Ok(&interp.grid),
Expand All @@ -509,7 +508,7 @@ impl Interpolator {
/// Function to set grid variable from enum variants
/// # Arguments
/// - `new_grid`: updated `grid` variable to replace the current `grid` variable
pub fn set_grid(&mut self, new_grid: Vec<Vec<f64>>) -> Result<(), Error> {
match self {
Interpolator::InterpND(interp) => Ok(interp.set_grid(new_grid)?),
Expand All @@ -518,7 +517,7 @@ impl Interpolator {
}

/// Function to get values variable from enum variants
pub fn values(&self) -> Result<&ndarray::ArrayD<f64>, Error> {
match self {
Interpolator::InterpND(interp) => Ok(&interp.values),
Expand All @@ -529,7 +528,7 @@ impl Interpolator {
/// Function to set values variable from enum variants
/// # Arguments
/// - `new_values`: updated `values` variable to replace the current `values` variable
pub fn set_values(&mut self, new_values: ndarray::ArrayD<f64>) -> Result<(), Error> {
match self {
Interpolator::InterpND(interp) => Ok(interp.set_values(new_values)?),
Expand Down
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2010 Mazda 3 i-Stop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2012 Ford Focus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2012 Ford Fusion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 AUDI A3 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 BMW 328d 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 CHEVROLET Spark EV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 FORD C-MAX HEV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 FORD Escape 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 FORD Explorer 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 HYUNDAI Elantra 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 Hyundai Tucson Fuel Cell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 KIA Optima Hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 Leaf 24 kWh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 MITSUBISHI i-MiEV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 Nissan Leaf 30 kWh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 TESLA Model S60 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 TOYOTA Camry 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 TOYOTA Corolla 4cyl 2WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 TOYOTA Highlander Hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2016 Toyota Prius Two FWD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2017 CHEVROLET Bolt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2017 Maruti Dzire VDI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2017 Toyota Highlander 3.5 L.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2020 Hero Splendor+ 100cc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2020 VW Golf 1.5TSI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2020 VW Golf 2.0TDI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2021 BMW iX xDrive40.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2021 Cupra Born.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2021 Fiat Panda Mild Hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2021 Honda N-Box G.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2021 Peugot 3008.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Ford F-150 Lightning 4WD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Renault Megane E-Tech.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Renault Zoe ZE50 R135.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Tesla Model 3 RWD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Tesla Model Y RWD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Toyota RAV4 Hybrid LE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Toyota Yaris Hybrid Mid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -714,5 +714,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2022 Volvo XC40 Recharge twin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
1 change: 0 additions & 1 deletion cal_and_val/f3-vehicles/2023 Mitsubishi Pajero Sport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,4 @@ state:
speed_ach_meters_per_second: 0.0
dist_meters: 0.0
grade_curr: 0.0
air_density_kilograms_per_cubic_meter: 1.2
mass_kilograms: .nan
Loading

0 comments on commit 1afacc2

Please sign in to comment.