-
Notifications
You must be signed in to change notification settings - Fork 4
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
Tutorial 2 - scientific Python ecosystem: pandas and GeoPandas: Add JN #4
Conversation
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.
Notebook looks very clean and easy to follow so far! Just some minor suggestions for now, not sure if you're planning to add more materials to this notebook?
Thanks @weiji14 for already looking at this JN and the positive feedback! I feel the general structure should be finished. What is missing is some documentation and improvements of the formulations, as you already suggested. |
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
This is a good suggestions! Moved these lines to a separate cell. |
I think is ready to merge. My only minor suggestion would be to add a frame to the choropleth map. |
book/_toc.yml
Outdated
@@ -13,3 +13,4 @@ parts: | |||
- file: markdown | |||
- file: notebooks | |||
- file: markdown-notebooks | |||
- file: tut2_spec_pd_gpd |
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.
Maybe it's better to add the file names of the JNs or files together within one PR to avoid merge conflicts.
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.
Let's just leave it as is, it'll be a good example to learn how to handle merge conflicts 🙂
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.
Ok, first tutorial is merged, so you'll need to resolve the merge conflict here. If you could also rename the file to tut02_spec_pd_gpd
(add an extra 0
), that would make it consistent with the first tutorial.
# Tutorial 2 - pandas and GeoPandas, Tutorial 4 - Geophysics (Seismology) | ||
- pandas=2.2.2 | ||
- geopandas=1.0.1 |
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.
Same as above, maybe better to update the environment.yml
within one PR for all tutorials to avoid merge conflicts.
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.
Since pandas
is a required dependency of pygmt
, this won't need to be added here, unless you specifically require pandas=2.2.2
?
Note that I'll be updating the conda-lock.yml
file to pin all dependencies once all the tutorial notebooks are merged, so that people can reproduce the exact dependency versions in the future (including pandas).
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.
I don't think I specifically need this pandas version. Just added the version I am currently having installed in the virtual environment I am using for this pre-workshop.
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.
Ok, we can leave the pin on pandas=2.2.2
, sometimes good to be explicit.
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.
This tutorial is next in line to be merged! @yvonnefroehlich, if you can handle the merge conflict on _toc.yml
, and maybe add some commentary around fig.legend
, I can merge this in the next 24hours.
book/tut2_spec_pd_gpd.ipynb
Outdated
"# Add a heading (+H) to the legend and adjust the font size (+f) to 9 points\n", | ||
"fig.plot(data=gpd_rivers_short, pen=\"0.5p,orange\", label=f\"shorter {len_limit} m+Hriver length+f9p\")\n", | ||
"fig.plot(data=gpd_rivers_long, pen=\"0.5p,darkred\", label=f\"longer {len_limit} m\")\n", | ||
"\n", | ||
"fig.legend(position=\"jLT+o0.1c\", box=\"+gwhite@30+p0.1p,gray50\")\n", |
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.
Since fig.legend
isn't explained in the first tutorial, could you add some text to explain it before the code cell? You can just link to https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.legend.html and/or one of the PyGMT gallery examples using legend.
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.
Makes sense! I have added some documentation in commit 909f713.
# Tutorial 2 - pandas and GeoPandas, Tutorial 4 - Geophysics (Seismology) | ||
- pandas=2.2.2 | ||
- geopandas=1.0.1 |
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.
Ok, we can leave the pin on pandas=2.2.2
, sometimes good to be explicit.
Sounds good! Have resolved the merge conflict and added the leading "0" to the file name (b7f789e). |
Thanks again @yvonnefroehlich, this PR is merged and tutorial is now up at https://www.generic-mapping-tools.org/agu24workshop/tut02_spe_pd_gpd.html 🎉. Feel free to open a PR for any minor changes (if needed) before the workshop. |
@@ -14,3 +14,4 @@ parts: | |||
- file: notebooks | |||
- file: markdown-notebooks | |||
- file: tut01_firstfigure | |||
- file: tut02_spec_pd_gpd |
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.
Maybe we should use "spe" instead of "spec" as the later one seems to refere to scientific Python ecosystem coordination (please see https://scientific-python.org/specs/ [, and Dongdong's very detailed review on my draft for the pygmt talk])?
This PR adds the Jupyter notebook for Tutorial 2 - scientific Python ecosystem:
pandas
andGeoPandas
:Preview: