Skip to content

Conversation

lrennels
Copy link
Collaborator

@lrennels lrennels commented Jun 13, 2020

This PR addresses #585 and transitions from v0.10.0 to v1.0.0 by removing deprecation warning code so that deprecated syntax will error. Note that a small drop in coverage is inevitable since we are leaving in a few functions but no longer supporting, and thus no longer testing, them.

@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

Merging #713 into master will increase coverage by 0.48%.
The diff coverage is 62.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #713      +/-   ##
==========================================
+ Coverage   80.15%   80.64%   +0.48%     
==========================================
  Files          38       38              
  Lines        2882     2867      -15     
==========================================
+ Hits         2310     2312       +2     
+ Misses        572      555      -17     
Flag Coverage Δ
#unittests 80.64% <62.96%> (+0.48%) ⬆️
Impacted Files Coverage Δ
src/Mimi.jl 100.00% <ø> (ø)
src/core/time.jl 94.36% <0.00%> (+2.58%) ⬆️
src/core/time_arrays.jl 84.89% <61.90%> (+4.40%) ⬆️
src/core/defcomp.jl 91.77% <100.00%> (+0.57%) ⬆️
src/core/model.jl 85.36% <100.00%> (-0.69%) ⬇️
src/core/types/model.jl 100.00% <100.00%> (ø)

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 97746b8...798f3b1. Read the comment docs.

Now that we have our post-trial function, we can proceed to obtain our two models and run the simulation. Note that we are using a Mimi MarginalModel `mm` from MimiDICE2010, which is a Mimi object that holds both the base model and the model with the additional pulse of emissions.

```jldoctest tutorial4; output = false, filter = r".*"s
```julia
Copy link
Collaborator Author

@lrennels lrennels Jun 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the doctest for now because MimiDICE2010 uses .marginal instead of .modified, can re-add it once the correct version of that model is used

@davidanthoff davidanthoff added this to the v1.0.0 milestone Jun 26, 2020
@lrennels
Copy link
Collaborator Author

lrennels commented Jun 26, 2020

NOTE to Lisa change the replace! function and tests next

@lrennels lrennels marked this pull request as ready for review July 2, 2020 20:40
@davidanthoff
Copy link
Collaborator

Next step here is that @ckingdon95 approves and then we merge, right?

Copy link
Collaborator

@corakingdon corakingdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lrennels looks great to me! I pushed a few small typos and fixes, and left a couple questions here

Comment on lines 100 to 105
# Deprecated int indexing should still run
@test x[3] == time_dim_val[3]
x[TimestepIndex(3)] = temp_dim_val[3]
@test x[TimestepIndex(3)] == temp_dim_val[3]
reset_time_val(x, time_dim_val)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we leave part of this test to test that this now errors? (might help with our coverage of the functions we have deprecated, but the code is still there?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is a broader question about coverage of deprecated functions. @davidanthoff is there a way for us to list certain functions that the coverage tests don't care about? because this PR is definitely going to decrease our testing coverage unfortunately

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, it is going to decrease coverage. The other option I guess is to add tests for errors and then remove them when we remove the specific error messages in a later release I just wasn't sure if that was overkill and wanted to keep testing clean ... but coverage then goes down.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@test_throws seems the right approach for this kind of situation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidanthoff I added back in the tests for old behavior that were already there, now with @test_throws. Now overall test coverage for Mimi has increased, but the diff coverage is not 100% because there were some deprecated Int-indexing functions that were not previously being tested, and that this PR changed from warnings to errors. Do you want me to add individual tests for each of these, or should we ignore it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets ignore that

@corakingdon
Copy link
Collaborator

@lrennels I noticed some tests that are failing, I think because of actual changes. I'm going to go through and address them now!

@lrennels
Copy link
Collaborator Author

lrennels commented Jul 6, 2020

@ckingdon95 I think I just fixed one of them one second I'll push!

@davidanthoff
Copy link
Collaborator

This one is good now? @ckingdon95 can you approve?

@davidanthoff davidanthoff merged commit 10a258e into master Jul 10, 2020
@davidanthoff davidanthoff deleted the dep branch July 10, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants