diff --git a/ANN_Data_Generator.py b/ANN_Data_Generator.py index f56e026d965a9444408a2425925f3376696a9dc4..992f4abf15be8cb52dcac549ace723a8b1cf0b17 100644 --- a/ANN_Data_Generator.py +++ b/ANN_Data_Generator.py @@ -10,7 +10,7 @@ import numpy as np import DG_Approximation -class TrainingDataGenerator(object): +class TrainingDataGenerator: """Class for training data generator. Generates random training data for given initial conditions. diff --git a/ANN_Training.py b/ANN_Training.py index f937c444c8dc030ec413ab127a62a907bd5c8ed3..687e5981b41fc9ca03a46063d135594ebcde42ab 100644 --- a/ANN_Training.py +++ b/ANN_Training.py @@ -6,7 +6,7 @@ Code-Style: E226, W503 Docstring-Style: D200, D400 TODO: Add README for ANN training -TODO: Fix random seed +TODO: Fix random seed -> Done TODO: Improve file structure and naming (e.g. use '.' instead of '__') -> Done TODO: Write-protect all data and models -> Done TODO: Put legend outside plot (bbox_to_anchor) -> Done @@ -34,7 +34,7 @@ from Plotting import plot_classification_barplot, plot_classification_boxplot matplotlib.use('Agg') -class ModelTrainer(object): +class ModelTrainer: """Class for ANN model training. Trains and tests a model with set loss function and optimizer. diff --git a/Basis_Function.py b/Basis_Function.py index 96d0b4ebff7304d4b5199357b2caebb266428f2b..af43bdfbbc32f2b01fccbb35067bc20ae51e9c7d 100644 --- a/Basis_Function.py +++ b/Basis_Function.py @@ -13,7 +13,7 @@ x = Symbol('x') z = Symbol('z') -class Vector(object): +class Vector: """Class for basis vector. Attributes diff --git a/DG_Approximation.py b/DG_Approximation.py index a4d675efab14ba6f3df5231564729b9f29bc049b..cab56cfed73ef70578df114f97a9f152309b291f 100644 --- a/DG_Approximation.py +++ b/DG_Approximation.py @@ -2,31 +2,36 @@ """ @author: Laura C. Kühle -Plotter: -TODO: Double-check everything! (also with pylint, pytype, pydoc, pycodestyle) -TODO: Replace loops with list comprehension if feasible -TODO: Write documentation for all methods (important) -TODO: Discuss adding kwargs to attributes in documentation -TODO: Check whether documentation style is correct -TODO: Check whether all types in doc are correct -TODO: Check whether 'projection' is always a np.array() -TODO: Check whether all instance variables sensible -TODO: Use cfl_number for updating, not just time -TODO: Adjust code to allow classes for all equations - (Burger, linear advection, 1D Euler) -TODO: Add documentation to ANN files -TODO: Limit line to 80 characters -TODO: Remove object inheritance from classes -TODO: Rename files according to standard -TODO: Add verbose output +Urgent: TODO: Adapt TCD from Soraya (Dropbox->...->TEST_troubled-cell-detector->Troubled_Cell_Detector) -TODO: Improve file naming (e.g. use '.' instead of '__') TODO: Add way of saving data (np.savez('data/' + name, coefficients=projection, troubled_cells=troubled_cells) ) +TODO: Add verbose output +TODO: Improve file naming (e.g. use '.' instead of '__') +TODO: Move plotting into separate function + +Critical, but not urgent: +TODO: Use cfl_number for updating, not just time +TODO: Adjust code to allow classes for all equations + (Burger, linear advection, 1D Euler) + +Currently not critical: +TODO: Remove object inheritance from classes -> Done +TODO: Replace loops with list comprehension if feasible +TODO: Check whether 'projection' is always a np.array() +TODO: Check whether all instance variables are sensible +TODO: Rename files according to standard TODO: Outsource scripts into separate directory TODO: Allow comparison between ANN training datasets TODO: Add a default model state +TODO: Add an environment file for Snakemake + +Not feasible yet or doc-related: +TODO: Double-check everything! (also with pylint, pytype, pydoc, pycodestyle) +TODO: Check whether documentation style is correct +TODO: Check whether all types in doc are correct +TODO: Discuss adding kwargs to attributes in documentation TODO: Add type annotations to function heads """ @@ -48,7 +53,7 @@ matplotlib.use('Agg') x = Symbol('x') -class DGScheme(object): +class DGScheme: """Class for Discontinuous Galerkin Method. Approximates linear advection equation using Discontinuous Galerkin Method diff --git a/Initial_Condition.py b/Initial_Condition.py index 74b8efe304b59e715046fdbabfa5937e8b0244f8..cd06375818e94b6e27c270c2de50a232d4e38e02 100644 --- a/Initial_Condition.py +++ b/Initial_Condition.py @@ -6,7 +6,7 @@ import numpy as np -class InitialCondition(object): +class InitialCondition: """Class for initial condition function. Attributes diff --git a/Limiter.py b/Limiter.py index e5c1f9381f83caa04653470c799945893473178d..fbcc6aa9087c9a67ded90606258047c09a2f4711 100644 --- a/Limiter.py +++ b/Limiter.py @@ -5,7 +5,7 @@ """ -class Limiter(object): +class Limiter: """Class for limiting function. Methods diff --git a/Quadrature.py b/Quadrature.py index 23fba30932c47f3ac1c7bce9c94af16a31de2f8d..c790f9dce579d58116b423227a6e86f48c7e9418 100644 --- a/Quadrature.py +++ b/Quadrature.py @@ -6,7 +6,7 @@ import numpy.polynomial.legendre as leg -class Quadrature(object): +class Quadrature: """Class for quadrature. A quadrature is used to determine the approximation of a definite integral diff --git a/Troubled_Cell_Detector.py b/Troubled_Cell_Detector.py index ca66c5cdb445ade49c2751e473a3b95d3f9be913..18f6cb73ec46098553c5b029cc21a20caca352f5 100644 --- a/Troubled_Cell_Detector.py +++ b/Troubled_Cell_Detector.py @@ -25,7 +25,7 @@ x = Symbol('x') z = Symbol('z') -class TroubledCellDetector(object): +class TroubledCellDetector: """Class for troubled-cell detection. Detects troubled cells, i.e., cells in the mesh containing instabilities. diff --git a/Update_Scheme.py b/Update_Scheme.py index aaa080b7c7d7921f281263daba33813ce2cd27fb..c44aaf55a4f5da1bdfbfa81eaeef28d45d0f1514 100644 --- a/Update_Scheme.py +++ b/Update_Scheme.py @@ -11,7 +11,7 @@ import numpy as np import time -class UpdateScheme(object): +class UpdateScheme: """Class for updating projections at a time step. Attributes