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

[Feat] r.category: add color option #4071

Open
kritibirda26 opened this issue Jul 18, 2024 · 2 comments · May be fixed by #5011
Open

[Feat] r.category: add color option #4071

kritibirda26 opened this issue Jul 18, 2024 · 2 comments · May be fixed by #5011

Comments

@kritibirda26
Copy link
Contributor

Color option - We should add a new option that outputs the category color. In any use case where the user wants to create a visualization they will want to know the category label and color.

Originally posted by @cwhite911 in #4018 (review)

@kritibirda26 kritibirda26 changed the title @kritibirda26 overall this looks good. [Feat] r.category: add color option Jul 18, 2024
@NishantBansal2003
Copy link
Contributor

I was trying to test the module using the doctest file of r.category:

grass --exec python -m doctest -v test_rcategory_doctest.txt

However, I am getting test failures. Most of them look like this:

Failed example:
    run_command('r.mapcalc', expression='test = if(col() < 3, col(), 2)')
Expected:
    0
Got nothing

How should I fix this? Also, for this new color option, should I write a doctest or a separate unit test(gunittest)?

@petrasovaa
Copy link
Contributor

I was trying to test the module using the doctest file of r.category:

grass --exec python -m doctest -v test_rcategory_doctest.txt

However, I am getting test failures. Most of them look like this:

Failed example:
run_command('r.mapcalc', expression='test = if(col() < 3, col(), 2)')
Expected:
0
Got nothing

This is probably an old doctest, run_command no longer returns returncode by default, but throws exception (the behavior can be changed )

How should I fix this? Also, for this new color option, should I write a doctest or a separate unit test(gunittest)?

I think a pytest like for r.colors.out maybe best.

@NishantBansal2003 NishantBansal2003 linked a pull request Jan 30, 2025 that will close this issue
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 a pull request may close this issue.

3 participants