Skip to content

Add -Fe to GMT_splines.sh#7490

Merged
PaulWessel merged 11 commits intomasterfrom
GMT_Splines_add_Fe
Oct 28, 2023
Merged

Add -Fe to GMT_splines.sh#7490
PaulWessel merged 11 commits intomasterfrom
GMT_Splines_add_Fe

Conversation

@Esteban82
Copy link
Member

Update script to add the new method to interpolate (#7488).

I make the figure taller so the legend doesn't cover the curves.

@Esteban82 Esteban82 requested a review from a team June 2, 2023 14:08
@Esteban82 Esteban82 self-assigned this Jun 2, 2023
@Esteban82 Esteban82 changed the title Add -Fe to GMT_splines.sh WIP Add -Fe to GMT_splines.sh Jun 2, 2023
@Esteban82
Copy link
Member Author

Should update something else? Like doc/scripts/images.dvc ?

I add WIP until -Fe works well.

@PaulWessel
Copy link
Member

See other comment. Docs says -Fe requires momotonically increasing data

@PaulWessel
Copy link
Member

Hi @Esteban82 please remind we where we are on this one.

@Esteban82
Copy link
Member Author

Esteban82 commented Oct 12, 2023

This just add the new type of line to the figure. And it makes it a bit higher for the legend.
I think we could approve this.

@Esteban82 Esteban82 changed the title WIP Add -Fe to GMT_splines.sh Add -Fe to GMT_splines.sh Oct 12, 2023
@Esteban82
Copy link
Member Author

No, wait. The docs says "-Fe requires momotonically increasing data" and the input file of the script is NOT.

cat << EOF > t.txt
0	0
1	1
2	1.5
3	1.25
4	1.5
4.5	3
5	2
6	2.5

@Esteban82
Copy link
Member Author

I think it would be good to add that curve to figure but it doesn't work for that input file,

@PaulWessel
Copy link
Member

Hm, either we pick some other points that are monotonic and still allows the other splines to do some wiggling, or we just mention Fe in the caption but no line. You can decide.

@Esteban82
Copy link
Member Author

Also, it seems that the curve can only go upwards. Bug?

GMT_splines

@Esteban82
Copy link
Member Author

If not, them I will leave the figure without that line (i.e. closing this issue without merge).

@PaulWessel
Copy link
Member

Note sure what -Fe is supposed to do but if it is called step-up then it is not unreasonable that it cannot go down, no?

@Esteban82
Copy link
Member Author

Note sure what -Fe is supposed to do but if it is called step-up then it is not unreasonable that it cannot go down, no?

I use it to interpolate the cumulative sum of goals score by Messi. So it is working fine. But in my case the data was always increasing. This is NOT the case for the plot.

gmt math Messi_Goals.txt -C3 SUM -o0,3 = | gmt sample1d $(gmt info Messi_Goals.txt -T3d) -Fe -fT > dates_vs_goals.txt

So, about this PR, I think it would be good to show this curve in the figure. But I don't see how. Except to make another figure (but I don't like this idea).

@PaulWessel PaulWessel mentioned this pull request Oct 13, 2023
I change the name of label in the script
@Esteban82
Copy link
Member Author

Is it possible to merge? or should I update also doc/scripts/images.dvc ?

@seisman
Copy link
Member

seisman commented Oct 14, 2023

or should I update also doc/scripts/images.dvc ?

Yes, you should do it, otherwise the tests will be broken.

@PaulWessel
Copy link
Member

Do a dvc pull since I just updated 42 PS files, and git pull in master.

@Esteban82
Copy link
Member Author

Ok, I will have to study how to do it.

@PaulWessel
Copy link
Member

See teh Contribution guide for documentation. You will need dvc of course and ability to push to the DVC server. If this was never set up for you by Max then I can ask them and I can then do this PS. Let me know. If DVC is set up for you then good for you to git this a try. Usually:

  1. Run the test that has been updated
  2. Verify the plot is as expected
  3. Place it (in your case) in doc/scripts/images (see that the old one is there first)
  4. Update index via dvc add doc/scripts/images
  5. Push new plots sto cloud with dvc push

@Esteban82
Copy link
Member Author

See teh Contribution guide for documentation. You will need dvc of course and ability to push to the DVC server. If this was never set up for you by Max then I can ask them and I can then do this PS. Let me know. If DVC is set up for you then good for you to git this a try. Usually:

  1. Run the test that has been updated
  2. Verify the plot is as expected
  3. Place it (in your case) in doc/scripts/images (see that the old one is there first)
  4. Update index via dvc add doc/scripts/images
  5. Push new plots sto cloud with dvc push

I have to do this within this branch? Should I update it? Or dvc has nothing to do with git?

@joa-quim
Copy link
Member

I think yes. dvc has nothing to do with git

@PaulWessel
Copy link
Member

Well, dvc add creates .git files you want in that branch

@Esteban82
Copy link
Member Author

I don't how to do this. I run the test and I got almost 1000 fails.

and them I got this error with 4.:

dvc add doc/scripts/images
ERROR: bad DVC file name 'doc/scripts/images.dvc' is git-ignored.  

@PaulWessel
Copy link
Member

The only way to get 1000 failures is if you have a gmt.conf file in your home directory. We throw an immediate error on that.

Did Max set up up for write access via dvc push? Cannot put stuff up in dvc cloud without being registered.

I just now merged from master into GMT_Splines_add_Fe.

@PaulWessel
Copy link
Member

Did you run dvc add doc/scripts/images after updating the PostScript file of that test and placed it in that dir? But if you dont have permission yet then you cannot push it. Did you have communication with Max about this? If you want I can add the PS and push it and then that test will pass?

@Esteban82
Copy link
Member Author

Did Max set up up for write access via dvc push? Cannot put stuff up in dvc cloud without being registered.

I think so. You can see me here "https://dagshub.com/GenericMappingTools/gmt" as a collaborator. Is it ok?

@joa-quim
Copy link
Member

I can see that you have wright permissions.

@Esteban82
Copy link
Member Author

The only way to get 1000 failures is if you have a gmt.conf file in your home directory.

Is it possible that I have to uncomment set (GMT_DATA_SERVER "static") on ConfigUserAdvanced.cmake`?

If so, them I would need to clarify it here https://docs.generic-mapping-tools.org/dev/devdocs/contributing.html#setting-up-your-environment, right?
`

@PaulWessel
Copy link
Member

I've done that but the problem is that one is not always running the tests and in between one might want to plot Pluto. Does not exist on static. What I do is I defined four aliases in my .bashrc file:

alias set-static='export GMT_DATA_SERVER=static'
alias set-candidate='export GMT_DATA_SERVER=candidate'
alias set-oceania='export GMT_DATA_SERVER=oceania'
alias wipe-server='unset GMT_DATA_SERVER'

To run the test I just write set-static in the terminal and then ctr to run the tests (see admin/bashrc_for_gmt for the GMT bash aliases).

If I need to make that pluto map i do set-candidate. Once we release everything it would be set-oceania for work and set-static for tests.

@PaulWessel PaulWessel merged commit 548641f into master Oct 28, 2023
@PaulWessel PaulWessel deleted the GMT_Splines_add_Fe branch October 28, 2023 09:33
@PaulWessel
Copy link
Member

I'll update the ex15.ps file now.

@PaulWessel
Copy link
Member

@seisman, I am guessing this is more DVC stuff. @Esteban82 improved the GMT_splines.sh script and I merged it. I then ran all tests and this one failed due to the changes. I then placed the PS made by the test (which is the right plot) into doc/scripts/images and got

dvc add doc/scripts/images
'./doc/examples/images.dvc' validation failed.

extra keys not allowed, in outs -> 0 -> hash, line 2, column 3
  1 outs:                                                                                                                                                                                             
  2 - md5: 4dd0ad31844cb0b0b451648cda314e2a.dir                                                                                                                                                       
  3   size: 37295153      

The full images.dvc file is

outs:
- md5: 4dd0ad31844cb0b0b451648cda314e2a.dir
  size: 37295153
  nfiles: 53
  path: images
  hash: md5

@seisman
Copy link
Member

seisman commented Oct 28, 2023

When I worked in PR #7978, running dvc automatically add the hash: md5 line into this file.
Maybe this is something new in the latest dvc versions (I'm using dvc 3.27.0).

Please try either remove this line manually or upgrade your dvc.

@PaulWessel
Copy link
Member

OK, my dvc is 2.56.0...

@PaulWessel PaulWessel restored the GMT_Splines_add_Fe branch October 28, 2023 10:26
@PaulWessel
Copy link
Member

Now 3.27.0, delete has: md5 and it was accepted.

@seisman seisman deleted the GMT_Splines_add_Fe branch October 28, 2023 13:03
@seisman seisman restored the GMT_Splines_add_Fe branch October 28, 2023 13:03
@seisman seisman deleted the GMT_Splines_add_Fe branch October 28, 2023 13:03
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 this pull request may close these issues.

4 participants