Skip to content
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

Issue 35 metadata lost on multiplication #43

Conversation

Flix6x
Copy link
Collaborator

@Flix6x Flix6x commented Dec 11, 2020

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).

@Flix6x Flix6x added the Subclassing Subclassing pandas data structures label Dec 11, 2020
@Flix6x Flix6x requested a review from nhoening December 11, 2020 09:43
@Flix6x Flix6x self-assigned this Dec 11, 2020
@Flix6x Flix6x linked an issue Dec 11, 2020 that may be closed by this pull request
@nhoening
Copy link
Contributor

Please add in title or subscription what you are doing here. This is just improving our tests and no addition to any logic right?

@Flix6x
Copy link
Collaborator Author

Flix6x commented Dec 17, 2020

This PR indeed 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).

@Flix6x Flix6x merged commit 41a06ab into resample-while-keeping-metadata Dec 21, 2020
@Flix6x Flix6x deleted the issue-35-Metadata_lost_on_multiplication branch December 21, 2020 10:51
Flix6x added a commit that referenced this pull request Dec 21, 2020
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subclassing Subclassing pandas data structures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata lost on multiplication
2 participants