-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d19cae7
commit f2c523d
Showing
4 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
nibelungenbruecke/scripts/postprocessing/postprocessing_runner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import importlib | ||
|
||
def postprocess_run(parameters: dict): | ||
|
||
for task, load_task in parameters.items(): | ||
module = importlib.import_module("nibelungenbruecke.scripts.postprocessing."+task) | ||
functions = {name: value for name, value in vars(module).items() if callable(value)and name.endswith("_run")} | ||
for name, value in functions.items(): | ||
value(load_task) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
import json | ||
import numpy as np | ||
|
||
from nibelungenbruecke.scripts.postprocessing.plot_influence_lines import plot_influence_lines | ||
from nibelungenbruecke.scripts.postprocessing.postprocessing_runner import postprocess_run | ||
|
||
def task_plot_influence_lines(): | ||
def task_postprocess_run(): | ||
postprocess_parameters_path = "./input/settings/postprocess_parameters.json" | ||
with open(postprocess_parameters_path, 'r') as f: | ||
postprocess_parameters = json.load(f) | ||
|
||
plot_influence_lines_parameters = postprocess_parameters["plot_influence_lines"] | ||
return {'actions': [(plot_influence_lines,[],{'parameters':plot_influence_lines_parameters})], | ||
'file_dep': [plot_influence_lines_parameters["sensors_path"],plot_influence_lines_parameters["influence_lines_path"]], | ||
'targets': [plot_influence_lines_parameters["output_path"]+plot_influence_lines_parameters["output_format"]], | ||
'uptodate': [True]} | ||
|
||
if __name__ == "__main__": | ||
|
||
postprocess_parameters_path = "./input/settings/postprocess_parameters.json" | ||
with open(postprocess_parameters_path, 'r') as f: | ||
postprocess_parameters = json.load(f) | ||
|
||
plot_influence_lines(postprocess_parameters["plot_influence_lines"]) | ||
dependencies = list(np.concatenate([task["file_dep"] for task in postprocess_parameters.values()]).flat) | ||
return {'actions': [(postprocess_run,[],{'parameters':postprocess_parameters})], | ||
'file_dep': dependencies, | ||
'targets': [], | ||
'uptodate': [False]} # Normally always to be run |