paradox icon indicating copy to clipboard operation
paradox copied to clipboard

Value Change Callback

Open mb706 opened this issue 5 years ago • 5 comments

See tests for how exactly this could work. The idea is to have a $callbacks slot of functions that get called whenever $values changes; the functions get called in turn and return a possibly modified version of the values to be set. This would close #231.

mb706 avatar Jun 28 '19 18:06 mb706

Codecov Report

Merging #237 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   94.55%   94.61%   +0.05%     
==========================================
  Files          20       20              
  Lines         496      501       +5     
==========================================
+ Hits          469      474       +5     
  Misses         27       27
Impacted Files Coverage Δ
R/ParamSetCollection.R 95.77% <100%> (ø) :arrow_up:
R/ParamSet.R 97.24% <100%> (+0.09%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7f4c9fb...8daebd9. Read the comment docs.

codecov[bot] avatar Jun 28 '19 18:06 codecov[bot]

Codecov Report

Merging #237 into master will increase coverage by 0.82%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   94.55%   95.37%   +0.82%     
==========================================
  Files          20       20              
  Lines         496      584      +88     
==========================================
+ Hits          469      557      +88     
  Misses         27       27
Impacted Files Coverage Δ
R/ParamSetCollection.R 95.77% <100%> (ø) :arrow_up:
R/ParamSet.R 98.24% <100%> (+1.1%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7f4c9fb...139c1fb. Read the comment docs.

codecov[bot] avatar Jun 28 '19 18:06 codecov[bot]

Essentially a forced trafo?

jakob-r avatar Jul 03 '19 06:07 jakob-r

It allows for side-effects from changin parameter values. My use-case is changing one ParamSet member of a ParamSetCollection according to a parameter value (see the "callbacks on ParamSetCollection" test at the end of test_ParamSet.R in the PR).

mb706 avatar Jul 03 '19 07:07 mb706

lets at least discuss this in toulouse, i am unsure wether this is a good thing

berndbischl avatar Jul 03 '19 07:07 berndbischl