-
-
Notifications
You must be signed in to change notification settings - Fork 426
temporal: Unused variables in temporal modules #1082
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,6 +183,7 @@ def main(options, flags): | |
| output="dummy", run_=False, | ||
| finish_=False, flags=flags, | ||
| type=method, overwrite=overwrite, | ||
| column=column, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. Do you also consider the previous state a bug? Mentioning @veroandreo to have this confirmed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I'm not sure. This is a call to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In both cases, the documentation says it is Name of attribute column to store value. So according to the doc, it is a name, not what should be be stored. (In theory, you could store, e.g., color, but that's not the case here.) Then it makes sense to pass it and since there is a default which is often good enough, it is not surprising that nobody complained.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it puts value as default column name. Since there's no option to store any other attribute, I believe it's a reasonable default name. Of course, maybe better to have it explicitly there in case eventually |
||
| quiet=True) | ||
|
|
||
| # The module queue for parallel execution, except if attribute tables should | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,8 +25,7 @@ def setUpClass(cls): | |
| os.putenv("GRASS_OVERWRITE", "1") | ||
| tgis.init(True) # Raise on error instead of exit(1) | ||
| cls.use_temp_region() | ||
| ret = grass.script.run_command("g.region", n=80.0, s=0.0, e=120.0, | ||
| w=0.0, t=100.0, b=0.0, res=10.0) | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you try to run this test? This call has an "side effect" meaning it does something else than just generate the return value, specifically it sets the computational region to whatever the test is meant to be executed with. The
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks for the comments, yeah, completely missed the testing. However, I'm not completely sure how to run them locally, if you could give me some light on that I would really appreciate it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For running tests you need NC SPM sample dataset. Use the alpha version from http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz to have the same one used in the CI. The commands to run the tests are at the following page under Running tests and creating report and under Running individual test files. You can run a single file or a (sub)directory. https://grass.osgeo.org/grass79/manuals/libpython/gunittest_running_tests.html |
||
|
|
||
| cls.runModule("r3.mapcalc", overwrite=True, quiet=True, expression="a1 = 1") | ||
| cls.runModule("r3.mapcalc", overwrite=True, quiet=True, expression="a2 = 2") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to the
ret = grass.script.run_commandline, these also do something, but since the test is about something else there seems to be no reason to just test ifget_registered_maps_as_objects()executes, nor further investigate its result. So, I agree with removing those.