NREL / routee-compass

The RouteE-Compass energy-aware routing engine
https://nrel.github.io/routee-compass/
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

replace custom csv_mapping::traverse with JSONPath #193

Open robfitzgerald opened 2 months ago

robfitzgerald commented 2 months ago

there's a hand-rolled method to perform JSONPath-like traversals of serde Value classes, but it only supports object-style paths such as request.origin_x or route.traversal_summary.distance. but in the age of k-shortest path results, we now may have an array of routes or trees. to traverse to the traversal summary of the route at index 2, one should be able to provide the path route[2].traversal_summary.distance.

fortunately, this has been solved: https://docs.rs/serde_json_path/latest/serde_json_path/

install this and swap it out for the custom traverse method.