Closed
Description
Description of the desired feature
Originally posted by @liamtoney in #949 (comment)
I'd add
Path
objects if they're not already supported. :)
The pathlib.Path
is a cross-platform way of handling filepaths. Currently PyGMT supports passing in filenames as a str
, but it would be good to ensure that pathlib.Path
works too.
What needs to be done ☑️
- This if-statement needs to be modified:
Lines 69 to 70 in 11c1301
- Add some unit tests with
pathlib.Path
inputs, best placed in https://github.com/GenericMappingTools/pygmt/blob/master/pygmt/tests/test_info.py.
How to make the change 🧐
- First, read up our contributing guidelines at https://www.pygmt.org/v0.4.0/contributing.html#editing-the-documentation
- Leave a comment below, stating that you will tackle this issue. We will assign you to this issue and you can then start working on it.
- To edit the utils.py file, go to https://github.com/GenericMappingTools/pygmt/edit/master/pygmt/helpers/utils.py and make the change!. Or you may want to do this in your code editor locally.
- Submit a pull request, and be sure to fill it up with as much detail as possible.
Are you willing to help implement and maintain this feature? Happy to guide someone with some familiarity with Python Path objects to work on this. Will also be a great opportunity for someone wanting to learn how to write unit tests.