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

The quiet ignoring of deprecated GMT 4 options #3456

Open
PaulWessel opened this issue Jun 10, 2020 · 5 comments
Open

The quiet ignoring of deprecated GMT 4 options #3456

PaulWessel opened this issue Jun 10, 2020 · 5 comments
Labels
discussion Topics for longer discussion

Comments

@PaulWessel
Copy link
Member

Major options in GMT have changed over time . This annoys long-time users so we only make such changes when we must, and we have let the "old ways" be allowed for quite some time now (GMT 5 was released in 2013). There seems to be several types of compatibilities:

  1. Some modules used one option letter (say -A) for a feature and now uses another letter (say -B) for the same feature. Examples might be -W for histogram width in pshistogram which now is -Tinc since this allows us to have a much more flexible setup for bins. If the user specifies the old -W we do figure out what to do, but we do not give a deprecated message.
  2. In other modules, such as psrose, the old -C was replaced by -E, and if we find -C we print "Option -C for mode-vector(s) is deprecated; use -E instead.". However, it is only printed if the compatibility level is 5.
  3. For some common options from the past we quietly accept them. Here is the code:
		case 'Z':
			if (!gmt_M_compat_check (GMT, 4)) error++;
			break;
		case 'E':
			if (gmt_M_compat_check (GMT, 4))
				error += GMT->common.p.active == false;
			else
				error++;
			break;
		case 'm': if (!gmt_M_compat_check (GMT, 4)) error++; break;
		case 'S': if (!gmt_M_compat_check (GMT, 4)) error++; break;
		case 'F': if (!gmt_M_compat_check (GMT, 4)) error++; break;

So those with long memory will remember that -F used to set pixel grid registration (currently -r), -S used to set 2-d spline boundary conditions (currently -n), -Z set 3-D z-level (now in -p), -E set perspective view (-p), -m told GMT 4 to expect a multi-segment file (now automatic). With the GMT_COMPATIBILITY = 4 stuck as is forever, no message at all may be given (e.g., #3455). I have to do this to get an error:

gmt blockmedian -R-2/2/-2/2 -I1 -S t.txt --GMT_COMPATIBILITY=5
blockmedian [ERROR]: Unrecognized option -S

Note that the check here is crazy since blockmedian never had a -S but it gets caught up in the common option parsing. I also seem to remember that we pushed the GMT_MSG_COMPAT verbose warning down the list so as not to annoy people. Yes, adding -Vc to the blockmedian call gives no error, so that part is broken I guess.

We need to make some changes. Here is a list of possibilities:

  1. In GMT modern mode, we should absolutely, positively not honor old deprecated options. What a nightmare, but there is no code that takes this into account presently.
  2. When do we increase the default setting on GMT_COMPATIBILITY? 2025? Surely, with 6.1 coming out 7 years after GMT 5, maybe inch it up to at least 5? If people are still running ancient GMT 4 script they expect to work then they do need to get with the program and make changes or just install GMT 4 for those tasks.
  3. GMT 4-ever: Leave as is but go back and add annoying compatibility messages when these things happen, don't quietly let bad shit go down.

Feedback please, @GenericMappingTools/core.

@anbj
Copy link
Contributor

anbj commented Jun 11, 2020

As the NTPsec folks put it,

We have deliberately jettisoned support for ancient legacy hardware and operating systems in order to ship code that is security-hardened, simpler, drastically less bulky, easier to understand, and easier to maintain.

Maybe, at one point, is it necessary to force people into entering the new millennium.

@PaulWessel
Copy link
Member Author

Yes, perhaps we can get some ear plugs to avoid listening to the screaming and kicking.

@seisman
Copy link
Member

seisman commented Aug 7, 2020

Compatibility with old syntax makes the codes bigger and more difficult to read and maintain, especially for new developers/contributors.

I think we can improve the deprecation warnings like:

Option -C is deprecated. Use -E instead. The old syntax will be deprecated in GMT 6.X.0. 

Before releasing GMT 6.X.0, we then can remove the old backward compatibility codes.

@stale
Copy link

stale bot commented Nov 6, 2020

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Nov 6, 2020
@seisman seisman removed the stale This will not be worked on label Nov 6, 2020
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Jun 2, 2021
@stale stale bot closed this as completed Jun 16, 2021
@seisman seisman reopened this Jun 17, 2021
@stale stale bot removed the stale This will not be worked on label Jun 17, 2021
@maxrjones maxrjones added the discussion Topics for longer discussion label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Topics for longer discussion
Projects
None yet
Development

No branches or pull requests

4 participants