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

Windbarbs supplement #7808

Merged
merged 25 commits into from
Sep 28, 2023
Merged

Windbarbs supplement #7808

merged 25 commits into from
Sep 28, 2023

Conversation

joa-quim
Copy link
Member

@joa-quim joa-quim commented Sep 10, 2023

This PR contains the code to plot windbarbs either from table data as well as two grids, à lá grdvector.

The code was a little reworked from that of https://sites.google.com/site/masahigaki/gmt/gmt-windbarb?authuser=0 with changes to make it compile with GMT master version and drop the complicated plugin recipe.

@PaulWessel
Copy link
Member

Things to do:

Compare with psxy and note there needs to be changes to:

  1. How the usage function is not using the new way with the GMT_Usage function (to handle variable terminal widths)
  2. Probably something related to -C if no argument (modern mode stuff)
  3. Maybe KEYS - did not look very carefully.
  4. Perhaps RST stuff using our SYN-* macros.
  5. ???

@joa-quim
Copy link
Member Author

joa-quim commented Sep 10, 2023

How the usage function is not using the new way with the GMT_Usage function (to handle variable terminal widths)

It does

Perhaps RST stuff using our SYN-* macros

It does, and I made several changes too.

It now builds without need to set anything in ConfigUser.cmake. That is, it lands directly in the supplements shared lib.
Docs are also visible if you do ninja docs_html; ninja install

@PaulWessel
Copy link
Member

Ok I just browsed the code on GitHub and that used GMT_Message. Will try tomorrow

@joa-quim
Copy link
Member Author

When you try, change the mode to +x of the two sh examples to stop that Code Validator failure. It ignores what I do on Windows.

@PaulWessel
Copy link
Member

Done, but unless you have uncommitted changes, there is no use of GMT_Usage in these codes etc.

@PaulWessel
Copy link
Member

And since this is a branch: Given how all the other supplements are (all "required" together) you should places those tests and rst in their final places now, i.e, test/windbarb/yourwtoscripts and in rst/source/supplements/windbarg and so on. It is OK to not have PS files from the test so far so no worries about dvc.

@joa-quim
Copy link
Member Author

joa-quim commented Sep 10, 2023

test/windbarb/yourwtoscripts

I just copied his 2 shell examples. They are not tests.

rst/source/supplements/windbarg

They are already in doc\rst\source\supplements\windbarbs

@joa-quim
Copy link
Member Author

there is no use of GMT_Usage in these codes etc.

I don't even know how to use them. I find it to much pain for no gain.

@masahigaki
Copy link
Contributor

Dear all,
It would be my great pleasure if the windbarb extension would be included in the GMT Supplement.

you should places those tests and rst in their final places now, i.e, test/windbarb/yourwtoscripts

Regarding test scripts, I rewrite the example scripts *barb_example.sh, and put them into test/windbarbs/ subdirectory on my private repository masahigaki/gmt@e6cb3f6
The shbang of the scripts is fixed to "#!/usr/bin/env bash" to pass the code validator.

I would appreciate if you could examine the changes.
Masakazu

@joa-quim
Copy link
Member Author

Hi Masakazu,

Thanks for that and sorry for not having been more clear. When I said some examples, I was thinking 3 or 4. Just the enough to test the different capabilities (~ps vs grd, with and without a CPT, a 3D case). Not all of them because our test set already takes quite some time to run. The other thing is that we want to avoid having to store the data in our cache system, so we need to generate it for the tests, which your examples already do. I added just one test in this branch to show what I mean. If you could add a minimal set of other representative cases, that would be nice.

Joaquim

@masahigaki
Copy link
Contributor

masahigaki commented Sep 24, 2023

Dear Joaquim,

Thank you for the clarification and I am sorry for my delayed response.
As per your suggestion, I chose four scripts for windbarbs test, removed data files in the test directory, and updated the scripts to generate data.
Please look at masahigaki/gmt@9e9133aa

@masahigaki
Copy link
Contributor

I have rewrited {grd,ps,wind}barb.c to use GMT_Usage instead of GMT_Message at masahigaki/gmt@7519afbf .
Your confirmation would be appreciated.

@joa-quim
Copy link
Member Author

Dear Mazakazu,

Thank you very much for these contributions. I've integrated them (plus the extra tests) in the official branch.

One further thing. We could drop the -T option from psbarb, at least from the documentation. The rational is that psxy already offers that option (also called -T) and in grdbarb -T means another thing.

@joa-quim joa-quim changed the title WIP Windbarbs future supplement Windbarbs supplement Sep 27, 2023
@joa-quim
Copy link
Member Author

@PaulWessel I think this is good for merging.

Remnants of csh in scripts, e.g., \rm.  Changed to rm -f
@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added test/baseline/windbarbs/
added test/baseline/windbarbs/grdbarb_01.ps
added test/baseline/windbarbs/grdbarb_02.ps
added test/baseline/windbarbs/psbarb_01.ps
added test/baseline/windbarbs/psbarb_02.ps

Image diff(s)

Added images

  • test/baseline/windbarbs/grdbarb_01.png

  • test/baseline/windbarbs/grdbarb_02.png

  • test/baseline/windbarbs/psbarb_01.png

  • test/baseline/windbarbs/psbarb_02.png

Modified images

Path Old New

Report last updated at commit 14e78f7

@PaulWessel
Copy link
Member

Think it is ready now.

@PaulWessel PaulWessel added documentation Improve documentation new module PR that implements a new module supplement update PR that implements a new feature for supplement modules labels Sep 28, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Sep 28, 2023
@PaulWessel PaulWessel added the add-changelog Add PR to the changelog label Sep 28, 2023
Copy link
Member

@PaulWessel PaulWessel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests work, docs look good, -T gone from sight, C-fixes seems fine. Have a look too.

@joa-quim
Copy link
Member Author

I see that the psbarb.rst includes barb.rst but no manual is included. The page has synopsis and jumps to Examples.

@PaulWessel
Copy link
Member

I forgot - will look in < 1 hour

@PaulWessel
Copy link
Member

Had forgotten to do what is also done for psmeca.rst and meca.rst.

@PaulWessel
Copy link
Member

psbarb is fixed

@joa-quim
Copy link
Member Author

Ok, let's give this light.

@joa-quim joa-quim merged commit dc5c8ab into master Sep 28, 2023
7 checks passed
@joa-quim joa-quim deleted the windbarbs-suppl branch September 28, 2023 21:32
@masahigaki
Copy link
Contributor

Thank you very much for fixing the windbarbs code and merging it into master.

@joa-quim
Copy link
Member Author

Hi Masakazu, If you have a nice windbarbs map, kind of official looking with meteorological agency logos and so, it would be a nice post in the Forum Showcase

@PaulWessel
Copy link
Member

Hi Masahigaki-san. Thanks for your contribution - we have update some of the code, scripts, and docs to fit with the rest of the supplements. Because of such changes, please be on the lookout for any odd behavior so we can fix it quickly before the upcoming 6.5 release.

@masahigaki
Copy link
Contributor

masahigaki commented Sep 30, 2023

Paul-san,
Thank you again for adding the windbarbs code into GMT Supplement.

I think "2-D" should be added to

.. |barb_purpose| replace:: Plot wind barbs in 3-D

as well as in
#define THIS_MODULE_PURPOSE "Plot wind barbs in 2-D and 3-D"

Regards,
Masakazu

@PaulWessel
Copy link
Member

Yes, I had already done the update (it is a define statement in the C code) but forgot to run the script that builds those rst includes. Thanks, now updated in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-changelog Add PR to the changelog documentation Improve documentation new module PR that implements a new module supplement update PR that implements a new feature for supplement modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants