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

Open specific version of tutorial in Colab #309

Merged
merged 4 commits into from
Dec 20, 2021

Conversation

adamjstewart
Copy link
Collaborator

@adamjstewart adamjstewart commented Dec 19, 2021

If you view the tutorials on RtD, we now default to the latest stable release. However, the "Open in Colab" button still opens up the main version. This PR fixes that.

The only remaining "gotcha" is that all versions of the tutorial will pip install torchgeo, so they'll all use the latest stable release, even if something has changed since then in main. We can avoid this issue by defaulting to the docs for the latest stable release, but as soon as someone tries a different versions of the docs it may not work.

Fixes #274
Fixes #310

@adamjstewart adamjstewart added the documentation Improvements or additions to documentation label Dec 19, 2021
@adamjstewart adamjstewart added this to the 0.1.1 milestone Dec 19, 2021
@adamjstewart adamjstewart marked this pull request as draft December 20, 2021 02:34
@adamjstewart

This comment has been minimized.

@adamjstewart
Copy link
Collaborator Author

I guess the pip install issue could be solved by including the entire installation procedure in the prolog before the tutorial title. Seems kinda ugly though...

@adamjstewart
Copy link
Collaborator Author

Ah no, we can't move the pip install to the prolog because the prolog only affects what gets displayed on RtD, the file that gets opened in Colab is only the raw file itself.

@RitwikGupta
Copy link
Collaborator

lgtm

@RitwikGupta
Copy link
Collaborator

What's the hope with the tutorials, that they work off of the latest changes on main?

@adamjstewart
Copy link
Collaborator Author

I think the ideal behavior would be that if I view a certain version of the docs:

  1. I get the same version of the tutorial,
  2. the "Open in Colab" button opens the same version of the tutorial, and
  3. pip install installs the same version of TorchGeo.

So if I view the "latest" version, it displays the tutorial for main, opens it in Colab, and installs a development version. But if I view the docs for a stable release X.Y.Z, it displays that version of the tutorial, opens it in Colab, and installs the X.Y.Z release of TorchGeo.

Currently we have 1, with this PR we now have 2, but 3 is still elusive.

@adamjstewart adamjstewart modified the milestones: 0.1.1, 0.1.2 Dec 20, 2021
@adamjstewart adamjstewart marked this pull request as ready for review December 20, 2021 17:05
@adamjstewart adamjstewart merged commit 6fe1674 into main Dec 20, 2021
@adamjstewart adamjstewart deleted the docs/versioned-tutorial branch December 20, 2021 21:05
@sofstef
Copy link

sofstef commented Dec 21, 2021

I'm still having the same issue as #274 and #310. Is there a way to pip install the latest version in Google colab and if not how do you recommend running the tutorials in Google colab?

@isaaccorley
Copy link
Collaborator

@sofstef pip install git+https://github.com/microsoft/torchgeo

@adamjstewart
Copy link
Collaborator Author

Yep, instructions for installing from main can be found at https://torchgeo.readthedocs.io/en/latest/user/installation.html

The problem is that we want to keep only a single version of the tutorial in the repo, but pip install always installs the latest stable release by default. If you have any suggestions for how to handle this I would love to hear them.

@adamjstewart adamjstewart modified the milestones: 0.1.2, 0.2.0 Jan 1, 2022
@adamjstewart adamjstewart added utilities Utilities for working with geospatial data and removed utilities Utilities for working with geospatial data labels Jan 2, 2022
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
* Open specific version of tutorial in Colab

* Use valid sphinx build API

* Use string concatenation

* Fix concatenation, main version
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.

Open in Colab URL broken in 0.1.1 RUnning colab says stack_samples not found
5 participants