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

Reconstruct a subset of time indices #398

Merged
merged 16 commits into from
Aug 8, 2023
Merged

Conversation

talonchandler
Copy link
Collaborator

recorder reconstruct naively loops through all time points, applying the reconstruction as it goes. This default is limiting for datasets with a large number of time points where it is more convenient to reconstruct a single time point on a single core (via multiprocessing or slurm).

This PR adds a configuration-file option time_indices with signature:
time_indices: Union[NonNegativeInt, List[NonNegativeInt], Literal["all"]] = "all"

By default time_indices: "all" reconstructs all time point, which is backwards compatible.
If time_indices: 5, then only time-point 5 will be reconstructed.
Finally, if

time_indices:
- 0 
- 5
- 10

then the 0th, 5th, and 10th indices will be reconstructed.

@edyoshikun requested this feature for simplifying parallel reconstructions with recOrder, and I expect we'll use a similar feature in mantis.

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #398 (d6989e7) into main (276081f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head d6989e7 differs from pull request most recent head e39fb70. Consider uploading reports for the commit e39fb70 to get more accurate results

@@           Coverage Diff            @@
##            main    #398      +/-   ##
========================================
+ Coverage   7.14%   7.16%   +0.02%     
========================================
  Files         25      25              
  Lines       4435    4436       +1     
========================================
+ Hits         317     318       +1     
  Misses      4118    4118              
Files Changed Coverage Δ
recOrder/tests/cli_tests/test_reconstruct.py 97.22% <100.00%> (+0.07%) ⬆️

@deprecated-napari-hub-preview-bot
Copy link

deprecated-napari-hub-preview-bot bot commented Aug 8, 2023

Preview page for your plugin is ready here:
https://preview.napari-hub.org/mehta-lab/recOrder/398
Updated: 2023-08-08T18:50:59.646065

@ziw-liu
Copy link
Contributor

ziw-liu commented Aug 8, 2023

Should d2331d9 be ported into this PR?

@talonchandler
Copy link
Collaborator Author

Great call @ziw-liu.

I cherry-picked that commit and modified the condition to create a new array (instead of checking if 0 is in time_indices, I'm checking if an array already exists).

talonchandler and others added 3 commits August 8, 2023 11:43
Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>
Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>
@talonchandler
Copy link
Collaborator Author

Thanks for the improvements @ziw-liu!

@talonchandler talonchandler added this pull request to the merge queue Aug 8, 2023
Merged via the queue into main with commit 858f3d4 Aug 8, 2023
6 of 7 checks passed
talonchandler added a commit that referenced this pull request Aug 9, 2023
* add `time_indices` to config file

* `apply-inv-tf` for subsets of timepoints

* test single time index, list of indices, and "all"

* check invalid times

* test time axis lengths

* catch off by one errors

* save to output indices

* formattings

* better tests

* changed output shape
changed initialization

* create an emtpy array if one doesn't exist

* fix time indexing

* fix tests

* Update recOrder/cli/apply_inverse_transfer_function.py

Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>

* remove unused lines

* Update recOrder/cli/apply_inverse_transfer_function.py

Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>

---------

Co-authored-by: Clinton Huynh <clinton.huynh@czbiohub.org>
Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>
@talonchandler talonchandler deleted the specify-time-indices branch September 24, 2023 19:09
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.

4 participants