pyopenms-docs icon indicating copy to clipboard operation
pyopenms-docs copied to clipboard

Complete rework of our example file handling

Open jpfeuffer opened this issue 2 years ago • 2 comments

I dont like this urlretrieve idea to master at all.

Data and code will inevitably diverge. And binder notebooks are duplicating files, spending ages to download + are very hard to test.

We should parameterize URLs with a sphinx extension to point to the correct branch (while someone is at it, they could add the banner message that comes with the extension)

Regarding differences between ReadTheDocs and binder (where we can just use local files): a) Write a pandoc filter that replaces urlretrieve calls to the pyopenms-extra repo to local links

or

b)

  • Add helper.py in the repo
  • try import helper.py at the beginning of every notebook (will fail silently for copied snippets)
  • Redefine urlretrieve in helper.py:
  def urlretrieve(URL ... same params as urllib):
    if (exists(URL - everything before /src/.. )):
      return localURL
    else:
      import urllib.urlretrieve
      return urllib.urlretrieve(*)

jpfeuffer avatar Oct 27 '21 13:10 jpfeuffer