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

feat: manage metadata in DO operations #296

Open
yucongalicechen opened this issue Dec 30, 2024 · 2 comments
Open

feat: manage metadata in DO operations #296

yucongalicechen opened this issue Dec 30, 2024 · 2 comments
Milestone

Comments

@yucongalicechen
Copy link
Contributor

          We don't have to check metadata unless we modify the metadata somehow.  Right now, it will just inherit the metadata from the LHS DO (I think, right)?  We might want to think how we want to handle that in the future and make an issue for a future release.

One idea I had was, if each DO has a uuid (which they do now) we could store the provenance of the new DO, for example, that it was lhs_do.uuid + rhs_do.uuid, for example. In principle we could unroll everything all the way back to recover all metadata this way. But this can get pretty complicated pretty quickly. Let's just leave it as it is for now.

In terms of if we need more examples, just make sure that all the tests are described in the docs in words.

We may want to put in the docs that the new DO inherits metadata from the LHS DO or whatever it is.

Originally posted by @sbillinge in #248 (comment)

@bobleesj
Copy link
Contributor

@sbillinge

Right now, it will just inherit the metadata from the LHS DO (I think, right)?

This is correct. LHS is the source of truth (deepcopy) and RHS's yarray is applied to that of LHS.

        self._check_operation_compatibility(other)
        summed_do = deepcopy(self)
        if isinstance(other, (int, float)):
            summed_do._all_arrays[:, 0] += other
        if isinstance(other, DiffractionObject):
            summed_do._all_arrays[:, 0] += other.all_arrays[:, 0]
        return summed_do

But this can get pretty complicated pretty quickly

I agree on this because we have to decide which one to inherit and how to combine, etc.

@sbillinge
Copy link
Contributor

@sbillinge

Right now, it will just inherit the metadata from the LHS DO (I think, right)?

This is correct. LHS is the source of truth (deepcopy) and RHS's yarray is applied to that of LHS.

        self._check_operation_compatibility(other)
        summed_do = deepcopy(self)
        if isinstance(other, (int, float)):
            summed_do._all_arrays[:, 0] += other
        if isinstance(other, DiffractionObject):
            summed_do._all_arrays[:, 0] += other.all_arrays[:, 0]
        return summed_do

But this can get pretty complicated pretty quickly

I agree on this because we have to decide which one to inherit and how to combine, etc.

This is where blockchain and Merkle trees might come to our rescue.... A discussion for the future?

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

No branches or pull requests

3 participants