-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inherit metadata when resampling and grouping (#23)
This PR drops support for pandas<1.1.5 and adds various tests to ensure metadata is propagated on various operations. Specific code changes: - Every constructor now calls finalize. - for_each_belief_ is no longer passed self as the df to work on. * Call finalize in all constructors to inherit metadata. Prepare tests for upcoming pandas==1.1.1 functionality: inherit metadata when resampling and grouping. * Update reference in test. Add pandas test. * Finish rebase. * Complete the ordering of BeliefSources by name. * Fix computation order. * Workaround for aggregation function when resampling. * Fix tests: - Separate tests for mean resampling and aggregate resampling. - Separate tests for temporary attributes and subclass attributes. - Test metadata propagation for groupby of subclassed DataFrames. * Update pandas dependency. Drop support for pandas<1.1.5. Bump timely-beliefs version with major release. * Prepare dtype test for empty frames. * Add comment about which pandas version fixed test_groupby_retains_metadata. * Rename downsampling function. * Simplify calls to for_each_belief. * Fix plotting integer values (int64 is not JSON serializable). * Add reference in test docs to relevant pandas issue. * Issue 35 metadata lost on multiplication (#43) This PR adds no additional logic, only a test to check whether Issue #35 is successfully resolved (plus some refactoring of test util functions). Note that this is a merge into resample-while-keeping-metadata, and that branch (with PR #23) actually contains the logic that resolves this issue (as a side effect, because I was actually addressing deeper issues there: #22 and #26). * Refactor metadata propagation checks to util function. * Add test for metadata propagation upon multiplication (GH 35). Co-authored-by: F.N. Claessen <[email protected]> Co-authored-by: Felix Claessen <[email protected]>
- Loading branch information
Showing
9 changed files
with
283 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.