Skip to content

enhance bin and crop API docstring with examples #191

Merged
arthurmccray merged 5 commits intodevfrom
dataset-bin-crop-api-doc
Mar 11, 2026
Merged

enhance bin and crop API docstring with examples #191
arthurmccray merged 5 commits intodevfrom
dataset-bin-crop-api-doc

Conversation

@bobleesj
Copy link
Collaborator

What this PR does

crop and bin are commonly used during the first few cells of 4D-STEM data processing.

While its usage can be learned from the notebooks, this PR adds examples to the documentation so users can use it w/o searching through notebooks (experienced by @bobleesj since RAM is precious)

What should reviewer(s) do

No function changed. Just enhancing the doc. Please take a quick look at the in-line.

Copy link
Collaborator Author

@bobleesj bobleesj left a comment

Choose a reason for hiding this comment

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

@arthurmccray ready for review - I think I asked you before what was the best way to crop 4dstem dataset so that I can fit stuff in VRAM. I am sure there will be another @bobleesj down the road.

@bobleesj bobleesj marked this pull request as ready for review March 10, 2026 05:47
@bobleesj
Copy link
Collaborator Author

I was also looking at whether modifiy_in_place=true should free the initial memory. not sure whether it's happening in the current design.

But I think being able to free the original array makes this crop function more useful than using native slicing methods (which returns a view)??

@bobleesj bobleesj requested a review from arthurmccray March 10, 2026 16:06
Copy link
Collaborator

@arthurmccray arthurmccray left a comment

Choose a reason for hiding this comment

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

lgtm!

regarding modify_in_place=True, memory profiling can be a little annoying in python, but I'm pretty sure that this should work as expected and free the memory. And it's nice having both this and the slicing methods so we have the option for views as well :)

@bobleesj
Copy link
Collaborator Author

@arthurmccray Thanks Arthur for your quick review. If it looks ok! please merge! I will just double check whether it frees the memory!

@arthurmccray arthurmccray merged commit c5b4d2e into dev Mar 11, 2026
4 checks passed
@bobleesj bobleesj deleted the dataset-bin-crop-api-doc branch March 11, 2026 06:01
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