Skip to content

Conversation

@kushalkolar
Copy link
Member

Skips data arrays that already exist, closes #901

@clewis7 should be gtg

@kushalkolar kushalkolar requested a review from clewis7 as a code owner October 20, 2025 22:59
@github-actions
Copy link

📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/iw-set-data-subset2

Copy link
Member

@clewis7 clewis7 left a comment

Choose a reason for hiding this comment

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

This is cool! I didn't know you could do this kind of comparison without np.all()

@clewis7 clewis7 merged commit 522c296 into main Oct 21, 2025
52 checks passed
@clewis7 clewis7 deleted the iw-set-data-subset2 branch October 21, 2025 12:43
@kushalkolar
Copy link
Member Author

This is cool! I didn't know you could do this kind of comparison without np.all()

This is only checking that the object reference is the same. If "new_data" is an array with the same values as the existing data array then it won't pass this check.

Intended use is something like this:

a, b, c, d # existing arrays

iw = fpl.ImageWidget([a, b, c, d])

# I want to replace only c

new = np.array(...)

iw.set_data([a, b, new, d])

# this will also end up replacing

a_copy = a.copy()

iw.set_data([a_copy, b, c, d])

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.

ImageWidget.set_data() for a subset of the data arrays

3 participants