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

A universal attribute accessor #27

Closed
kmnhan opened this issue Apr 27, 2024 · 1 comment · Fixed by #28
Closed

A universal attribute accessor #27

kmnhan opened this issue Apr 27, 2024 · 1 comment · Fixed by #28
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@kmnhan
Copy link
Owner

kmnhan commented Apr 27, 2024

Description

Currently, the data loader adds new keys to the data attributes to store common metadata like sample temperature.

For instance, if an endstation stores the sample temperature in the "TB" attribute, we would add a new key "temp_sample" to the attributes and copy the value. This results in duplicate attributes with same value but different name, which can be confusing.

Possible solution

We could try to preserve the original attributes.

The steps are:

  1. Add a mapping to the loader.
  2. Upon loading the data, just add one attribute that stores the name of the loader the data was loaded with.
  3. Write an accessor that can get the mapping from the loader, and return the corresponding value dynamically.

Some expected problems with this approach:

  • A loader update with breaking changes may break existing analysis code

Alternatives

No response

Additional context

No response

@kmnhan kmnhan added the enhancement New feature or request label Apr 27, 2024
@kmnhan kmnhan self-assigned this Apr 27, 2024
@kmnhan kmnhan mentioned this issue Apr 27, 2024
3 tasks
@kmnhan kmnhan linked a pull request Apr 28, 2024 that will close this issue
3 tasks
@kmnhan kmnhan closed this as completed in #28 May 2, 2024
@kmnhan kmnhan reopened this May 2, 2024
@kmnhan
Copy link
Owner Author

kmnhan commented Sep 9, 2024

In this approach, major changes to the loader may break existing code and saved data. It would be better to retain the current way of storing the data, and just add an accessor for convenience.

Things to consider:

  1. What do we need in the accessor?

    • Hard to generalize, must provide per-loader customization
    • Similar to creating a summary dataset, although this currently requires manual effort
  2. Are we OK with current attribute names? They may be confusing, i.e., temperature is temp_sample but work function is sample_workfunction...

@kmnhan kmnhan added this to the 3.0 Release milestone Oct 8, 2024
@kmnhan kmnhan closed this as completed in eb3a742 Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant