geocompy icon indicating copy to clipboard operation
geocompy copied to clipboard

Improve "Code and sample data" section

Open Nowosad opened this issue 2 years ago • 8 comments

https://py.geocompx.org/preface#code-and-sample-data

  1. It only lists .ipynb and \data files. Many chapters also rely on the \output files (created in Chapter 1), however, I assume that some reader will only try to run some chapters. Maybe we could make copies of some files from \output to \data? Or you have some better idea?
  2. "landsat.tif" is not in the \data folder of the repo (maybe some others are also missing)
  3. Do we even use some of the files listed (e.g., yorkshire.json)?
  4. Can you explain me how the ipynb files are created? Maybe I could modify our GitHub action to make them automatically...

Nowosad avatar Dec 29 '23 16:12 Nowosad

  1. You're right, thanks! Now corrected in the text (https://github.com/geocompx/geocompy/commit/d0eb98107dde873b2b385132bbcbe8d67ca1d205)

michaeldorman avatar Jan 03 '24 08:01 michaeldorman

  1. landsat.tif was in .gitignore, I now removed the entry from there. I checked and no other files are missing

michaeldorman avatar Jan 03 '24 08:01 michaeldorman

  1. Right, thanks! Now removed yorkshire.json, there are no other unnecessary files as far as I checked

michaeldorman avatar Jan 03 '24 08:01 michaeldorman

  1. The .ipynb files are created using:
for i in *.qmd; do
  quarto convert $i
done

(https://github.com/geocompx/geocompy/blob/main/convert.sh) It's a good idea if this can be automatic, thanks

michaeldorman avatar Jan 03 '24 08:01 michaeldorman

@michaeldorman -- see https://github.com/geocompx/geocompy/tree/geocompy.

I think I was able to create a GitHub action that creates ipynb files and move them (and data folder) to a new branch. See https://github.com/geocompx/geocompy/blob/main/.github/workflows/prep-book-package.yml.

This GitHub action only starts when your commit message contains "update book package"

Nowosad avatar Jan 04 '24 18:01 Nowosad

The above approach allows us to create GitHub releases (from the geocompy branch): see https://github.com/geocompx/geocompy/releases/tag/0.2.

@michaeldorman would you be able to update the data/code instructions in the book?

Nowosad avatar Jan 04 '24 18:01 Nowosad

Hi @Nowosad ,looks great, thanks! Perhaps the release can also contain the output directory? (according to note (1) in the first comment in this thread)

michaeldorman avatar Jan 04 '24 21:01 michaeldorman

See it now: https://github.com/geocompx/geocompy/tree/geocompy

Let me know if there is something still missing. If not -- feel free to create a new release.

Nowosad avatar Jan 05 '24 08:01 Nowosad

As far as I can tell this is solved, so closing, thanks @Nowosad 🙏

michaeldorman avatar Jul 01 '24 11:07 michaeldorman