flatironinstitute / mcmc-monitor

Monitor MCMC runs in the browser
Other
36 stars 0 forks source link

Refactor mcmcmonitor reducer #57

Closed jsoules closed 1 year ago

jsoules commented 1 year ago

This PR comprises two major and one minor change.

The major changes are:

A corresponding minor change was:

To comment further on the reducer-logic refactor:

Something similar might be doable with running the updated statistics for the chain-sequences and variables, but that's more inherently asynchronous since it's computationally expensive and thus done by a web worker, so I'm not going to touch it right now.

Deployed this branch to dev at https://flatironinstitute.github.io/mcmc-monitor/dev/?s=https://lit-bayou-76056.herokuapp.com

codecov-commenter commented 1 year ago

Codecov Report

Merging #57 (2c7c571) into main (16c6099) will increase coverage by 1.82%. The diff coverage is 64.12%.

@@           Coverage Diff            @@
##            main     #57      +/-   ##
========================================
+ Coverage   5.64%   7.46%   +1.82%     
========================================
  Files         60      62       +2     
  Lines       5385    5358      -27     
  Branches      21      78      +57     
========================================
+ Hits         304     400      +96     
+ Misses      5081    4958     -123     
Flag Coverage Δ
gui_units 9.38% <69.70%> (+2.52%) :arrow_up:
svc_units 2.28% <0.00%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
service/src/logic/OutputManager.ts 0.00% <0.00%> (ø)
service/src/types/Typeguards.ts 0.00% <0.00%> (ø)
...c/MCMCMonitorDataManager/MCMCMonitorDataManager.ts 0.00% <0.00%> (ø)
...rc/MCMCMonitorDataManager/MCMCMonitorTypeguards.ts 0.00% <0.00%> (ø)
src/MCMCMonitorDataManager/updateChains.ts 0.00% <0.00%> (ø)
src/MCMCMonitorDataManager/updateSequenceStats.ts 0.00% <0.00%> (ø)
src/MCMCMonitorDataManager/updateVariableStats.ts 0.00% <0.00%> (ø)
src/MCMCMonitorDataManager/useMCMCMonitor.ts 0.00% <0.00%> (ø)
src/MCMCMonitorDataManager/MCMCMonitorData.ts 100.00% <100.00%> (+37.46%) :arrow_up:
src/MCMCMonitorDataManager/updateSequences.ts 100.00% <100.00%> (+100.00%) :arrow_up:
... and 1 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

magland commented 1 year ago

@jsoules This indeed looks simpler. If you've tested it and it works, then I'm in favor of merging and deploying.

jsoules commented 1 year ago

Just did one more rebase, given the changes we pushed to main earlier.

I've re-deployed to dev at https://flatironinstitute.github.io/mcmc-monitor/dev/?s=https://lit-bayou-76056.herokuapp.com and will click around on that a bit more just to be absolutely sure.

magland commented 1 year ago

Seems to work, although you should probably test it while live updating.

jsoules commented 1 year ago

Tested while live updating--everything still appears to function as expected. So I'm going to go ahead and merge this & publish.