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

Ndr/cleanup #30

Merged
merged 11 commits into from
Nov 15, 2023
Merged

Ndr/cleanup #30

merged 11 commits into from
Nov 15, 2023

Conversation

nreinicke
Copy link
Collaborator

Address a couple of items:

  • fix homepage link in pyproject.toml
  • fix deploy-docs action to include proper dependencies
  • remove returning the full search tree from OSM defaults
  • run cargo clippy and and fix all the errors and warnings that came up

I also updated VSCode to use clippy to check and lint the code instead of the default of cargo check. I had to add the following line to my settings.json file:

"rust-analyzer.check.overrideCommand": ["cargo", "clippy", "--workspace", "--message-format=json"] 

@nreinicke
Copy link
Collaborator Author

Just added in some updates to the docs to point to the conda-forge package for an installation option.

Copy link
Collaborator

@robfitzgerald robfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nice and sensible changes in here. i'm sure that we just took care of some of issue #2 in the process.

a silly find-and-replace text fix requested.

also, can you explain to me how we can load nrel.routee.compass now without init.py files? shouldn't it just import as import compass now? or does the directory position relative to the pyproject.toml file somehow implicitly form package names?

oh, and, why the name change to graph_struct for the graph module?

let pos: Option<Vec<usize>> = Some(vec![0 as usize; sets.len()]);
return MultiSet {
let final_pos: Vec<usize> = sets.iter().map(|v| v.len() - 1).collect();
let pos: Option<Vec<usize>> = Some(vec![0_usize; sets.len()]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a typo. is 0_usize valid rust code?

Copy link
Collaborator Author

@nreinicke nreinicke Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was one of the auto clippy fixes (here's the lint doc) and I didn't know this but apparently it is valid rust code. But just putting in 0 would also work since we have an explicit type on the left and so maybe I just do that

@@ -7,9 +7,9 @@ pub trait CompassJsonExtensions {

impl CompassJsonExtensions for serde_json::Value {
/// attempts to read queries from the user in the three following ways:
/// 1. top-level of JSON is an array -> return it directly
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

victims of find-and-replace on the word "return", can you return these to how they were?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops! yes good catch

@nreinicke
Copy link
Collaborator Author

why the name change to graph_struct for the graph module?

The name change was the the result of this clippy suggestion: https://rust-lang.github.io/rust-clippy/master/index.html#/module_inception

can you explain to me how we can load nrel.routee.compass now without init.py files?

This was the result of PEP 420 that I only recently learned about. Now, namespaces are preferred to be implicit rather than explicit (as they used to be here) and python can understand how to get to the base level package. This became important when I attempted to build a new namespace package that depended on these other namespace packages.

Copy link
Collaborator

@robfitzgerald robfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for all of the improvements here! i do think "graph_struct" is weird, maybe what we need is to change the outer module name to "road_network" or something like that, and keep the inner module name "graph"? but i'll leave that to you if you like it, want to leave it or have a different idea.

@nreinicke
Copy link
Collaborator Author

maybe what we need is to change the outer module name to "road_network" or something like that

yeah I like that idea, just pushed up that change

@nreinicke nreinicke merged commit 8c27cda into main Nov 15, 2023
5 checks passed
@nreinicke nreinicke deleted the ndr/cleanup branch November 15, 2023 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants