mimiframework / Mimi.jl

Integrated Assessment Modeling Framework
https://www.mimiframework.org
Other
68 stars 34 forks source link

Add find_type_instabilities #961

Closed davidanthoff closed 1 year ago

davidanthoff commented 1 year ago

Usage is:

Mimi.find_type_instabilities(m, :compname)

and that will call code_warntype on the run_timestep method for that component.

In theory one can also use this with https://github.com/JuliaDebug/Cthulhu.jl by doing

Mimi.find_type_instabilities(m, :compname, Cthulhu.descend)

but in practice that doesn't seem to work together with our way of generating these run_timestep methods from our macro.

I would suggest we don't document this for now and don't consider it part of the "public" API, until we have figured out whether this is actually working well or not. We might also try to get this to work with Cthulhu properly.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.28 :warning:

Comparison is base (91a71f1) 85.12% compared to head (4bdae7a) 84.85%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #961 +/- ## ========================================== - Coverage 85.12% 84.85% -0.28% ========================================== Files 40 41 +1 Lines 4041 4054 +13 ========================================== Hits 3440 3440 - Misses 601 614 +13 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `84.85% <0.00%> (-0.28%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/mimiframework/Mimi.jl/pull/961?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework) | Coverage Δ | | |---|---|---| | [src/Mimi.jl](https://app.codecov.io/gh/mimiframework/Mimi.jl/pull/961?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework#diff-c3JjL01pbWkuamw=) | `100.00% <ø> (ø)` | | | [src/utils/diagnostics.jl](https://app.codecov.io/gh/mimiframework/Mimi.jl/pull/961?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework#diff-c3JjL3V0aWxzL2RpYWdub3N0aWNzLmps) | `0.00% <0.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

davidanthoff commented 1 year ago

I only tried this after running the model, maybe at that point the dims are there? But if we can get this to work without running, even better.

lrennels commented 1 year ago

Interesting, at first I was doing

m = get_model
Mimi.build!(m)

to get a built model but not run it because the migration model is just so slow, but I also tried it with a run MimiGIVE and got the same error? Did yours work for a run model?