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

Refactor hardcoded GMT defaults #9

Closed
wants to merge 3 commits into from

Conversation

molinav
Copy link

@molinav molinav commented Dec 10, 2020

This pull request adds the default values for GMT 5.4.5 as they appear in a self-compiled GMT 5.4.5 under Ubuntu 20.04. At least the TIME_LANGUAGE parameter has been renamed as GMT_LANGUAGE, and this is causing warnings to stdout (see issue #7) if GMT 5.4.5 is used with the defaults for 5.1.2 (which are the last ones available in gmtpy).

@molinav
Copy link
Author

molinav commented Dec 10, 2020

I changed the default page orientation from landscape to portrait because I saw this is the default value for older versions and otherwise the examples are generated with a wrong layout.

@molinav molinav changed the title Add GMT defaults for 5.4.5 Refactor hardcoded GMT defaults Dec 16, 2020
@molinav
Copy link
Author

molinav commented Dec 16, 2020

I have added some additional changes and therefore renamed the pull request:

  1. I have aligned all the "parameter = value" rows as in the defaults from the GMT 5 series.
  2. It is not necessary to keep track of GMT defaults for patch versions if the defaults of the previous GMT are identical, since gmtpy will pick those as defaults if it cannot find for the specific GMT versions. For example, I observed that the defaults for GMT 4.3.0 and GMT 4.3.1 are completely identical. It is enough to have the ones from 4.3.0 and if somebody uses 4.3.1 gmtpy will already take the defaults of GMT 4.3.0 as fallback.
  3. After making this change, I realised that it would be nice to just keep track of the defaults by minor version, e.g. the GMT 5.4.z series should not change the defaults between patch versions and so on. For this reason, I renamed the keys in the defaults dictionary so that the entries are always in the form X.Y.0.

In particular, point 3 is important because this pull request was initially adding just defaults for GMT 5.4.5. Later, I was testing in another machine which happened to have GMT 5.4.4, and therefore the defaults were redirected to the previous defaults in gmtpy, which were from GMT 5.1.2 and not compatible. Just adding my original defaults as being for GMT 5.4.0 and not 5.4.5 solved the problem.

@molinav molinav closed this Nov 30, 2024
@molinav molinav deleted the feature-defaults branch November 30, 2024 08:14
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.

1 participant