Skip to content
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 instructions to upgrade installed PyGMT version #1029

Merged
merged 18 commits into from
Mar 11, 2021

Conversation

core-man
Copy link
Member

@core-man core-man commented Mar 9, 2021

Description of proposed changes

Add how to update PyGMT stable and dev version and some tiny improvements.

Fixes #

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@core-man core-man requested a review from weiji14 March 9, 2021 09:27
@seisman seisman added the documentation Improvements or additions to documentation label Mar 9, 2021
@seisman seisman added this to the 0.3.1 milestone Mar 9, 2021
@weiji14
Copy link
Member

weiji14 commented Mar 9, 2021

Would it be possible to move the update steps into its own dedicated section? The Using pip subsection has 5 pip install ... lines and it might be overwhelming to people on why there are so many ways to pip install PyGMT!

@seisman seisman marked this pull request as draft March 9, 2021 20:59
@seisman
Copy link
Member

seisman commented Mar 9, 2021

Would it be possible to move the update steps into its own dedicated section? The Using pip subsection has 5 pip install ... lines and it might be overwhelming to people on why there are so many ways to pip install PyGMT!

I agree that this subsection is too long to read. I think we can remove "pip install from github":

pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt

because it works the same as "pip install from TestPyPI" (it's different, but is the same for users):

pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt

As for upgrading PyGMT, instead of showing the long commands, I think we can simply say something like:

To upgrade the installed development version to be the latest one, just add --upgrade option
to the pip install command.

@seisman
Copy link
Member

seisman commented Mar 9, 2021

Some other suggestions:

Line 32: should add a comma after e.g..

Line 43:

The sections below provide more detailed, step by step instructions to installing and testing PyGMT for those who may have a slightly different setup or want to install the latest development version.

Is the above sentence correct? Should we change "to installing and testing" to "to install and test"?

Line 92:

IPython: For embedding the figures in Jupyter notebooks.

I think we should recommend Jupyter or JupyterLab, not IPython.

@core-man
Copy link
Member Author

Line 32: should add a comma after e.g..

Line 43:

The sections below provide more detailed, step by step instructions to installing and testing PyGMT for those who may have a slightly different setup or want to install the latest development version.

Is the above sentence correct? Should we change "to installing and testing" to "to install and test"?

done in 49165b1.

@core-man
Copy link
Member Author

Would it be possible to move the update steps into its own dedicated section? The Using pip subsection has 5 pip install ... lines and it might be overwhelming to people on why there are so many ways to pip install PyGMT!

I agree that this subsection is too long to read. I think we can remove "pip install from github":

pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt

because it works the same as "pip install from TestPyPI" (it's different, but is the same for users):

pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt

Remove "pip install from GitHub" done in 4580e0d.

As for upgrading PyGMT, instead of showing the long commands, I think we can simply say something like:

To upgrade the installed development version to be the latest one, just add --upgrade option
to the pip install command.

Simplify PyGMT update by pip in d5b4ed9.

@core-man
Copy link
Member Author

Line 92:

IPython: For embedding the figures in Jupyter notebooks.

I think we should recommend Jupyter or JupyterLab, not IPython.

Actually, we mention IPython in many places (e.g., https://www.pygmt.org/dev/tutorials/first-figure.html). I agree that it's better to recommend JupyterLab. @weiji14 how do you think?

@michaelgrund
Copy link
Member

Line 92:

IPython: For embedding the figures in Jupyter notebooks.

I think we should recommend Jupyter or JupyterLab, not IPython.

Actually, we mention IPython in many places (e.g., https://www.pygmt.org/dev/tutorials/first-figure.html). I agree that it's better to recommend JupyterLab. @weiji14 how do you think?

Should we also differentiate between Jupyter notebooks and JupyterLab? Currently, a lot of people still work with notebooks without using them in JupyterLab.

@core-man
Copy link
Member Author

Line 92:

IPython: For embedding the figures in Jupyter notebooks.

I think we should recommend Jupyter or JupyterLab, not IPython.

Actually, we mention IPython in many places (e.g., https://www.pygmt.org/dev/tutorials/first-figure.html). I agree that it's better to recommend JupyterLab. @weiji14 how do you think?

Should we also differentiate between Jupyter notebooks and JupyterLab? Currently, a lot of people still work with notebooks without using them in JupyterLab.

Shall we just recommend Jupyter, so the GMT user may choose which of JupyterLab or Jupyter Notebook they prefer?

@seisman
Copy link
Member

seisman commented Mar 10, 2021

Here is what I understand about the chaos:

  • IPython Notebook: The first generation of "notebooks". It was renamed to "Jupyter Notebook" a few years ago. We can still run ipython notebook but it's deprecated and will be removed in future versions.
  • Jupyter Notebook: The 2nd generation of "notebooks". It's still maintained but users are encouraged to transition to JupyerLab. However, there are still many users.
  • JupyterLab: The 3rd and the latest generation of "notebooks".

I think we should:

  1. Recommend JupyterLab in the installation guide.
  2. In the tutorial notes, we should say,

This tutorial assumes the use of a Python notebook, such as JupyterLab, Jupyter Notebook, or IPython Notebook.

However, please note that, after we finish and merge #529, we will remove the notes from all tutorials, because Figure.show() should work for any running environments.

@seisman
Copy link
Member

seisman commented Mar 10, 2021

BTW, I don't think our main users are Python newbies, as we use many high-level packages like numpy and pandas in the documentation. I expect that our users at least have some basic knowledge about Python, numpy, pandas, and also should have their own preferences about Jupyter Notebook or JupytereLab.

doc/install.rst Outdated Show resolved Hide resolved
doc/install.rst Outdated Show resolved Hide resolved
doc/install.rst Outdated Show resolved Hide resolved
core-man and others added 2 commits March 11, 2021 15:32
Co-authored-by: Michael Grund <michael_grund@gmx.de>
Co-authored-by: Michael Grund <michael_grund@gmx.de>
doc/install.rst Outdated Show resolved Hide resolved
doc/install.rst Outdated Show resolved Hide resolved
doc/install.rst Outdated Show resolved Hide resolved
@seisman seisman changed the title Add how to update PyGMT Add instructions to update PyGMT Mar 11, 2021
@seisman seisman marked this pull request as ready for review March 11, 2021 16:34
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Ping @michaelgrund @willschlitzer @weiji14 for comments and approval.

doc/install.rst Outdated Show resolved Hide resolved
Copy link
Member

@michaelgrund michaelgrund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Execpt the minor suggestion I provided, the PR looks fine for me.

Co-authored-by: Michael Grund <michael_grund@gmx.de>
Comment on lines -150 to -153
or from PyGMT's `GitHub repository <https://github.com/GenericMappingTools/pygmt>`__
(slower as it downloads the whole archive)::

pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checking that we really want to remove this install option?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For most users, it's the same as

pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt

but slower.

I don't see any reasons to keep it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fine with removing it. I just think the pip install git+https option is nice when you want to install from a GitHub branch (but that's not what we're doing here).

@seisman seisman changed the title Add instructions to update PyGMT Add instructions to upgrade installed PyGMT version Mar 11, 2021
@seisman seisman merged commit 0bb0500 into GenericMappingTools:master Mar 11, 2021
@core-man core-man deleted the pygmt-install branch March 12, 2021 02:28
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…ols#1029)

Co-authored-by: Michael Grund <michael_grund@gmx.de>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants