Skip to content

Direct constructor for DataArray objects #115

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

Closed
shoyer opened this issue May 6, 2014 · 1 comment · Fixed by #149
Closed

Direct constructor for DataArray objects #115

shoyer opened this issue May 6, 2014 · 1 comment · Fixed by #149
Milestone

Comments

@shoyer
Copy link
Member

shoyer commented May 6, 2014

It shouldn't be necessary to put arrays in a Dataset to make a DataArray.

See also: #85 (comment)

@mrocklin
Copy link
Contributor

mrocklin commented May 6, 2014

+1

shoyer added a commit to shoyer/xarray that referenced this issue Jun 6, 2014
This makes the xray API a little more similar to pandas, which
makes heavy use of `name = None` for objects that can but don't always
have names like Series and Index.

It will be a particular useful option to have around when we add
a direct constructor for DataArray objects (pydata#115). For now, arrays will
probably only end up being named `None` if they are the result of some
mathematical operation where the name could be ambiguous.
keewis pushed a commit to keewis/xarray that referenced this issue Jan 17, 2024
* test assigning int

* allow assigning coercible values

* refactor name-related methods to intermediate class

* refactor tests to match

* fix now-exposed bug with naming

* moved test showing lack of name permanence

* whatsnew
keewis pushed a commit to keewis/xarray that referenced this issue Jan 17, 2024
* sketching out changes needed to integrate variables into DataTree

* fixed some other basic conflicts

* fix mypy errors

* can create basic datatree node objects again

* child-variable name collisions dectected correctly

* in-progres

* add _replace method

* updated tests to assert identical instead of check .ds is expected_ds

* refactor .ds setter to use _replace

* refactor init to use _replace

* refactor test tree to avoid init

* attempt at copy methods

* rewrote implementation of .copy method

* xfailing test for deepcopying

* pseudocode implementation of DatasetView

* Revert "pseudocode implementation of DatasetView"

This reverts commit 52ef23baaa4b6892cad2d69c61b43db831044630.

* removed duplicated implementation of copy

* reorganise API docs

* expose data_vars, coords etc. properties

* try except with calculate_dimensions private import

* add keys/values/items methods

* don't use has_data when .variables would do

* explanation of basic properties

* add data structures page to index

* revert adding documentation in favour of that going in a different PR

* explanation of basic properties

* add data structures page to index

* create tree node-by-node

* create tree from dict

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* dict-like interface

* correct deepcopy tests

* use .data_vars in copy tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* black

* whatsnew

* data contents

* dictionary-like access

* TODOs

* test assigning int

* allow assigning coercible values

* simplify example using pydata#115

* add note about fully qualified names

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants