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

Revise verbosity default levels and their names and abbreviations #2585

Merged
merged 12 commits into from
Jan 30, 2020

Conversation

PaulWessel
Copy link
Member

@PaulWessel PaulWessel commented Jan 29, 2020

Description of proposed changes

See issue #2346 for context. This PR does several things:

  1. Renames three verbosity levels to be more mnemonic: normal is now called error, verbose is called warning, and long_verbose is called information.
  2. Changes the one-character codes for verbosity also to be more mnemonic: n becomes e, v becomes w, and l becomes i (all backwards compatible).
  3. Reinstates warning as the default verbosity level [-V or -Vw] so users can get critical warning messages without knowing they needed -Vv as in the past.
  4. Lets the GMT and PostScriptLight API define the corresponding enums GMT_MSG_INFORMATION instead of GMT_MSG_LONG_VERBOSE, etc., but this is backwards compatible in case a developer uses the old enums.
  5. Updates all references to verbosity in documentation, code and scripts to use the new standards.
  6. Removes leading phrases in GMT_Report messages such as "Syntax error:" or "Warning" since that is standardized by the GMT_Report function via the ERROR, WARNING, INFORMATION, etc. prefixes.
  7. Changes a few warning messages to information messages when not supplying actionable warnings.

Let -Vw (warnings+errors) become the default verbosity, and rename the various choices in a backwards compatible manner.
They are all prefaced by ERROR, WARNING, etc anyway.
Also align revised verbosity in PSL with GMT.
admin/src_replace_word.sh Outdated Show resolved Hide resolved
doc/rst/source/explain_-V_full.rst_ Outdated Show resolved Hide resolved
@seisman
Copy link
Member

seisman commented Jan 30, 2020

I just merged master branch and resolved two conflicts.

Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

The PR looks good to me, but we may want more comments from @GenericMappingTools/core.

@PaulWessel
Copy link
Member Author

Yes agree, perhaps @joa-quim and @remkos can build this branch and see what they think.

@remkos
Copy link
Contributor

remkos commented Jan 30, 2020

This is fine with me.
If I understood well, -V does no longer have any effect, i.e. -V and -Vw and no -V at all is all the same.
That is also fine with me.

@remkos remkos merged commit 214bbf1 into master Jan 30, 2020
@remkos remkos deleted the verbose-revision branch January 30, 2020 14:41
@joa-quim
Copy link
Member

Guys, you were too quick on merging.

Sorry, it doesn't make sense to me that -V alone does nothing. If it does nothing it should not exist.
I thought that Let -V mean -Vi means exactly that, but no. This prints nothing

surface lixo.csv -R0/10/0/10 -Gjunk.nc -I0.05 -V

while this does (though it prints too much but that's a different issue)

surface lixo.csv -R0/10/0/10 -Gjunk.nc -I0.05 -Vi

@joa-quim
Copy link
Member

And things are getting worst. Now this prints a lot of non-needed info, whilst before there was silence

julia> imshow("junk.nc")
gmtread [WARNING]: No range attribute, guessing registration to be pixel
gmtread [WARNING]: netCDF grid junk.nc information has zmin = zmax = NaN. Reset to 0/0.
PSL: Colormap of 10 colors created
PSL: Image depth reduced to 4 bits
psxy [WARNING]: Option -T ignores all input files

@PaulWessel
Copy link
Member Author

I will comment and address some of these but busy with getting the proposal submittted now.

@PaulWessel
Copy link
Member Author

My intent, as per @seisman's comment, was to let -V stand for -Vi. I thought I fixed that but perhaps not - will look. Yes, we also need to change the level we have assigned to some messages since some labeld WARNING that was never seen are now showed by default. Many of these need to become INFORMATION.

@PaulWessel
Copy link
Member Author

BTW, when I run surface -V I get tons of INFORMATION statements. Surely you just too?

@joa-quim
Copy link
Member

Yes, sure. -V silence. -Vi flooding

@seisman
Copy link
Member

seisman commented Jan 30, 2020

This is what I have:

$ gmt coast -Rg -JH10c -B0 -Ggray -pdf map

$ gmt coast -Rg -JH10c -B0 -Ggray -pdf map -V
begin [INFORMATION]: Creating a workflow directory /Users/seisman/.gmt/sessions/gmt6.70704
coast [INFORMATION]: Central meridian not given, default to 180
coast [INFORMATION]: Map scale is 3603.99 km per cm or 1:3.60399e+08.
coast [INFORMATION]: -D option: Selected resolution -Dc
coast [INFORMATION]: Selected ice front line as Antarctica coastline
coast [INFORMATION]: GSHHG version 2.3.7
coast [INFORMATION]: Derived from World Vector Shoreline, CIA WDB-II, and Atlas of the Cryosphere
coast [INFORMATION]: Processed by Paul Wessel and Walter H. F. Smith, 1994-2017
end [INFORMATION]: Process GMT figure queue: 1 figures found
end [INFORMATION]: Processing GMT figure #0 [map pdf ]
psconvert [INFORMATION]: Processing /Users/seisman/.gmt/sessions/gmt6.70704/gmt_0.ps-...
psconvert [INFORMATION]: Find HiResBoundingBox ...
psconvert [INFORMATION]: Figure dimensions: Width: 284.961 points [10.0528 cm]  Height: 143.226 points [5.05269 cm]
psconvert [INFORMATION]: [359.241 359.244 644.202 502.47]...
psconvert [INFORMATION]: Convert to PDF...
end [INFORMATION]: Destroying the current workflow directory /Users/seisman/.gmt/sessions/gmt6.70704

$ gmt coast -Rg -JH10c -B0 -Ggray -pdf map -Vi
begin [INFORMATION]: Creating a workflow directory /Users/seisman/.gmt/sessions/gmt6.70704
coast [INFORMATION]: Central meridian not given, default to 180
coast [INFORMATION]: Map scale is 3603.99 km per cm or 1:3.60399e+08.
coast [INFORMATION]: -D option: Selected resolution -Dc
coast [INFORMATION]: Selected ice front line as Antarctica coastline
coast [INFORMATION]: GSHHG version 2.3.7
coast [INFORMATION]: Derived from World Vector Shoreline, CIA WDB-II, and Atlas of the Cryosphere
coast [INFORMATION]: Processed by Paul Wessel and Walter H. F. Smith, 1994-2017
end [INFORMATION]: Process GMT figure queue: 1 figures found
end [INFORMATION]: Processing GMT figure #0 [map pdf ]
psconvert [INFORMATION]: Processing /Users/seisman/.gmt/sessions/gmt6.70704/gmt_0.ps-...
psconvert [INFORMATION]: Find HiResBoundingBox ...
psconvert [INFORMATION]: Figure dimensions: Width: 284.961 points [10.0528 cm]  Height: 143.226 points [5.05269 cm]
psconvert [INFORMATION]: [359.241 359.244 644.202 502.47]...
psconvert [INFORMATION]: Convert to PDF...
end [INFORMATION]: Destroying the current workflow directory /Users/seisman/.gmt/sessions/gmt6.70704

@joa-quim
Copy link
Member

Yes, I can reproduce that but try this with the attached file

surface lixo.csv -R0/10/0/10 -Gjunk.nc -I0.05 -V

lixo.zip

@seisman
Copy link
Member

seisman commented Jan 30, 2020

I also got a long message:

gmt surface lixo.csv -R0/10/0/10 -Gjunk.nc -I0.05 -V
surface [INFORMATION]: Cartesian input grid
surface [INFORMATION]: Cartesian input grid
surface [INFORMATION]: Grid domain: W: 0 E: 10 S: 0 N: 10 n_columns: 200 n_rows: 200 [gridline registration]
surface [INFORMATION]: Processing input table data
surface [INFORMATION]: Reading Data Table from file lixo.csv
surface [INFORMATION]: Minimum value of your dataset x,y,z at: 2.53856992722 5.16657018661 0
surface [INFORMATION]: Maximum value of your dataset x,y,z at: 5.27815008163 1.151720047 9
surface [INFORMATION]: Eliminate data points that are not nearest a node.
surface [INFORMATION]: Plane fit z = 5.48785 + (0.0127817 * col) + (-0.0234717 * row)
surface [INFORMATION]: Normalize detrended data constraints by z rms = 2.42055
surface [INFORMATION]: Select default convergence limit of 0.000242055 (100 ppm of L2 scale)
surface [INFORMATION]: Recompute data index for next iteration [stride = 40]
surface [INFORMATION]: ------------------------------------------
surface [INFORMATION]: Memory for data array          : 240 bytes
surface [INFORMATION]: Memory for final grid          :  164.2 kb
surface [INFORMATION]: Memory for Briggs coefficients : 240 bytes
surface [INFORMATION]: Memory for node status         :   41.0 kb
surface [INFORMATION]: ------------------------------------------
surface [INFORMATION]: Total memory use               :  205.7 kb
surface [INFORMATION]: ==========================================
surface [INFORMATION]: Grid	Mode	Iteration	Max Change	Conv Limit	Total Iterations
surface [INFORMATION]: Set finite-difference coefficients [stride = 40]
surface [INFORMATION]: Determine nearest point and set Briggs coefficients [stride = 40]
surface [INFORMATION]:   40	D	    1014	5.91821244257e-06	6.0513852091e-06	      1014
surface [INFORMATION]: Recompute data index for next iteration [stride = 8]
surface [INFORMATION]: Expand grid by factor of 5 when going from stride = 40 to 8
surface [INFORMATION]: Fill in expanded grid by bilinear interpolation [stride = 8]
surface [INFORMATION]:    8	I	     306	2.94900688357e-05	3.02569260455e-05	      1320
surface [INFORMATION]: Determine nearest point and set Briggs coefficients [stride = 8]
surface [INFORMATION]:    8	D	    4000	0.00123970391765	3.02569260455e-05	      5320
surface [INFORMATION]: Recompute data index for next iteration [stride = 4]
surface [INFORMATION]: Expand grid by factor of 2 when going from stride = 8 to 4
surface [INFORMATION]: Fill in expanded grid by bilinear interpolation [stride = 4]
surface [INFORMATION]:    4	I	      22	5.93033165066e-05	6.0513852091e-05	      5342
surface [INFORMATION]: Determine nearest point and set Briggs coefficients [stride = 4]
surface [INFORMATION]:    4	D	    2000	0.00106849393251	6.0513852091e-05	      7342
surface [INFORMATION]: Recompute data index for next iteration [stride = 2]
surface [INFORMATION]: Expand grid by factor of 2 when going from stride = 4 to 2
surface [INFORMATION]: Fill in expanded grid by bilinear interpolation [stride = 2]
surface [INFORMATION]:    2	I	      18	0.000112587427182	0.000121027704182	      7360
surface [INFORMATION]: Determine nearest point and set Briggs coefficients [stride = 2]
surface [INFORMATION]:    2	D	    1000	0.000498276120252	0.000121027704182	      8360
surface [INFORMATION]: Recompute data index for next iteration [stride = 1]
surface [INFORMATION]: Expand grid by factor of 2 when going from stride = 2 to 1
surface [INFORMATION]: Fill in expanded grid by bilinear interpolation [stride = 1]
surface [INFORMATION]:    1	I	      11	0.000218761774326	0.000242055408364	      8371
surface [INFORMATION]: Determine nearest point and set Briggs coefficients [stride = 1]
surface [INFORMATION]:    1	D	     283	0.000241586279657	0.000242055408364	      8654
surface [INFORMATION]: Compute rms misfit and curvature.
surface [INFORMATION]: Fit info: N data points  N nodes	mean error	rms error	curvature
surface [INFORMATION]: 	      10	   40401	-0.000452330934658	0.00633957673331	1121.66847608
surface [INFORMATION]: Writing grid to file junk.nc

@joa-quim
Copy link
Member

Ah, found something

gmt surface lixo.csv -R0/10/0/10 -Gjunk.nc -I0.05 -V

prints it all

@PaulWessel
Copy link
Member Author

Hm, so gmt surface vs surface (bad old-school shorthand, shame on you) ?
We should run the full test with -V and examine the log for unwanted WARNING messages I think.

@joa-quim
Copy link
Member

Weird, why is that making a difference?
Look like I need to create symlinks to keep old (non-unix conditioned) habits

mklink surface.exe gmt.exe

then it works again.

@PaulWessel
Copy link
Member Author

Very odd behavior.

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.

None yet

4 participants