traitecoevo / plant

Trait-Driven Models of Ecology and Evolution :evergreen_tree:
https://traitecoevo.github.io/plant
53 stars 20 forks source link

Refactor metapopulation disturbances #301

Closed aornugent closed 3 years ago

aornugent commented 3 years ago

This PR refactors the existing Disturbance class into a base Disturbance_Regime class from which derived classes No_Disturbance_Regime and Weibull_Disturbance_Regime inherit from, in order to permit both meta-population and.. non-metapopulation runs.

dfalster commented 3 years ago

Tests failed :(. Was recent commit meant to work, or just a step on the way?

dfalster commented 3 years ago

Everything compiles on my machine, but many tests failing.

aornugent commented 3 years ago

Thanks - I was stashing changes before little bro kicked me off his gaming PC 😅

Will resolve tests and request merge later this week. I wonder if we can set Github Actions to ignore draft PRs?

dfalster commented 3 years ago

Should be possible. https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request

aornugent commented 3 years ago

Almost there - some of the schedule building tests are failing after the change to max_patch_lifetime that I haven't quite figured out.

For some reason, it sets a custom schedule correctly, but when we pull out the SCM$Parameters object and use it to create a second SCM it falls back to the default schedule rather than using the custom one.

aornugent commented 3 years ago

All tests passing 🤞

I ended up refactoring some of the schedule building code to something simpler, but please check I haven't broken some intended design feature. Also, stochastic.R has a patch_density variable that I've taken out as I can't see how it was supposed to be derived.

codecov-commenter commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@3200b2d). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #301   +/-   ##
==========================================
  Coverage           ?   80.22%           
==========================================
  Files              ?       90           
  Lines              ?     7359           
  Branches           ?        0           
==========================================
  Hits               ?     5904           
  Misses             ?     1455           
  Partials           ?        0           

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 3200b2d...2d64a31. Read the comment docs.