Skip to content
Snippets Groups Projects
Commit 1a7d40dc authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Added option to select plotting colors.

parent 17aba6ff
No related branches found
No related tags found
No related merge requests found
......@@ -24,28 +24,23 @@ TODO: Discuss name for quadrature mesh (now: grid)
Urgent:
TODO: Added sign change in stiffness and boundary matrix to accommodate
negative wave speed -> Done
TODO: Force input_size for each ANN model to be stencil length
TODO: Induce shift in IC class
TODO: Unify print commands (f vs no f)
TODO: Add method and error info to Mesh
TODO: Add use of discontinuity position to all ICs
TODO: Change maximum training degree to 6
TODO: Change minimum training mesh size to 2^5
TODO: Enforce shift to be positive for two-sided Heaviside
TODO: Remove option to choose training domain
TODO: Fix VisibleDeprecationWarning for ndarray encoding
TODO: Give option to select plotting color
TODO: Unify print commands (f vs no f) -> Done
TODO: Add method and error info to Mesh -> Done
TODO: Add use of discontinuity position to all ICs -> Done
TODO: Change maximum training degree to 6 -> Done
TODO: Change minimum training mesh size to 2^5 -> Done
TODO: Enforce shift to be positive for two-sided Heaviside -> Done
TODO: Remove option to choose training domain -> Done
TODO: Fix VisibleDeprecationWarning for ndarray decoding -> Done
TODO: Give option to select plotting color -> Done
TODO: Move scripts into separate directory
TODO: Outsource run commands in SM rules into separate files
TODO: Move plot_approximation_results() into plotting script
TODO: Introduce env files for each SM rule
TODO: Restructure directories
TODO: Add images to report
TODO: Add verbose output
Critical, but not urgent:
TODO: Restructure 'calculate_approximate_solution()'
TODO: Rework Theoretical TC for efficiency
TODO: Rework Theoretical TCD for efficiency
TODO: Extract object initialization from DGScheme
TODO: Replace loops with list comprehension if feasible
TODO: Replace loops/list comprehension with vectorization if feasible
......@@ -68,6 +63,12 @@ TODO: Add a default model state
TODO: Look into validators for variable checks
Not feasible yet or doc-related:
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
TODO: Restructure directories
TODO: Add images to report
TODO: Add verbose output
TODO: Adjust definitions of each IC to be dependent on domain
TODO: Add README for ANN training
TODO: Give detailed description of wavelet detection
......
......@@ -314,7 +314,7 @@ def plot_evaluation_results(evaluation_file: str, directory: str,
def plot_approximation_results(data_file: str, directory: str, plot_name: str,
quadrature: Quadrature,
colors: dict, quadrature: Quadrature,
init_cond: InitialCondition) -> None:
"""Plots given approximation results.
......@@ -329,6 +329,8 @@ def plot_approximation_results(data_file: str, directory: str, plot_name: str,
Path to directory in which plots will be saved.
plot_name : str
Name of plot.
colors: dict
Dictionary of colors used for plots.
quadrature: Quadrature object
Quadrature used for evaluation.
init_cond : InitialCondition object
......@@ -344,10 +346,12 @@ def plot_approximation_results(data_file: str, directory: str, plot_name: str,
for key in approx_stats.keys()}
approx_stats['basis'] = OrthonormalLegendre(**approx_stats['basis'])
approx_stats['mesh'] = Mesh(**approx_stats['mesh'])
print([key for key in approx_stats.keys()])
# Plot exact/approximate results, errors, shock tubes,
# and any detector-dependant plots
plot_results(quadrature=quadrature, init_cond=init_cond, **approx_stats)
plot_results(quadrature=quadrature, init_cond=init_cond,
colors=colors, **approx_stats)
# Set paths for plot files if not existing already
if not os.path.exists(directory):
......
......@@ -85,9 +85,10 @@ rule plot_approximation_results:
quadrature = getattr(Quadrature, detector_dict.pop(
'quadrature', 'Gauss'))(detector_dict.pop(
'quadrature_config', {}))
colors = detector_dict.pop('colors', None)
plot_approximation_results(directory=params.plot_dir,
plot_name=wildcards.scheme,
plot_name=wildcards.scheme, colors=colors,
data_file=params.plot_dir+'/'+wildcards.scheme,
quadrature=quadrature, init_cond=init_cond)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment