MAINT: calculations.py function and dirpar_ deprecations#124
Merged
Conversation
* Deprecates the parameter `dirpar_edges` in
the following functions:
- `calculations.calc_sigma`
- `calculations.calc_state_probs_from_diags`
- `calculations.calc_net_cycle_flux_from_diags`
* Re-introduces (with deprecated status) the
`calculations.calc_net_cycle_flux` to allow
for KDA paper code to continue working
* Updates docstrings for aforementioned functions
so it is clear under which circumstances the
deprecation warnings will be produced
* Updates `Test_Diagram_Generation.test_diagram_counts` and
`Test_Diagram_Generation.test_max_connected_diagram_counts`
to remove mentions of `dirpars`
* Updates to `test_function_inputs`:
- Adds 3 test cases to confirm `DeprecationWarning`s are
triggered when `dirpar_edges` is used in `calc_sigma`,
`calc_state_probs_from_diags`, etc.
- Adds 2 test cases to confirm a `TypeError` is raised
when no directional diagram edges/diagrams are input
- Adds 2 test cases to confirm multiple
`DeprecationWarning`s are raised when calling
`calc_state_probs_from_diags` or
`calc_net_cycle_flux_from_diags` with the
deprecated parameter `dirpar_edges`
Collaborator
Author
|
One of the new test cases failed -- I looked into it locally, and it turns out this is related to If I install On further inspection it looks like its coming from |
* Removes check for new `DeprecationWarning` assertion related to the number of warnings given when `calc_net_cycle_flux_from_diags` is called.
Collaborator
Author
|
Alright, all tests are passing, docs look good, and the KDA paper code still works on this branch (primarily due to the re-introduction of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Deprecates the parameter
dirpar_edgesin the following functions:calculations.calc_sigmacalculations.calc_state_probs_from_diagscalculations.calc_net_cycle_flux_from_diagsRe-introduces (with deprecated status) the
calculations.calc_net_cycle_fluxto allowfor KDA paper code to continue working
Updates docstrings for aforementioned functions so it is clear under which circumstances the
deprecation warnings will be produced
Updates
Test_Diagram_Generation.test_diagram_countsandTest_Diagram_Generation.test_max_connected_diagram_countsto remove mentions ofdirparsUpdates to
test_function_inputs:DeprecationWarnings are triggered whendirpar_edgesis used incalc_sigma,calc_state_probs_from_diags, etc.TypeErroris raised when no directional diagram edges/diagrams are inputDeprecationWarnings are raised when callingcalc_state_probs_from_diagsorcalc_net_cycle_flux_from_diagswith the deprecated parameterdirpar_edgesStatus