Code base for PeriPy, a lightweight, open-source and high-performance package for peridynamic simulations written in Python - a collaboration between Exeter, Cambridge & Turing
MIT License
47
stars
14
forks
source link
Review if updating `model.h5` file independent parameters like `bond_stiffness` and `critical_stretch` should have its own method #115
The current solution to updating a model parameter (when no update the model.h5 file is required after said update) is to simply run a simulation with that new parameter as a key word argument. Is this the best solution though? Wouldn't it be less confusing to explicitly update the model parameters before a simulation is done.
Disadvantages:
Adds 1 line of code to the example files.
Advantages:
Cleaner under-the-hood code at _simulate_initiate
More interpretable and clear code at the example file level
Flatter code
simulate should be conceptually separated from model, in that simulate is applying boundary conditions to a preexisting model and watching what happens. Suggested change goes towards that ideal.
Advantages seem to outweigh disadvantages, so I'll impliment this.
The current solution to updating a model parameter (when no update the model.h5 file is required after said update) is to simply run a simulation with that new parameter as a key word argument. Is this the best solution though? Wouldn't it be less confusing to explicitly update the model parameters before a simulation is done. Disadvantages:
Advantages:
_simulate_initiate
simulate
should be conceptually separated frommodel
, in thatsimulate
is applying boundary conditions to a preexistingmodel
and watching what happens. Suggested change goes towards that ideal.Advantages seem to outweigh disadvantages, so I'll impliment this.