Skip to content

Commit

Permalink
Add figure of modified sections to repropacks/process-all utils (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mesnardo authored Nov 16, 2022
1 parent f8a121f commit 68001a5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ postprocessing
output
snake.body

snake-lips-2d-repropacks

tmp
Binary file modified data/figures/modified_sections_aoa35.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion data/scripts/plot_modified_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
x_ref_ = x_ref + i
ax.plot(x_ref_, y_ref, color='black', linestyle='--')
ax.plot(x, y, color='black', linewidth=2)
ax.axis('scaled', adjustable='box')
ax.axis('scaled')
ax.axis('off')
fig.tight_layout()

Expand Down
20 changes: 20 additions & 0 deletions data/scripts/process_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Run post-processing scripts."""

import os
import subprocess
from pathlib import Path

pwd = Path(__file__).absolute().parent
os.environ['MPLBACKEND'] = 'AGG' # set non-GUI backend to skip showing figures

scripts = [
'plot_modified_sections.py',
]

for script in scripts:
print(f'[INFO] Running script {script} ...')
script = str(pwd / script)
p = subprocess.Popen(
f'python {script} --no-compute --no-show', shell=True
)
p.communicate()
2 changes: 1 addition & 1 deletion misc/process_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
rootdir = pwd.parent

scripts = list((rootdir / 'runs').glob('**/process_all.py'))
scripts += list((rootdir / 'data').glob('**/process_all.py'))

for script in scripts:
print(f'[INFO] Running script {script} ...')
script = str(pwd / script)
p = subprocess.Popen(
f'python {script}', shell=True
)
Expand Down
1 change: 1 addition & 0 deletions misc/repropacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ def copy_repropacks_files(dir_from, dir_to):
delete_repropacks(ROOTDIR / REPROPACKS_NAME)
download_repo(GH_OWNER, GH_REPO, GH_BRANCH, ROOTDIR / REPROPACKS_NAME)
copy_repropacks_files(ROOTDIR / 'runs', ROOTDIR / REPROPACKS_NAME / 'runs')
copy_repropacks_files(ROOTDIR / 'data', ROOTDIR / REPROPACKS_NAME / 'data')

0 comments on commit 68001a5

Please sign in to comment.