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

v.cluster: Fix unused value assignment #4094

Merged
merged 4 commits into from
Sep 19, 2024
Merged

Conversation

ShubhamDesai
Copy link
Contributor

This pull request fixes the issue identified by coverity scan (CID: 1270389)

The variable eps gets overwritten so initially assigned value is commented.

@github-actions github-actions bot added vector Related to vector data processing C Related code is in C module labels Jul 23, 2024
@lbartoletti
Copy link
Contributor

We're unsure about the intention behind including both 90% and 99% confidence intervals. Was there originally a plan to have an option between 90% and 99%?
Your suggestion to use comment the line is correct, but if we don't need the 90% interval, it might be better to remove that line entirely.
Also, there's a similar case at line 289.

@wenzeslaus
Copy link
Member

Was there originally a plan to have an option between 90% and 99%?

These would be good things to catch when revising the code. Perhaps all is needed is to create an issue for a (possibly?) straightforward addition (good for beginners). I'm tagging original author @metzm and @neteler who contributed to the documentation quite a bit.

@petrasovaa
Copy link
Contributor

I would remove the duplicate eps lines and move on.

@neteler neteler added this to the 8.5.0 milestone Sep 17, 2024
@wenzeslaus
Copy link
Member

I would remove the duplicate eps lines and move on.

I agree. The meaning of the constant literal is documented and the possibility of switch between 99% and 90% is obvious, so there is no added value in keeping that line or a comment in the code.

@ShubhamDesai
Copy link
Contributor Author

I would remove the duplicate eps lines and move on.

I agree. The meaning of the constant literal is documented and the possibility of switch between 99% and 90% is obvious, so there is no added value in keeping that line or a comment in the code.

Done removed the lines.
Also in the documentation https://grass.osgeo.org/grass84/manuals/v.cluster.html
it mentions "If the maximum distance is not specified with the distance option, the maximum distance is estimated from the observed distances to the neighbors using the upper 99% confidence interval."

so i guess it refers to the 99% confidence interval

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

Good. Thanks for checking the documentation.

@wenzeslaus wenzeslaus enabled auto-merge (squash) September 19, 2024 00:31
@wenzeslaus wenzeslaus merged commit 333d8e6 into OSGeo:main Sep 19, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C module vector Related to vector data processing
Projects
Development

Successfully merging this pull request may close these issues.

6 participants