-
-
Notifications
You must be signed in to change notification settings - Fork 311
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.colors.out: Add JSON support #4555
Conversation
dfe6501
to
8e92475
Compare
The style errors are mostly about file endings. Either run pre-commit locally or use ruff and black. Applying the suggested comment might not always work, as it's missing a final newline. |
8e92475
to
3e7b81e
Compare
Please re-trigger the CI... |
3e7b81e
to
1b84a64
Compare
1b84a64
to
9832379
Compare
Once we start having review comments, it's easier when there's no more force pushes, as it's hard to follow when the commit doesn't exist anymore. |
Apologies, I initially thought the previous change was causing issues and was not relevant. I will be more careful next time. |
There's no review comments (from us) yet, so you're doing fine ;) |
But take a look at the build failures already here. Are you able to debug them locally, by doing a build on your side and fixing them ? |
I've found one error line on the macOS one: 8905-8907: https://github.com/OSGeo/grass/actions/runs/11455850645/job/31882348189#step:10:8906
So maybe try locally with the same flags as the GNU standards check job, to ensure the unused parameters are triggered as errors so you see them |
Also make sure that you have correctly cleaned locally to make sure you build everything to see the potential issues |
Sure, thanks! Fixing the issues now... |
@cwhite911 Can you give your opinion on representing the special values - default and nulls (nv) and on representing the color itself? |
...define the individual color output as "intersection between HTML/CSS formats and GRASS GIS supported formats" so now hex format, but possibly |
(for this, see https://github.com/OSGeo/grass/blob/main/doc/development/style_guide.md#using-pre-commit) |
Is there anything that needs to be addressed? |
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.
Hi @NishantBansal2003. Nice job working on this PR! I've added a few comments for some improvements and had a few questions as well.
Will you add HEX or any other color formats as outputs?
Signed-off-by: Nishant Bansal <[email protected]>
Signed-off-by: Nishant Bansal <[email protected]>
Signed-off-by: Nishant Bansal <[email protected]>
Signed-off-by: Nishant Bansal <[email protected]>
Signed-off-by: Nishant Bansal <[email protected]>
Signed-off-by: Nishant Bansal <[email protected]>
24fa1e5
to
c16a63a
Compare
Signed-off-by: Nishant Bansal <[email protected]>
Rebasing because I was getting some unrelated errors in the last CI run. |
Hey @echoix could you retrigger the CI, need to check if the errors of last CI run was resolved or not, since it is working fine in my local. |
Looks like there's an issue in my code. Can you help me debug it? |
I don't understand yet... What is bothering me is tests on linux, without Pytest, on seemingly unrelated modules are failing too.. Is there something on the C library side that collides or something? a header problem? |
I think something changed for macOS, a new run on merging the repo's main branch to my fork ends up failing while it wasn't failing on the upstream repo. Our env cache clears once a week, probably on sundays. |
Some pytest tests are also failing in unrelated modules (https://github.com/OSGeo/grass/actions/runs/11643760411/job/32442951891?pr=4555#step:12:7654), and the same pytest tests are also failing locally for me. I'm not sure why this issue is occurring; is there something I'm missing? EDIT: Never mind, I fixed the pytest failure(in local), but I'm not sure why the pytest fails without the last commit. |
Signed-off-by: Nishant Bansal <[email protected]>
I'm afraid the platform to discuss it is here, and you are part of the discussion. I know it is hard to determine the tone of the comments in the discussion, so many thanks for your patience with this PR. With 104 conversation comments and the code being in a good shape from the beginning, I would prefer to merge this soon. I will check once more and aim at approving review, but I will be happy if someone else is faster in doing that. We may want to wait for macOS CI to be fixed before actually merging this. |
Co-authored-by: Vaclav Petras <[email protected]>
I suggest to merge this as is because any further discussion here is getting confusing. If devs have some tweaks, I suggest to open a new PR. Thanks @NishantBansal2003 for your patience! |
Thank you, reviewers. I’ve gained valuable insights through this PR, and your feedback has been instrumental in my learning process. I apologise if my tone seemed off in any of our discussions or if I was overly opinionated or asked too many questions at times. I’ll work on improving in this regard and am committed to contributing further to the GRASS GIS community 🌍💚. |
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.
Thank you @NishantBansal2003! And thanks everyone for their opinionated opinions! :-)
* r.colors.out: added json output Signed-off-by: Nishant Bansal <[email protected]> * fixed CI build issues Signed-off-by: Nishant Bansal <[email protected]> * refactor code Signed-off-by: Nishant Bansal <[email protected]> * added more color formats and tests Signed-off-by: Nishant Bansal <[email protected]> * additional changes based on review Signed-off-by: Nishant Bansal <[email protected]> * fixes prototype declaration Signed-off-by: Nishant Bansal <[email protected]> * fixes test Signed-off-by: Nishant Bansal <[email protected]> * added option instead of flags Signed-off-by: Nishant Bansal <[email protected]> * Add a standard parser option for color formatting Signed-off-by: Nishant Bansal <[email protected]> * added changes based on review Signed-off-by: Nishant Bansal <[email protected]> * fixes function name Signed-off-by: Nishant Bansal <[email protected]> * fixes pytest failure Signed-off-by: Nishant Bansal <[email protected]> * Update lib/gis/parser_standard_options.c --------- Signed-off-by: Nishant Bansal <[email protected]>
fixes: #3537
Use parson to add json output format support to the r.colors.out and r3.colors.out module.
The JSON output looks like as follows: