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

Adjust handling units of measurement to changes in core.proto #384

Closed
tnoczyns-volue opened this issue Jan 4, 2024 · 0 comments · Fixed by #434
Closed

Adjust handling units of measurement to changes in core.proto #384

tnoczyns-volue opened this issue Jan 4, 2024 · 0 comments · Fixed by #434
Assignees
Milestone

Comments

@tnoczyns-volue
Copy link
Collaborator

Adjust to proto changes that will be done in https://github.com/Volue/energy-mesh/issues/4662.

The changes won't break the Python SDK API:

  • The unit_of_measurement in SimpleAttributeDefinition, TimeseriesAttributeDefinition and TimeseriesResource should be left as string type.
  • The new_unit_of_measurement parameter in update_timeseries_resource_info should be left as a string, but in the implementation of update_timeseries_resource_info we should use ListUnitsOfMeasurement RPC1 to map the unit of measurement name to ID and use the ID in the updated UpdateTimeseriesResource RPC.

With this approach the:

  • Python SDK API is compatible with older versions.
  • Users can still work with units of measurements expressed as strings, which could be handier.
  • We still have the option to extend the new_unit_of_measurement in update_timeseries_resource_info to accept also IDs and express unit_of_measurement in SimpleAttributeDefinition, TimeseriesAttributeDefinition and TimeseriesResource by new class UnitOfMeasurement instead of string.

Footnotes

  1. This RPC will be added in https://github.com/Volue/energy-mesh/issues/4701.

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 a pull request may close this issue.

1 participant