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

Tools for dataframes-to-series convertion #51

Merged
merged 1 commit into from
May 4, 2024
Merged

Tools for dataframes-to-series convertion #51

merged 1 commit into from
May 4, 2024

Conversation

hombit
Copy link
Collaborator

@hombit hombit commented May 3, 2024

This PR fixes #45 introducing few ways to convert a sequence of "light curves" to a nested series:

  • packer.pack_dfs() is renamed to pack_seq. It is reimplemented with NestedExtensionArray.from_sequence() which expends it from dataframe-items to things like None, pd.NA, {"time": [...], "flux": [...]}, pa.scalar(...), etc. Now it also supports index and dtype arguments
  • packer.pack() which is a wrapper around both pack_flat() for pd.DataFrame input and pack_seq() for everything else
  • NestedFrame.add_nested() now calls pack() instead of pack_flat() to support sequence inputs.

Change Description

  • My PR includes a link to the issue that I am addressing

Solution Description

Code Quality

  • I have read the Contribution Guide
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Project-Specific Pull Request Checklists

Bug Fix Checklist

  • My fix includes a new test that breaks as a result of the bug (if possible)
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

New Feature Checklist

  • I have added or updated the docstrings associated with my feature using the NumPy docstring format
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover my new feature
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Documentation Change Checklist

Build/CI Change Checklist

  • If required or optional dependencies have changed (including version numbers), I have updated the README to reflect this
  • If this is a new CI setup, I have added the associated badge to the README

Other Change Checklist

  • Any new or updated docstrings use the NumPy docstring format.
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover any changes
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Copy link

github-actions bot commented May 3, 2024

Before [109c16c] After [65e0429] Ratio Benchmark (Parameter)
4.26±0.3s 3.36±0.7s ~0.79 benchmarks.time_computation
2.29k 3.54k 1.55 benchmarks.mem_list

Click here to view all benchmarks.

Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.50%. Comparing base (109c16c) to head (442321b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   97.35%   97.50%   +0.14%     
==========================================
  Files          14       14              
  Lines         794      801       +7     
==========================================
+ Hits          773      781       +8     
+ Misses         21       20       -1     

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

@hombit hombit changed the title Tools for dataframes to nested series convertion Tools for dataframes-to-series convertion May 3, 2024
@hombit hombit marked this pull request as ready for review May 3, 2024 20:21
@hombit hombit requested a review from dougbrn May 3, 2024 20:22
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 good!

@hombit hombit merged commit 49b03ff into main May 4, 2024
11 checks passed
@hombit hombit deleted the pack_seq branch May 4, 2024 11:33
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.

Provide a simpler way to build a nested series from a collection of dataframes
2 participants