Skip to content

Commit a99b322

Browse files
authored
Remove hardcoded source path
1 parent 16dc366 commit a99b322

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

example_workflows/nfdi/workflow.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
from conda_subprocess import check_output
33
import shutil
44

5-
source_directory_global = os.path.join(os.path.dirname(os.path.abspath(__file__)), "source")
65

7-
8-
def generate_mesh(domain_size: float = 2.0, source_directory: str = source_directory_global) -> str:
6+
def generate_mesh(domain_size: float = 2.0, source_directory: str) -> str:
97
stage_name = "preprocessing"
108
gmsh_output_file_name = "square.msh"
119
source_file_name ="unit_square.geo"
@@ -40,7 +38,7 @@ def convert_to_xdmf(gmsh_output_file : str) -> dict:
4038
}
4139

4240

43-
def poisson(meshio_output_xdmf: str, meshio_output_h5: str, source_directory: str = source_directory_global) -> dict:
41+
def poisson(meshio_output_xdmf: str, meshio_output_h5: str, source_directory: str) -> dict:
4442
stage_name = "processing"
4543
poisson_output_pvd_file_name = "poisson.pvd"
4644
poisson_output_numdofs_file_name = "numdofs.txt"
@@ -65,7 +63,7 @@ def poisson(meshio_output_xdmf: str, meshio_output_h5: str, source_directory: st
6563
}
6664

6765

68-
def plot_over_line(poisson_output_pvd_file: str, poisson_output_vtu_file: str, source_directory: str = source_directory_global) -> str:
66+
def plot_over_line(poisson_output_pvd_file: str, poisson_output_vtu_file: str, source_directory: str) -> str:
6967
stage_name = "postprocessing"
7068
pvbatch_output_file_name = "plotoverline.csv"
7169
source_file_name = "postprocessing.py"
@@ -82,7 +80,7 @@ def plot_over_line(poisson_output_pvd_file: str, poisson_output_vtu_file: str, s
8280
return os.path.abspath(os.path.join("postprocessing", pvbatch_output_file_name))
8381

8482

85-
def substitute_macros(pvbatch_output_file: str, ndofs: int, domain_size: float = 2.0, source_directory: str = source_directory_global) -> str:
83+
def substitute_macros(pvbatch_output_file: str, ndofs: int, domain_size: float = 2.0, source_directory: str) -> str:
8684
stage_name = "postprocessing"
8785
source_file_name = "prepare_paper_macros.py"
8886
template_file_name = "macros.tex.template"
@@ -104,7 +102,7 @@ def substitute_macros(pvbatch_output_file: str, ndofs: int, domain_size: float =
104102
return os.path.abspath(os.path.join(stage_name, macros_output_file_name))
105103

106104

107-
def compile_paper(macros_tex: str, plot_file: str, source_directory: str = source_directory_global) -> str:
105+
def compile_paper(macros_tex: str, plot_file: str, source_directory: str) -> str:
108106
stage_name = "postprocessing"
109107
paper_output = "paper.pdf"
110108
source_file_name = "paper.tex"
@@ -134,4 +132,4 @@ def _copy_file(stage_name, source_file):
134132

135133
def _copy_file_from_source(stage_name, source_file_name, source_directory: str = source_directory_global):
136134
source_file = os.path.join(source_directory, source_file_name)
137-
shutil.copyfile(source_file, os.path.join(stage_name, source_file_name))
135+
shutil.copyfile(source_file, os.path.join(stage_name, source_file_name))

0 commit comments

Comments
 (0)