Closed mkasztelnik closed 8 years ago
@mkasztelnik I tend to follow a general rule that all custom rake tasks should be idempotent. This is to avoid trashing the production DB in case of multiple invocations (which happens surprisingly often). Please consider the following:
find_or_create_by
instead of create
when spawning data structuresmeasurements
which belong to this experiment's simulated timeline@mkasztelnik What's the status of this PR?
According to our f2f conversation you said that you will do polishing and merging. Additionally (in another PR) I propose to create dedicated function allowing to create water wave, eg. something like:
create_experiment(name: "Experiment n", from: Time.now, to: Time.now + 70.hours,
Function.new(from: 0.0, to: 4.0, interval: 24.hours), # up
Function.new(from: 4.0, to: 4.0, interval: 10.hours), # plato
Function.new(from: 4.0, to: 0.0, interval: 36.hours)) # down
This method can check if experiment with given name already exists. It yes than existing water wave is deleted and new one is generated. I can help in implementing this method next week.
Right - sorry; I forgot about that convo. :)
Previous experiment was skipped due to technical levee problems. Current changes are connected with new experiment concept which already took place.
Experiment changes are already applied into prod and dev dap.