FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: manage metadata in DO operations · Issue #296 · diffpy/diffpy.utils · GitHub

feat: manage metadata in DO operations #296

Open

Description

          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)

Activity

  1. added this to the 3.7.0 release milestone on Dec 30, 2024
  2. bobleesj commented on Dec 30, 2024

    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.

  3. sbillinge commented on Dec 30, 2024

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL