Comments (3)
Ah perfect, than my observation is what is expected.
To your question: yes I think I would find a return value documentation helpful.
As a minimum I would add a line similar to what you can find on the docs for load
Unlike compute, the original dataset is modified and returned.
or compute
Unlike load, the original dataset is left unaltered.
I would just copy the latter from compute and add it to persist?
I can also add the return value but technically load also returns the updated Dataset. I could just not add it in the documentation though?
from xarray.
in general, there are only very few in-place methods (.load
and .update
are the only examples I can think of). As far as the code goes: it creates a (shallow) copy, then replaces the arrays in that copy with the persisted ones. So yes, persist
does not modify the original object.
A PR would be welcome, but I wonder how to best point this out: since it's the general rule, I feel functions that don't follow it should stress that more... maybe adding return value description would help already?
from xarray.
see also #6837 for a discussion about the difference between compute
and load
.
from xarray.
Related Issues (20)
- DataTree.assign_coords and similar should only set node coords HOT 9
- Objects with multiple identical `xindex`s on a dim aren't alignable HOT 2
- Operations on DataTree objects should not create duplicate coordinates on sub-trees HOT 11
- TreeNode constructor should not modify children in-place
- Feature: Aggregate using one or more operations over the specified axis. HOT 1
- Merging coordinates computes array values HOT 2
- Assigning to DataTree.coords should support full paths HOT 3
- A constructor like DataTree.from_dict for data variables and coordinates
- Dask not properly supported when creating binaries with PyInstaller HOT 4
- writing datetime64 in netCDF may produce badly formatted or unreadable files HOT 13
- DataTree: Copy during assignment to child nodes? HOT 2
- Forbid path-like child names
- Why both "backend" and "engine"? HOT 1
- `concat()` very slow when inserting `NaN` into Dask arrays HOT 7
- DataTree repr showing inherited coordinates as non-inherited HOT 1
- Dedicated documentation on Alignment? HOT 2
- Parallelize map_over_subtree HOT 1
- Add a case_sensitivity keyword arguments to methods relying on pathlib (Python 3.12)
- map_blocks fails with lazy loaded dask array
- Performance of deep DataTrees HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xarray.