-
Notifications
You must be signed in to change notification settings - Fork 229
Add function to import hotspot dataset #1386
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
Conversation
@GenericMappingTools/pygmt-maintainers Any ideas on how to make this csv import look less hacked together? |
Have you tried using |
I have. The problem is that I want to include the entire hotspot name in one field/string, but they're inconsistent in spacing/number of words. For example, the Bermuda line reads |
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.
Sorry for the delay. I see what you mean by inconsistent spacing, the hotspots.txt file is space-separated for the first three columns and tab-separated for the last column. I've figured out one alternative way by reading in the first 3 and last 1 column separately, and then concatenating together (see below).
P.S. There are some commits in this PR on sphdistance
. You might want to cherry-pick the 'hotspot' only commits to a clean 'add-hospot-dataset' branch (and do a force-push). Or we could merge in the sphdistance
PR at #1383 before this #1386 PR to save you some hassle 🙂
Co-authored-by: Wei Ji <[email protected]>
Sounds good; I'll wait until the remote file is updated and then push an update to this PR. I'll convert to draft for the time being. |
@willschlitzer The hotspots.txt file is now updated. |
Sounds good, I'll update this branch and make sure everything checks out. |
@GenericMappingTools/pygmt-maintainers I have updated |
Co-authored-by: Meghan Jones <[email protected]>
…pygmt into add-hotspot-dataset
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.
Nice work! Just one final recommendation to add the reference for the original data.
Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Meghan Jones <[email protected]>
This pull request adds a function to import the
hotspots.txt
dataset used in some of the GMT code examples. Unfortunately, due to inconsistent spacing between the columns in the data, I was not able to usepd.read_csv()
to read the data into a DataFrame. It would be great to get any feedback to shorten this code, as it currently appears messy.Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version