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

Add support for running batch on a single lightcurve #420

Merged
merged 7 commits into from
Apr 9, 2024
Merged

Conversation

wilsonbb
Copy link
Collaborator

@wilsonbb wilsonbb commented Mar 29, 2024

Change Description

In #409 it was proposed to add a batch helper function try_batch which would allow Ensemble.batch to be tested on a single lightcurve. To accomplish that goal, here we instead add a new parameter single_lc to Ensemble.batch

When single_lc is provided an object ID, the function provided to batch is executed on that single lightcurve.

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

Code Quality

  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

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

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@wilsonbb wilsonbb changed the title Single lc Add support for running batch on a single lightcurve Mar 29, 2024
Copy link

github-actions bot commented Mar 29, 2024

Before [d72d1e7] After [cad54cd] Ratio Benchmark (Parameter)
36.6±1ms 36.7±0.3ms 1 benchmarks.time_prune_sync_workflow
36.6±0.9ms 35.6±0.6ms 0.97 benchmarks.time_batch

Click here to view all benchmarks.

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 89.47368% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 95.84%. Comparing base (d72d1e7) to head (c454bba).

Files Patch % Lines
src/tape/ensemble.py 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
+ Coverage   95.82%   95.84%   +0.02%     
==========================================
  Files          25       25              
  Lines        1771     1781      +10     
==========================================
+ Hits         1697     1707      +10     
  Misses         74       74              

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

@wilsonbb wilsonbb requested a review from dougbrn March 29, 2024 00:35
@wilsonbb wilsonbb marked this pull request as ready for review March 29, 2024 00:38
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.

This looks good, just have one main change that I think should be made.

@@ -1107,6 +1108,9 @@ def batch(
source or object tables. If not specified, then the id column is
used by default. For TAPE and `light-curve` functions this is
populated automatically.
single_lc: `int`, optional
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be really helpful to also allow single_lc=True, where select_random_lightcurve is used to pick one for the user.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that makes sense. To do that, I added an id_only parameter to Ensemble.select_random_timeseries so that it will only fetch the object id of a random lightcurve. But let me know if you would prefer that not added to the API and I can break that out differently.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks! That looks like a good solution

@wilsonbb wilsonbb requested a review from dougbrn April 5, 2024 20:43
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!

@wilsonbb wilsonbb merged commit 89aa116 into main Apr 9, 2024
9 of 10 checks passed
@wilsonbb wilsonbb deleted the single_lc branch April 9, 2024 01:43
@wilsonbb wilsonbb mentioned this pull request Apr 11, 2024
3 tasks
wilsonbb added a commit that referenced this pull request Apr 24, 2024
wilsonbb added a commit that referenced this pull request Apr 24, 2024
…on a single lightcurve" (#433)

* Revert "Add support for running batch on a single lightcurve (#420)"

This reverts commit 89aa116.

* Pin dask-expr to old version

* Pin to last known good dask-expr

* Try pinning dask-expr to <1.0.10

* Move pin back to 1.0.10
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.

2 participants