diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8a55efc7..1da10506 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -11,18 +11,18 @@ members = [ serde = { version = "1.0.160", features = ["derive"] } serde_json = "1.0" rayon = "1.7.0" -geo = { version = "0.26.0", features = ["use-serde", "use-proj"] } +geo = { version = "0.27.0", features = ["use-serde", "use-proj"] } geo-types = "0.7.12" proj = "0.27.2" geojson = { version = "0.24.1" } rstar = "0.11.0" thiserror = "1.0.0" flate2 = "1.0" -kdam = "0.4.1" +kdam = "0.5.0" log = "0.4.19" env_logger = "0.10.0" csv = { version = "1.2.2" } -itertools = { version = "0.11.0" } +itertools = { version = "0.12.0" } chrono = "0.4.26" regex = "1.9.5" wkt = { version = "0.10.3", features = ["serde"] } diff --git a/rust/routee-compass-core/Cargo.toml b/rust/routee-compass-core/Cargo.toml index 2dc6ce7b..6af2181b 100644 --- a/rust/routee-compass-core/Cargo.toml +++ b/rust/routee-compass-core/Cargo.toml @@ -17,7 +17,7 @@ rayon = { workspace = true } thiserror = { workspace = true } flate2 = { workspace = true } geo = { workspace = true } -ordered-float = { version = "3.7.0", features = ["serde"] } +ordered-float = { version = "4.1.1", features = ["serde"] } derive_more = "0.99.0" priority-queue = "1.3.2" csv = { workspace = true } diff --git a/rust/routee-compass-core/src/model/traversal/default/speed_lookup_model.rs b/rust/routee-compass-core/src/model/traversal/default/speed_lookup_model.rs index 11e93702..1ec271fc 100644 --- a/rust/routee-compass-core/src/model/traversal/default/speed_lookup_model.rs +++ b/rust/routee-compass-core/src/model/traversal/default/speed_lookup_model.rs @@ -34,7 +34,7 @@ impl SpeedLookupModel { output_time_unit_opt: Option, ) -> Result { let speed_table: Box<[Speed]> = - read_utils::read_raw_file(&speed_table_path, read_decoders::default, None).map_err( + read_utils::read_raw_file(speed_table_path, read_decoders::default, None).map_err( |e| { TraversalModelError::FileReadError( speed_table_path.as_ref().to_path_buf(), diff --git a/rust/routee-compass-powertrain/src/routee/energy_model_service.rs b/rust/routee-compass-powertrain/src/routee/energy_model_service.rs index fce8d601..0a365465 100644 --- a/rust/routee-compass-powertrain/src/routee/energy_model_service.rs +++ b/rust/routee-compass-powertrain/src/routee/energy_model_service.rs @@ -39,7 +39,7 @@ impl EnergyModelService { // load speeds table let speed_table: Arc> = Arc::new( - read_utils::read_raw_file(&speed_table_path, read_decoders::default, None).map_err( + read_utils::read_raw_file(speed_table_path, read_decoders::default, None).map_err( |e| { TraversalModelError::FileReadError( speed_table_path.as_ref().to_path_buf(), @@ -51,7 +51,7 @@ impl EnergyModelService { let grade_table: Arc>> = match grade_table_path_option { Some(gtp) => Arc::new(Some( - read_utils::read_raw_file(>p, read_decoders::default, None).map_err(|e| { + read_utils::read_raw_file(gtp, read_decoders::default, None).map_err(|e| { TraversalModelError::FileReadError( speed_table_path.as_ref().to_path_buf(), e.to_string(), diff --git a/rust/routee-compass-py/Cargo.toml b/rust/routee-compass-py/Cargo.toml index e24a6f50..68399709 100644 --- a/rust/routee-compass-py/Cargo.toml +++ b/rust/routee-compass-py/Cargo.toml @@ -11,9 +11,9 @@ documentation = "https://docs.rs/routee-compass" [dependencies] routee-compass = { path = "../routee-compass", version = "0.3.0" } -pyo3 = { version = "0.19", features = ["extension-module"] } +pyo3 = { version = "0.20.0", features = ["extension-module"] } serde_json = { workspace = true } -config = {workspace = true } +config = { workspace = true } [lib] name = "routee_compass_py" diff --git a/rust/routee-compass/src/app/compass/config/traversal_model/energy_model_builder.rs b/rust/routee-compass/src/app/compass/config/traversal_model/energy_model_builder.rs index c20ba155..f024383e 100644 --- a/rust/routee-compass/src/app/compass/config/traversal_model/energy_model_builder.rs +++ b/rust/routee-compass/src/app/compass/config/traversal_model/energy_model_builder.rs @@ -57,10 +57,7 @@ impl TraversalModelBuilder for EnergyModelBuilder { .get_config_string(String::from("type"), traversal_key.clone()) .map_err(|e| TraversalModelError::BuildError(e.to_string()))?; let vehicle_builder = VehicleBuilder::from_string(vehicle_type).map_err(|e| { - TraversalModelError::BuildError(format!( - "Error building vehicle builder: {}", - e.to_string() - )) + TraversalModelError::BuildError(format!("Error building vehicle builder: {}", e)) })?; let vehicle = vehicle_builder .build(&vehicle_config) diff --git a/rust/routee-compass/src/plugin/input/default/vertex_rtree/plugin.rs b/rust/routee-compass/src/plugin/input/default/vertex_rtree/plugin.rs index 0ffb7591..f40fa893 100644 --- a/rust/routee-compass/src/plugin/input/default/vertex_rtree/plugin.rs +++ b/rust/routee-compass/src/plugin/input/default/vertex_rtree/plugin.rs @@ -113,7 +113,7 @@ impl RTreePlugin { distance_unit: Option, ) -> Result { let vertices: Box<[Vertex]> = - read_utils::from_csv(&vertex_file, true, None).map_err(PluginError::CsvReadError)?; + read_utils::from_csv(vertex_file, true, None).map_err(PluginError::CsvReadError)?; let vertex_rtree = VertexRTree::new(vertices.to_vec()); let tolerance = match (tolerance_distance, distance_unit) { (None, None) => None, diff --git a/rust/routee-compass/src/plugin/output/default/traversal/plugin.rs b/rust/routee-compass/src/plugin/output/default/traversal/plugin.rs index a8b1349d..3bd64477 100644 --- a/rust/routee-compass/src/plugin/output/default/traversal/plugin.rs +++ b/rust/routee-compass/src/plugin/output/default/traversal/plugin.rs @@ -10,7 +10,6 @@ use kdam::BarExt; use routee_compass_core::util::fs::fs_utils; use routee_compass_core::util::fs::read_utils::read_raw_file; use routee_compass_core::util::geo::geo_io_utils; -use routee_compass_core::util::geo::geo_io_utils::parse_linestring; use std::path::Path; pub struct TraversalPlugin { @@ -26,7 +25,7 @@ impl TraversalPlugin { tree: Option, ) -> Result { let count = - fs_utils::line_count(filename.clone(), fs_utils::is_gzip(&filename)).map_err(|e| { + fs_utils::line_count(filename.clone(), fs_utils::is_gzip(filename)).map_err(|e| { PluginError::FileReadError(filename.as_ref().to_path_buf(), e.to_string()) })?; @@ -41,7 +40,7 @@ impl TraversalPlugin { let _ = pb.update(1); }); let geoms = - read_raw_file(&filename, geo_io_utils::parse_linestring, Some(cb)).map_err(|e| { + read_raw_file(filename, geo_io_utils::parse_linestring, Some(cb)).map_err(|e| { PluginError::FileReadError(filename.as_ref().to_path_buf(), e.to_string()) })?; println!(); @@ -100,7 +99,7 @@ mod tests { model::{ cost::Cost, road_network::edge_id::EdgeId, traversal::state::state_variable::StateVar, }, - util::fs::read_utils::read_raw_file, + util::{fs::read_utils::read_raw_file, geo::geo_io_utils::parse_linestring}, }; use std::collections::HashMap; use std::path::PathBuf; diff --git a/rust/routee-compass/src/plugin/output/default/uuid/plugin.rs b/rust/routee-compass/src/plugin/output/default/uuid/plugin.rs index af74bba3..40124bee 100644 --- a/rust/routee-compass/src/plugin/output/default/uuid/plugin.rs +++ b/rust/routee-compass/src/plugin/output/default/uuid/plugin.rs @@ -15,7 +15,7 @@ pub struct UUIDOutputPlugin { impl UUIDOutputPlugin { pub fn from_file>(filename: &P) -> Result { let count = - fs_utils::line_count(filename.clone(), fs_utils::is_gzip(&filename)).map_err(|e| { + fs_utils::line_count(filename.clone(), fs_utils::is_gzip(filename)).map_err(|e| { PluginError::FileReadError(filename.as_ref().to_path_buf(), e.to_string()) })?; @@ -30,7 +30,7 @@ impl UUIDOutputPlugin { let _ = pb.update(1); }); - let uuids = read_raw_file(&filename, |_idx, row| Ok(row), Some(cb)).map_err(|e| { + let uuids = read_raw_file(filename, |_idx, row| Ok(row), Some(cb)).map_err(|e| { PluginError::FileReadError(filename.as_ref().to_path_buf(), e.to_string()) })?; println!();