Uh oh!
There was an error while loading. Please reload this page.
Add copy option in DataTree.from_dict - #9193
Conversation
Illviljan
commented
Jun 29, 2024
Is treenode used anywhere else besides as a mixin-class for DataTree? DataTree overrides TreeNode._set anyway. |
Uh oh!
There was an error while loading. Please reload this page.
This test is a mutability test and a typo caused this error. This test used |
for more information, see https://pre-commit.ci
shoyer
commented
Jun 30, 2024
Elsewhere in Xarray (e.g., on |
Illviljan
commented
Jun 30, 2024
Maybe |
shoyer
commented
Jun 30, 2024
👍 for a private constructor, if we want to use this internally inside Xarray. |
Well it wouldn't be for internal xarray usage for me, it would be for a backend/mfdatatree function. But it is a typical way we use to speed things up and implying checks are being bypassed, do we have any other public examples? My real problem is pretty similar to the intro example but I have 100+ datatrees instead, such a simple operation takes 1.5 minutes because of all the copies, it goes down to around 19ms with this pr. |
shoyer
commented
Jul 1, 2024
Yikes, that is pretty bad! Do you have a slightly more realistic benchmark you could share, and/or add to the asv tests? I am sure we can do much better for performance in Once we have the right behavior, it makes sense to start working on performance. I am optimistic that we can figure out how to improve performance without needing to expand the public API. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Significantly speed up
from_dictby removing unwanted copying.whats-new.rst