Repository: pystiche/pystiche

Issue:
fix download and storing of the demo images
During his review @soumith encountered MD5 checksum mismatch while trying to run the test suite and the examples (https://github.com/pyOpenSci/software-review/issues/25#issuecomment-698135408). The images linked from Pixabay indeed changed, but without a perceptible visual change. 

The checksums have to be adapted and the download tests should be run on a schedule to faster detect these kind of changes we have no control over. If this happens again, we should consider hosting them ourselves to avoid this in the future.


Discussion:

Resolving patch:
diff --git a/pystiche/demo.py b/pystiche/demo.py
--- a/pystiche/demo.py
+++ b/pystiche/demo.py
@@ -30,28 +30,31 @@ def demo_images() -> DownloadableImageCollection:
     return DownloadableImageCollection(
         {
             "bird1": DownloadableImage(
-                "https://cdn.pixabay.com/photo/2016/01/14/11/26/bird-1139734_960_720.jpg",
+                "https://download.pystiche.org/images/bird1.jpg",
                 file="bird1.jpg",
                 author="gholmz0",
                 date="09.03.2013",
                 license=PixabayLicense(),
-                md5="36e5fef725943a5d1d22b5048095da86",
+                md5="ca869559701156c66fc1519ffc26123c",
+                note="https://pixabay.com/photos/bird-wildlife-australian-bird-1139734/",
             ),
             "paint": DownloadableImage(
-                "https://cdn.pixabay.com/photo/2017/07/03/20/17/abstract-2468874_960_720.jpg",
+                "https://download.pystiche.org/images/paint.jpg",
                 file="paint.jpg",
                 author="garageband",
                 date="03.07.2017",
                 license=PixabayLicense(),
                 md5="a991e222806ef49d34b172a67cf97d91",
+                note="https://pixabay.com/de/photos/abstrakt-kunst-hintergrund-farbe-2468874/",
             ),
             "bird2": DownloadableImage(
-                "https://cdn.pixabay.com/photo/2013/03/12/17/53/bird-92956_960_720.jpg",
+                "https://download.pystiche.org/images/bird2.jpg",
                 file="bird2.jpg",
                 author="12019",
                 date="09.04.2012",
                 license=PixabayLicense(),
-                md5="8c5b608bd579d931e2cfe7229840fe9b",
+                md5="2398e8f6d102b9b8de7c74d4c73b71f4",
+                note="https://pixabay.com/photos/bird-wildlife-sky-clouds-nature-92956/",
             ),
             "mosaic": DownloadableImage(
                 "https://upload.wikimedia.org/wikipedia/commons/2/23/Mosaic_ducks_Massimo.jpg",
@@ -62,12 +65,13 @@ def demo_images() -> DownloadableImageCollection:
                 md5="5b60cd1724395f7a0c21dc6dd006f8ae",
             ),
             "castle": DownloadableImage(
-                "https://cdn.pixabay.com/photo/2014/04/03/10/28/lemgo-310586_960_720.jpg",
+                "https://download.pystiche.org/images/castle.jpg",
                 file="castle.jpg",
                 author="Christian Hänsel",
                 date="23.03.2014",
                 license=PixabayLicense(),
-                md5="f6e7d9ed61223c12230b99ed496849a9",
+                md5="9d085fac77065e0da66629162f759f90",
+                note="https://pixabay.com/de/photos/lemgo-brake-schloss-br%C3%BCcke-310586/",
                 guides=DownloadableImageCollection(
                     {
                         "building": DownloadableImage(


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -93,5 +93,19 @@ jobs:
       - name: Create environment
         run: tox -e tests-galleries --notest
 
+      - name: Get pystiche.home() directory
+        id: pystiche-home
+        run: |
+          PYTHON=".tox/tests-galleries/bin/python"
+          DIR="$($PYTHON -c 'import pystiche; print(pystiche.home())')"
+          echo "::set-output name=dir::$DIR"
+
+      - name: Load pystiche.home() from cache
+        uses: actions/cache@v2
+        with:
+          path: ${{ steps.pystiche-home.outputs.dir }}
+          key: pystiche-home-${{ hashFiles('pystiche/demo.py') }}
+          restore-keys: pystiche-home-
+
       - name: Run tests
         run: tox -e tests-galleries