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

r.vif.py: add error message #942

Merged
merged 2 commits into from
Sep 17, 2023
Merged

r.vif.py: add error message #942

merged 2 commits into from
Sep 17, 2023

Conversation

ecodiv
Copy link
Contributor

@ecodiv ecodiv commented Sep 16, 2023

The error message given when one of the input layers has no values (within the computational region) does not help to understand the problem. Added an error message to suggest the possible cause of the error. On the command line, the error message is written in red.

The error message given when one of the input layers has no values (within the computational region) does not help to understand the problem. Added an error message to suggest the possible cause of the error. Print error messages in color.
correct black and flake8 style issues
@ecodiv ecodiv merged commit 176bf29 into grass8 Sep 17, 2023
12 checks passed
@wenzeslaus wenzeslaus deleted the ecodiv-patch-r-vif-1 branch September 18, 2023 14:22
@wenzeslaus
Copy link
Member

Here is some feedback about this: We try to make the behavior across the 800+ different tools in GRASS GIS standardized. This is adding two colors for messages which are not present in other tools. I'm all for colorful messages with message for an error and a hint/tip, but we need a more standardized approach which would be reusable in other tools. Having a PR adding your two functions to the library would be a good start.

@wenzeslaus wenzeslaus added bug Something isn't working Python Related code is in Python labels Sep 18, 2023
@ecodiv
Copy link
Contributor Author

ecodiv commented Sep 18, 2023

Hi @wenzeslaus , good point, didn't think about that. Wouldn't mind making such PR, but wouldn't know where to do that?

@wenzeslaus
Copy link
Member

The closest existing thing is grass.script.message and grass.script.fatal. They live in python/grass/script/core.py in the core repo. You can see from there that the Python side mostly relies on the g.message tool in C, but let's have that discussion in the PR.

cwhite911 pushed a commit to cwhite911/grass-addons that referenced this pull request Sep 19, 2023
The error message given when one of the input layers has no values (within the computational region) does not help to understand the problem. Added an error message to suggest the possible cause of the error. Print error messages in color.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants