diff --git a/Snakefile b/Snakefile index 0f13017d0866a8ac5a969dc8e2fb2a4e991cb68e..3f30fb04a46e3ffcce53159fe2c9e6660985f7b8 100644 --- a/Snakefile +++ b/Snakefile @@ -25,7 +25,8 @@ Urgent: TODO: Build package for DG scheme -> Done TODO: Move scripts into separate directory -> Done TODO: Move TODOs to Snakefile -> Done -TODO: Outsource run commands in SM rules into separate files +TODO: Outsource run commands in SM rules into separate files -> Done +TODO: Add function to select parameters for DG schemes -> Done TODO: Move plot_approximation_results() into plotting script TODO: Introduce env files for each SM rule @@ -53,6 +54,7 @@ TODO: Add a default model state TODO: Look into validators for variable checks Not feasible yet or doc-related: +TODO: Enforce SM conventions (no direct access to config, order in rule, etc.) TODO: Replace pop() with get() for dictionary access TODO: Induce shift in IC class TODO: Force input_size for each ANN model to be stencil length diff --git a/workflows/approximation.smk b/workflows/approximation.smk index b07ba24caceaf8d071d42c2e11f54678ae0367db..d19038a3879ad359725181c94598ec66b789d160 100644 --- a/workflows/approximation.smk +++ b/workflows/approximation.smk @@ -20,13 +20,17 @@ def get_ANN_model(wildcards): return [] +def get_DG_params(wildcards): + return config['schemes'][wildcards.scheme] + + rule approximate_solution: input: get_ANN_model output: DIR+'/fig/{scheme}.json' params: - dg_params = lambda wildcards: config['schemes'][wildcards.scheme], + dg_params = get_DG_params, plot_dir = DIR + '/fig' log: DIR+'/log/approximate_solution/{scheme}.log' @@ -40,8 +44,8 @@ rule plot_approximation_results: output: expand(DIR + '/fig/{plot}/{{scheme}}.pdf', plot=PLOTS) params: - dg_params=lambda wildcards: config['schemes'][wildcards.scheme], - plot_dir=DIR + '/fig', + dg_params = get_DG_params, + plot_dir = DIR + '/fig', directory = DIR log: DIR+'/log/plot_approximation_results/{scheme}.log'