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.to.rast: Change use=val to use=value #3110

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

wenzeslaus
Copy link
Member

The use parameter (option) had value 'val' while the parameter which is using that is called value. This makes it consistent, so use=value and value=1, not use=val and value=1. Both can be shortened, so even use=val and val=1 are still valid parameters.

This changes code which is using v.to.rast.

This does not change the other possible values (options), namely attr, cat, and dir.

The use parameter (option) had value 'val' while the parameter which is using that is called value. This makes it consistent, so use=value and value=1, not use=val and value=1. Both can be shortened, so even use=val and val=1 are still valid parameters.

This changes code which is using v.to.rast.

This does not change the other possible values (options), namely attr, cat, and dir.
@neteler neteler added this to the 8.4.0 milestone Aug 3, 2023
@wenzeslaus wenzeslaus added the vector Related to vector data processing label Nov 8, 2023
@wenzeslaus wenzeslaus merged commit 698a47e into OSGeo:main Nov 8, 2023
19 checks passed
@wenzeslaus wenzeslaus deleted the v_to_rast-improve-parameters branch November 8, 2023 15:46
@wenzeslaus wenzeslaus changed the title v.to.rast: Change val to value v.to.rast: Change use=val to use=value Nov 8, 2023
@wenzeslaus
Copy link
Member Author

I'm getting error with using through grass.pygrass:

...
   File "/home/runner/install/grass84/etc/python/grass/pygrass/modules/interface/module.py", line 653, in update
    self.inputs[key].value = val
  File "/home/runner/install/grass84/etc/python/grass/pygrass/modules/interface/parameter.py", line 212, in _set_value
    self._value, self._rawvalue = _check_value(self, value)
  File "/home/runner/install/grass84/etc/python/grass/pygrass/modules/interface/parameter.py", line 110, in _check_value
    raise ValueError(must_val % (param.name, param.values))
ValueError: The Parameter <use>, must be one of the following values: ['attr', 'cat', 'value', 'z', 'dir']

Possibly, the check there needs to be less strict.

wenzeslaus added a commit to wenzeslaus/grass that referenced this pull request Nov 29, 2023
Command line interface parser allows parameter (option) values such as 'val' when full value should be 'value'. Parameter class from pygrass does the checking, but does not know about these rules. This addition covers the simple case of val-value which is not much work to implement and maintain. It does not cover more complex cases with underscores and legacy aliases.

The test covers the issue for use=value change in v.to.rast made in OSGeo#3110.

Strict checking in pygrass is discussed in OSGeo#3237.
wenzeslaus added a commit that referenced this pull request Dec 21, 2023
Command line interface parser allows parameter (option) values such as 'val' when full value should be 'value'. Parameter class from pygrass does the checking, but does not know about these rules. This addition covers the simple case of val-value which is not much work to implement and maintain. It does not cover more complex cases with underscores and legacy aliases.

The test covers the issue for use=value change in v.to.rast made in #3110.

Strict checking in pygrass is discussed in #3237.
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Jan 9, 2024
The use parameter (option) had value 'val' while the parameter which is using that is called value. This makes it consistent, so use=value and value=1, not use=val and value=1. Both can be shortened, so even use=val and val=1 are still valid parameters.

This changes code which is using v.to.rast.

This does not change the other possible values (options), namely attr, cat, and dir.
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Jan 9, 2024
Command line interface parser allows parameter (option) values such as 'val' when full value should be 'value'. Parameter class from pygrass does the checking, but does not know about these rules. This addition covers the simple case of val-value which is not much work to implement and maintain. It does not cover more complex cases with underscores and legacy aliases.

The test covers the issue for use=value change in v.to.rast made in OSGeo#3110.

Strict checking in pygrass is discussed in OSGeo#3237.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vector Related to vector data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants