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

Fixes for accessor mapping methods #91

Merged
merged 3 commits into from
May 29, 2024
Merged

Fixes for accessor mapping methods #91

merged 3 commits into from
May 29, 2024

Conversation

hombit
Copy link
Collaborator

@hombit hombit commented May 29, 2024

This PR addresses issue #87 and removes most of the in-place modification methods from the NestedAccessor. The problem with field modification was that pd.Series.dtype would not update after changing the underlying NestedAccessor.dtype. The only modification we can still perform through the accessor interface is changing the field (subcolumn) data without altering its dtype.

Note: When I mention "in-place" here, I don't mean that we do not copy data — we do copy the arrays we modify. However, this process is transparent from the user's and pd.Series's point of view. Therefore, we are effectively changing pd.Series in-place, while the underlying memory blobs remain immutable.

It also fixes #62, because we wouldn't have both methods anymore.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@hombit hombit changed the title Fixes for acessor mapping methods Fixes for accessor mapping methods May 29, 2024
@hombit hombit requested a review from dougbrn May 29, 2024 14:40
@hombit hombit linked an issue May 29, 2024 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.76%. Comparing base (41cce93) to head (d2c4ebd).
Report is 72 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
+ Coverage   98.71%   98.76%   +0.04%     
==========================================
  Files          15       15              
  Lines         859      888      +29     
==========================================
+ Hits          848      877      +29     
  Misses         11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented May 29, 2024

Before [41cce93] After [fbacf97] Ratio Benchmark (Parameter)
9.37±0.1ms 9.61±0.2ms 1.03 benchmarks.NestedFrameAddNested.time_run
276M 280M 1.02 benchmarks.ReassignHalfOfNestedSeries.peakmem_run
61.6±3ms 62.1±2ms 1.01 benchmarks.ReassignHalfOfNestedSeries.time_run
86.2M 86.2M 1 benchmarks.NestedFrameAddNested.peakmem_run
89.4M 89.4M 1 benchmarks.NestedFrameQuery.peakmem_run
89.4M 89.4M 1 benchmarks.NestedFrameReduce.peakmem_run
6.56±0.2ms 6.46±0.2ms 0.99 benchmarks.NestedFrameQuery.time_run
5.59±0.1ms 5.53±0.3ms 0.99 benchmarks.NestedFrameReduce.time_run
261M 256M 0.98 benchmarks.AssignSingleDfToNestedSeries.peakmem_run
33.8±1ms 31.1±2ms 0.92 benchmarks.AssignSingleDfToNestedSeries.time_run

Click here to view all benchmarks.

Copy link
Collaborator

@dougbrn dougbrn left a comment

Choose a reason for hiding this comment

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

Looks great!

src/nested_pandas/series/ext_array.py Show resolved Hide resolved
@hombit hombit merged commit 8564139 into main May 29, 2024
11 checks passed
@hombit hombit deleted the acessor-mapping branch May 29, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.nest operations do not update series dtype NestedAccessor's .pop and .pop_field() do the same
2 participants