Skip to content

Conversation

@SimonHeybrock
Copy link
Member

An attempt to describe our current reasoning. Did I forget anything?

Note that the ADR is marked as "draft", i.e., not something we have made a decision on.

Copy link
Member

@jl-wynen jl-wynen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some typos. Looks good otherwise.

Co-authored-by: Jan-Lukas Wynen <jan-lukas.wynen@ess.eu>

If we consider binary operations (such as addition or division) then it is not clear how attributes should be handled if they mismatch between operands or are missing in one operand.
This is an example where Scipp made a different choice than Xarray.
In Xarray, ``((a + b) + c).attrs != (a + (b + c)).attrs`` whereas in Scipp ``((a + b) + c).attrs == (a + (b + c)).attrs``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example when this happens?

In practice attributes are very frequently dropped in binary operations.
This raises some questions about the usability of the mechanism.
Xarray's approach is more "useful", at the cost of consistency.
Xarray's mechanism furthermore necessiated complications, such as global settings that influence the behavior as well as certain interfaces with keyword arguments to define attribute handling.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Xarray's mechanism furthermore necessiated complications, such as global settings that influence the behavior as well as certain interfaces with keyword arguments to define attribute handling.
Xarray's mechanism furthermore necessitates complications, such as global settings that influence the behavior as well as certain interfaces with keyword arguments to define attribute handling.

@SimonHeybrock SimonHeybrock mentioned this pull request Jun 6, 2023
11 tasks
@SimonHeybrock SimonHeybrock merged commit 11709ca into main Jun 6, 2023
@SimonHeybrock SimonHeybrock deleted the adr-attrs branch June 6, 2023 09:36
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 this pull request may close these issues.

5 participants