-
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
Update the starter tutorial introduction #1607
Conversation
You need to update |
Thanks @meghanrjones! I wait until #1603 is merged and then I'll get this sorted. |
I manually merged the main branch and update To be clear, I'm planning on having this follow the model used on the GMT documentation, in that there is a link to the tutorial main page, which has links to individual pages/examples, otherwise the entire tutorial would be a big file and cumbersome page. |
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.
Here are some steps that will make this show in the "Getting Started" section and not under the "User Guide/tutorials" section:
- Commit suggested changes
- From the base of the repository:
mkdir examples/starter-tutorial git mv examples/tutorials/starter-tutorial.rst examples/starter-tutorial/README.txt git mv examples/tutorials/starter-tutorials/first_figure.py examples/starter-tutorial/first_figure.py rmdir examples/tutorials/starter-tutorials/
- Add
"../examples/starter-tutorial",
after L68 indoc/conf.py
(inexample_dirs
) - In L72 in
doc/conf.py
, change:
"gallery_dirs": ["gallery", "tutorials", "projections"],
to
"gallery_dirs": ["gallery", "tutorials", "starter-tutorial", "projections"],
- Add
doc/starter-tutorial/
to.gitignore
- Add
rm -rf starter-tutorial
to L51 indoc/Makefile
I made these changes locally to try it out. If you want, I could commit and push them to this branch to save time (and revert the changes later if you do not like the structure).
Co-authored-by: Meghan Jones <[email protected]>
It worked! Thanks a ton for the help, @meghanrjones! |
# | ||
# 4. Create a global map. Set the region to "d" to center the map at the Prime | ||
# Meridian or "g" to center the map at the International Date Line. When the | ||
# region is set without using a list full of integers or floating numbers, |
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.
When the region is set without using a list full of integers or floating numbers, the argument needs to be passed as a Python string.
If I understand you correctly, you mean passing a string like -20/20/-30/30
to region
, right? I don't think it's clearly explained by this sentence because it doesn't say that the string should contain slash-separated numbers.
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'm actually referring to passing d
or g
when it comes to region. While I know that the literal GMT string can be passed for region, I don't want to make a mention of it in the first section of the tutorial. I think bringing up too many options early on is confusing, and using a list for something like this is probably more familiar to Python users instead of a string with numbers.
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 see what you meant. I also agree that a string like -20/20/-30/30
is not Pythonic and should not be covered in this starter tutoria.
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.
Actually, you could pass in a list of strings like ["10W", "20E", "30S", "40N"]
right? Not necessarily all numbers.
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.
Actually, you could pass in a list of strings like
["10W", "20E", "30S", "40N"]
right? Not necessarily all numbers.
Yes, but it's not commonly used, and better not to introduce too many options.
Co-authored-by: TIAN Dongdong <[email protected]> Co-authored-by: Michael Grund <[email protected]>
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!
examples/get-started/README.txt
Outdated
|
||
**About this tutorial** | ||
|
||
This tutorial assumes that PyGMT has been successfully installed. A quick |
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 add a link to the install instructions here. (Is there a way to do relative links?)
This tutorial assumes that PyGMT has been successfully installed. A quick | |
This tutorial assumes that PyGMT has been successfully [installed](https://www.pygmt.org/latest/install.html). A quick |
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.
The following directive should work:
:doc:`install`
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.
How do I add the text that I want to be linked ("installed")?
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.
:doc:`installed <install>`
or
:doc:`installed </install>`
should work.
@@ -0,0 +1,155 @@ | |||
""" | |||
1. Making your first figure |
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 as a thought, should we add a binder link so that people can 'follow along' with the tutorial interactively?
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.
@weiji14 I'm not familiar with using binder; could you make a code suggestion to add it?
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.
Perhaps it's better to add the binder link in a separate PR. Ideally, we should modify the template to automatically add the binder links for each example.
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, sounds good to me.
Co-authored-by: Wei Ji <[email protected]>
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, thanks @willschlitzer!
Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Wei Ji <[email protected]>
This pull request adds an .rst file for the introduction to the starter tutorial to allow for additional starting tutorial pages to be added. It is the first in a series of pull requests to add a starter tutorial that expands beyond
first_figure.py
.Addresses #770
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