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

Convert certain objects to scientific metadata entries #78

Open
jl-wynen opened this issue Mar 22, 2023 · 0 comments
Open

Convert certain objects to scientific metadata entries #78

jl-wynen opened this issue Mar 22, 2023 · 0 comments
Labels
discussion Requires discussion before anything can be implemented enhancement New feature or request

Comments

@jl-wynen
Copy link
Collaborator

From a discussion with @nvaytet:

The scientific metadata looks like
{'value': 1609.91, 'unit': 'uAh', 'valueSI': 1609.91, 'unitSI': 'uAh'}
If this is the standard we should use, when populating this for a derived data, it would be super if I could add in there directly some scipp variables. Right now, if I do derived.meta['background_level'] = sc.scalar(300, unit=counts) it has my scipp variable locally, but I am guessing that when I upload to scicat, this won't work, or be converted to a string?

Jan-Lukas Wynen
I'd prefer to not depend on Scipp in Scitacean.
Also, this is only the ess convention. Other facilities use more free form dicts.

Jan-Lukas Wynen
Also also, valueSI and unitSI are set by SciCat, you only need to specify value and unit.

Neil Vaytet
Can we make a translator in the setitem that converts a scipp variable to to the value/unit dict? You wouldn't necessarily have to depend on scipp to check the type, you could check if it is not a dict, and then see if it hasattr('unit')?

Jan-Lukas Wynen
Could do. So it could check if the arg implements

class MetaValue(Protocol):
  @property
  def value(self): ...

  @property
  def unit(self): ...

But still, this would be ESS-specific.

@jl-wynen jl-wynen added enhancement New feature or request discussion Requires discussion before anything can be implemented labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Requires discussion before anything can be implemented enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant