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

Add splines figure and script #6656

Merged
merged 10 commits into from
May 6, 2022
Merged

Add splines figure and script #6656

merged 10 commits into from
May 6, 2022

Conversation

Esteban82
Copy link
Member

This PR is related to issue #6643. It add a new figure and script to better explain the splines in the docs.

Here I add the script. Let me know if it is ok.

In what part of the docs should the figure go? At the end of -F argument?

Fixes #6643

This PR is related to issue #6643. It add a new figure and script to better explain the splines in the docs.

Here I add the script. Let me know if it is ok. 

In what part of the docs should the figure go? At the end of -F argument?
@Esteban82 Esteban82 changed the title Add files via upload Add splines figure and script May 2, 2022
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.

Looks good but may I ask for a few improvements:

  1. add a tab in front of all commands inside the gmt begin/end block
  2. Add "show" to gmt end [the tests and doc builds turns that off anyway but it is handy when debugging and testing]

If you plan to add the PostScript file and update the sample1d.rst file perhaps do that as part of the same PR? If you follow the guidelines you will see that once you get the PS file and is happy with it and place it in the image directory then it needs to be added to git (so there will be another file showing up here) plus of course using dvc to add it to taht repo as well. Only after that would we be able to test this branch and build the doc, for instan.ce

Updated script following Paul's suggestions.
Changed name and format of the output file.
@Esteban82
Copy link
Member Author

Thanks Paul.

Yes, my idea is to edit the rst file and add the figure. I let you know if I need help.

@Esteban82 Esteban82 changed the title Add splines figure and script WIP Add splines figure and script May 2, 2022
@Esteban82
Copy link
Member Author

I am bit confused on how to proceed. Where should I add the ps file?

@PaulWessel
Copy link
Member

Follow the instructions for adding a new test or doc script on https://docs.generic-mapping-tools.org/dev/devdocs/contributing.html#contributing-documentation

Basically:
Run the full tests
Copy the new PS file to doc/scripts/images
run dvc diff etc etc as it shows above. This assumes you have set up dvc which I got the impression you had.

@maxrjones
Copy link
Member

This is the specific section with instructions for adding the figure to doc/scripts/images. Please let me know if you think any part of the instructions needs improvement.

@Esteban82
Copy link
Member Author

I think I have a problem with running the test. I do it as indicated in docs.

1038/1044 Test #1036: test/time/time_testing_6.sh ..................   Passed    1.32 sec
          Start 1042: test/triangulate/nnn.sh
1039/1044 Test #1040: test/trend1d/trend1.sh .......................   Passed    1.26 sec
          Start 1043: test/triangulate/trivor.sh
1040/1044 Test #1042: test/triangulate/nnn.sh ......................   Passed    1.31 sec
          Start 1044: test/xyz2grd/gridrange.sh
1041/1044 Test #1044: test/xyz2grd/gridrange.sh ....................   Passed    0.21 sec
1042/1044 Test #1041: test/trend2d/trend.sh ........................   Passed    1.61 sec
1043/1044 Test #1043: test/triangulate/trivor.sh ...................   Passed    0.95 sec

## It runs until here where it stops for several minutes and I cancel it (Ctrl+c).

^Cmake[3]: *** [CMakeFiles/check.dir/build.make:57: CMakeFiles/check] Interrupción
make[2]: *** [CMakeFiles/Makefile2:660: CMakeFiles/check.dir/all] Interrupción
make[1]: *** [CMakeFiles/Makefile2:667: CMakeFiles/check.dir/rule] Interrupción
make: *** [Makefile:223: check] Interrupción

@maxrjones
Copy link
Member

I think I have a problem with running the test. I do it as indicated in docs.

1038/1044 Test #1036: test/time/time_testing_6.sh ..................   Passed    1.32 sec
          Start 1042: test/triangulate/nnn.sh
1039/1044 Test #1040: test/trend1d/trend1.sh .......................   Passed    1.26 sec
          Start 1043: test/triangulate/trivor.sh
1040/1044 Test #1042: test/triangulate/nnn.sh ......................   Passed    1.31 sec
          Start 1044: test/xyz2grd/gridrange.sh
1041/1044 Test #1044: test/xyz2grd/gridrange.sh ....................   Passed    0.21 sec
1042/1044 Test #1041: test/trend2d/trend.sh ........................   Passed    1.61 sec
1043/1044 Test #1043: test/triangulate/trivor.sh ...................   Passed    0.95 sec

## It runs until here where it stops for several minutes and I cancel it (Ctrl+c).

^Cmake[3]: *** [CMakeFiles/check.dir/build.make:57: CMakeFiles/check] Interrupción
make[2]: *** [CMakeFiles/Makefile2:660: CMakeFiles/check.dir/all] Interrupción
make[1]: *** [CMakeFiles/Makefile2:667: CMakeFiles/check.dir/rule] Interrupción
make: *** [Makefile:223: check] Interrupción

Could you try running the tests without any parallelization to find out which test is hanging? I.e., cd build; ctest without any -j args.

@joa-quim
Copy link
Member

joa-quim commented May 3, 2022

I have the same problem since 1 or 2 years.

@Esteban82
Copy link
Member Author

Could you try running the tests without any parallelization to find out which test is hanging? I.e., cd build; ctest without any -j args.

When I run Ctest it finished and I got this message:

1042/1044 Test #1042: test/triangulate/nnn.sh ......................***Failed    0.06 sec
          Start 1043: test/triangulate/trivor.sh
1043/1044 Test #1043: test/triangulate/trivor.sh ...................***Failed    0.06 sec
          Start 1044: test/xyz2grd/gridrange.sh
1044/1044 Test #1044: test/xyz2grd/gridrange.sh ....................***Failed    0.05 sec

20% tests passed, 839 tests failed out of 1044

Total Test time (real) = 327.40 sec

The following tests FAILED:
CMake Error: Cannot open file for write: /home/federico/Software/gmt/test/Testing/Temporary/LastTestsFailed.log.tmp
CMake Error: : System Error: Permission denied
Problem opening file: /home/federico/Software/gmt/test/Testing/Temporary/LastTestsFailed.log
Cannot create log file: LastTestsFailed.log

When I run sudo Ctest it stops at test 842.

 841/1044 Test  #841: test/psxy/cartsegmentize.sh ..................   Passed    1.77 sec
          Start  842: test/psxy/cartvec.sh
 842/1044 Test  #842: test/psxy/cartvec.sh .........................   Passed    0.95 sec
          Start  843: test/psxy/categorical.sh

@seisman
Copy link
Member

seisman commented May 4, 2022

@Esteban82 You don't have run the full tests. You can simply run ctest -R GMT_splines.sh to run a single test.

@joa-quim
Copy link
Member

joa-quim commented May 4, 2022

So this may also happen on Linux. I though it was only a problem on Windows. The issue in not in the tests themselves but ... somewhere else. Running them individually works but the whole suite hangs before the last two.

ctest -R gridrange
Test project C:/v/build
    Start 1044: test/xyz2grd/gridrange.sh
1/1 Test #1044: test/xyz2grd/gridrange.sh ........   Passed    1.17 sec

100% tests passed, 0 tests failed out of 1

@PaulWessel
Copy link
Member

Script did not have executable permission set.

@PaulWessel
Copy link
Member

Hi @Esteban82, are you ready to try to upload the PS to dvc and add the lines to sample1d.rst to include the figure and caption? The plot looks good to me.

@Esteban82
Copy link
Member Author

Hi Paul.

Not really. I am still a bit lost. I think it would be better if someone else do it.

@PaulWessel
Copy link
Member

PaulWessel commented May 6, 2022 via email

@PaulWessel
Copy link
Member

OK, so I checked out this branch, built it and ran all the test. I am getting this failure because the orig PS is not yet in the system:

157 - doc/scripts/GMT_splines.sh (Failed)

I follow the Contribution guide on test failures and first check that the plot is OK and then copy it to where DVC expects it:

cp rbuild/doc/scripts/GMT_splines/GMT_splines.ps doc/scripts/images

Now I can check with dvc:

dvc diff
Added:                                                                                                                                           
    doc/scripts/images/GMT_splines.ps

Modified:
    doc/scripts/images/

Loos good so I add it to the database:

dvc add doc/scripts/images
100% Adding...|█████████████████████████████████████████████████████████████████████████████████████████████████████████|1/1 [00:00,  4.96file/s]
                                                                                                                                                 
To track the changes with git, run:                                                                                                              

    git add doc/scripts/images.dvc

To enable auto staging, run:

	dvc config core.autostage true

After that, git tells me that a new file has been staged:

--- a/doc/scripts/images.dvc

So I commit my changes to git.

@PaulWessel
Copy link
Member

OK, had not added the figure and caption to sample1d.rst yet so doing that now.

@PaulWessel
Copy link
Member

Alright, now I need to upload the PS file to dvc:

dvc push
2 files pushed                      

@PaulWessel
Copy link
Member

I am now building the whole branch again and will run the tests to verify we pass and then I will build the documentation to ensure the sample1d man page is OK. This will take some minutes...

@PaulWessel
Copy link
Member

Good, the tests pass and I built the documentation. Here is a screenshot from the relevant new section:

new

Looks good I think - I will remove the WIP tag.

@PaulWessel PaulWessel changed the title WIP Add splines figure and script Add splines figure and script May 6, 2022
@PaulWessel
Copy link
Member

Now it is good and ready to be reviewed by all.

doc/scripts/GMT_splines.sh Outdated Show resolved Hide resolved
@seisman
Copy link
Member

seisman commented May 6, 2022

@PaulWessel When you merged the master branch into this branch, you probably reverted the changes to the dvc file.

@PaulWessel
Copy link
Member

Yes, something did not got exactly as planned. I am not sure why but I got a conflict on the dvc file.
I can fix the script to be clean - done.
ANy idea why the dvc file had a conflict and if we need to do anything to fix?

@seisman
Copy link
Member

seisman commented May 6, 2022

Yes, something did not got exactly as planned. I am not sure why but I got a conflict on the dvc file.

It's because PR #6673 also updated the dvc file.

@seisman
Copy link
Member

seisman commented May 6, 2022

if we need to do anything to fix?

I think you need to run dvc add doc/scripts/images and dvc push again.

@PaulWessel
Copy link
Member

OK done

@seisman
Copy link
Member

seisman commented May 6, 2022

Did you run git add doc/scripts/images.dvc again?

@PaulWessel
Copy link
Member

Just 10 seconds ago. Should be OK now.

@PaulWessel PaulWessel merged commit 5c8cc24 into master May 6, 2022
@PaulWessel PaulWessel deleted the add_gmt_splines_figure branch May 6, 2022 13:10
@Esteban82
Copy link
Member Author

Many thanks Paui!! I will look into detail this for the next time.

@Esteban82
Copy link
Member Author

I was thinking that the script could go to gmt-examples.
What do you think?

BTW, for gmt-examples, I wonder if would be possible to create like a list of scripts and figure to add on it.

@maxrjones maxrjones added the documentation Improve documentation label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve sample1d -F docs
5 participants