Skip to content

pointmatch: add functions for fast and deep copy#155

Merged
RussTorres merged 2 commits intodevelopfrom
copy_matches
Feb 15, 2021
Merged

pointmatch: add functions for fast and deep copy#155
RussTorres merged 2 commits intodevelopfrom
copy_matches

Conversation

@RussTorres
Copy link
Copy Markdown
Collaborator

This adds a function to "copy" pointmatch dictionaries such that changes to the match arrays of the original do not affect the copy.

As background for why this is useful, BigFetA has use cases where it transforms pointmatches in-place. This becomes a problem when doing multiple-step in-memory alignment or trying to interrogate residuals. To be on the safe side I've been copying the matches before each step, which is very expensive on large alignments.

The test I added uses the same match objects (via copy/paste) as the integration test, but I am surprised to see that the format of the dictionaries doesn't match what I was seeing in real pointmatch collections, e.g.

"p": [[1, 2, 3], [1, 2, 3]] (pointmatch collection)
vs
"p": [[1, 1], [2, 2], [3, 3]] (test fixture)

This actually doesn't affect the way I have the copy implemented, but I'm not sure if this is a long-standing typo or something that changed without us noticing.

@RussTorres RussTorres merged commit 2404132 into develop Feb 15, 2021
@RussTorres RussTorres deleted the copy_matches branch February 15, 2021 21:44
@RussTorres RussTorres mentioned this pull request Jul 11, 2022
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