-
Notifications
You must be signed in to change notification settings - Fork 224
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 pygmt.config() to change gmt defaults locally and globally #293
Conversation
@seisman Looking at the linter output, I hadn't remembered that
I'm sure what the best option would be. I'm inclined toward |
@leouieda What about |
Sure, |
Codecov Report
@@ Coverage Diff @@
## master #293 +/- ##
=========================================
+ Coverage 96.74% 96.8% +0.06%
=========================================
Files 18 18
Lines 768 783 +15
=========================================
+ Hits 743 758 +15
Misses 25 25
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just following up on this from a recent gitter comment by @EqualMa. I've updated the branch to catch up with master, and have just looked into 2 of the errors:
- It seems that the global config doesn't turn off after we run the test, so we'll probably need a way to reset configurations back to their default. (e.g. use
gmtdefaults -D
orgmtget
) - I like the lowercase
config
name, but pylint doesn't like lowercase names for Python classes.
I've found Chainer's configuration settings to be a good reference. They avoid Capitalization of the name by creating a using_config
function, and have that function return the Config
class.
I've been testing pygmt.config() out locally and it appears to work. Does anyone know the status of this merge and what is left to do here? I would be happy to make a PR if there are specific issues that need to be addressed. Without this merge, I was using gmt.conf for various settings, which does work, but as far as I can tell there is no way to get pygmt to reload gmt.conf without restarting the kernel and importing pygmt. Is there a way to get pygmt to reload the gmt.conf file without restarting the kernel? Thanks! |
Hi @tjcrone, functionality wise, this PR is basically done. Other than that, it would be nice to have some sort of gallery example or tutorial to highlight the use of |
@weiji14, I would be happy to add an example, which might go best in the user guide. It would be nice to see the docs rendered after this is merged so I can see what is needed. If this is merged will the docs render? |
@tjcrone, you can preview the docs by clicking on the "View deployment" button in any of our PRs (see #344 (comment)). Instructions for making a tutorial are at https://github.com/GenericMappingTools/pygmt/blob/master/CONTRIBUTING.md#tutorials, and you follow the instructions at https://github.com/GenericMappingTools/pygmt/blob/master/CONTRIBUTING.md#documentation to build the documentation locally before you push up to Github. I'll merge this in first so that |
Description of proposed changes
Support changing gmt defaults globally and locally.
Usage:
Fixes #288.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.