Skip to content

Commit

Permalink
Remove images from demo folder (#445)
Browse files Browse the repository at this point in the history
* remove images from repo

* Run demos with savefig when building docs

* inside if

* didn't mean to commit that line
  • Loading branch information
mscroggs authored Apr 26, 2022
1 parent 84e247a commit 523282c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ joss/paper.pdf
*.egg-info
_skbuild
dist

*.png
*.jpg
*.svg
!joss/img/*.png
!joss/img/*.svg
Binary file removed demo/python/ccr_triangle_3.png
Binary file not shown.
Binary file removed demo/python/ccr_triangle_4.png
Binary file not shown.
11 changes: 11 additions & 0 deletions doc/web/make_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ def system(command):

# Make demos
os.system(f"rm {path('../../demo/python/*.py.rst')}")
os.system(f"rm {path('../../demo/python/*.png')}")
# If file saves matplotlib images, run the demo
for file in os.listdir(path("../../demo/python")):
if file.endswith(".py"):
with open(path(f"../../demo/python/{file}")) as f:
content = f.read()
if "savefig" in content:
here = os.getcwd()
os.chdir(path("../../demo/python"))
system(f"python3 {file}")
os.chdir(here)
system(f"cd {path('../../demo/python')} && python3 convert_to_rst.py")
system(f"mkdir {path('python/source/demo')}")
system(f"cp {path('../../demo/python/*.rst')} {path('python/source/demo')}")
Expand Down

0 comments on commit 523282c

Please sign in to comment.