geocompx / geocompy

Geocomputation with Python: an open source book and online resource for getting started in this space
https://py.geocompx.org/
Other
260 stars 47 forks source link

Codespaces Support #173

Closed anitagraser closed 1 year ago

anitagraser commented 1 year ago

What is the current status of the Codespaces support? I can see that building the book works well. The HTML files are created and I can view them in the browsers. But I cannot seem to run the cells in the qmds. Is this expected? Thanks

Robinlovelace commented 1 year ago

What is the current status of the Codespaces support? I can see that building the book works well. The HTML files are created and I can view them in the browsers. But I cannot seem to run the cells in the qmds. Is this expected? Thanks

You should be able to run the cells in the .qmd files. Worked a few months ago. Will give it a spin and report back.

Robinlovelace commented 1 year ago

Giving it a go...

image

Source: https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=447558863

Robinlovelace commented 1 year ago

Confirmed:

image

Robinlovelace commented 1 year ago

Relevant? https://stackoverflow.com/questions/65241321/python-shift-enter-not-working-in-vscode-with-jupyter

anitagraser commented 1 year ago

It works on desktop, so this issue seems codespace specific

Robinlovelace commented 1 year ago

Interesting... A person who I know has done lots of .devcontainer and Codespaces work is Olivier Benz so, with apologies for tagging you in random issue, any ideas on this @benz0li?

benz0li commented 1 year ago

@anitagraser Is the Jupyter extension installed in your Codespace? https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter

ℹ️ Current versions of the Python extension do not install the Jupyter extension alongside by default: https://code.visualstudio.com/updates/v1_78#_python

This may be required to run the cells.

anitagraser commented 1 year ago

I see. Based on the timing, that could indeed be the culprit. Thank you @benz0li

Robinlovelace commented 1 year ago

:tada:

image

benz0li commented 1 year ago

FYI The book may be reproduced with glcr.b-data.ch/jupyterlab/r/qgisprocess, which is also available at https://demo.jupyter.b-data.ch.

  1. Clone this project.
  2. Create a venv within the project:
    python -m venv .venv
    echo "*" > .venv/.gitignore
    .venv/bin/python -m pip install --upgrade pip
    .venv/bin/python -m pip install -r requirements.txt
    source .venv/bin/activate
  3. Render the book:
    quarto preview

Cross reference: https://github.com/geocompx/docker/issues/37#issuecomment-1556117717 ff

benz0li commented 1 year ago

I have created [CUDA-enabled] Data Science Development Containers.

Dev Container R qgisprocess should work just fine with this repository.

Robinlovelace commented 1 year ago

Awesome!