-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add counterfactual minus guided/unguided diff at location level #726
Conversation
Bump @Zapiano |
How close are we to merging this? |
I'll start looking into this now and let you know what's missing or of it's ready soon. |
@ConnectedSystems This one is ready for another review. Note that now it depends on #847 |
da1db9d
to
9ef5c30
Compare
Thanks. An example usage would be appreciated too @Zapiano |
I've added an example in this PR. Once this PR is approved I can add this plot to the documentation on a separate PR. |
f1f7e38
to
eadec98
Compare
I'm not sure the indicated use it the best approach. It forces only one set of bootstrapped results (only the median?), and forces additional computations to be done (e.g., what if I only want # Extract cf_difference_loc for guided and unguided (in that order)
rc = ADRIA.metrics.relative_cover(rs)
gd_res, ug_res = ADRIA.metrics.cf_difference_loc(rc, scens) # <- this method name feels awkward
# Plot cf_difference_loc for unguided and guided
gd_fig = ADRIA.viz.diff_map(rs, gd_res[2, :]) # <- why `[2, :]`? (I know why, but feels awkward)
ug_fig = ADRIA.viz.diff_map(rs, ug_res[2, :]) Instead, I suggest something like the below which, to me, is a cleaner UX. rc = ADRIA.metrics.relative_cover(rs)
# outcome, scenario spec, percentile value of interest
gd_res = ADRIA.metrics.ensemble_difference(rc, scens, 0.5; timestep=2, scenario_type=:guided)
# outcome, scenario spec, statistical function of interest
ug_res = ADRIA.metrics.ensemble_difference(rc, scens, mean; timestep=2, scenario_type=:unguided) On the plotting, it kind of feels like we're getting to the point where we want our own YAXArray subtype. ADRIA.viz.map(rs, gd_res::SomeCustomYAXArray?) #<- uses different defaults to the "usual" `viz.map()` |
@ConnectedSystems this was updated to address your comments. The description was updated with new example of usage and plots. |
I'm not sure I understand the purpose of having our own YAXArray subtype. |
To be able to define our own custom styling for specific use cases and be able to make different styles (e.g., different set of default options) when plotting some arbitrary results (e.g., |
@ConnectedSystems the tests that were not passing is a problem on the main branch apparently (#890). If you prefer waiting for that to be fixed so we are sure the tests are passing for this PR as well it's fine, otherwise this one is ready to merge. |
Have you updated to the latest dependencies? |
Yes. |
FYI, Makie's theme recipes seem more stable now, and better documented: https://docs.makie.org/stable/tutorials/wrap-existing-recipe |
Now the user can specify which aggregation metric to use when comparing between scenarios.
The refactor was to both adapt to recent code changes and improve readability
@ConnectedSystems tests are passing and I've updated testset names for the tests that are related to this PR as we discussed. |
@ConnectedSystems just reminding you that this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor comments, but this is ready to be merged once those are addressed.
Done, and all tests passing. |
Also update tests and examples accordingly.
@ConnectedSystems I made two changes:
|
Followed an approach similar to #452 (comment) but for a spatial level.
Note: Depends on #847
Example of code
Plots