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

initial refactor for NamedArray #8075

Merged
merged 83 commits into from
Sep 27, 2023
Merged

initial refactor for NamedArray #8075

merged 83 commits into from
Sep 27, 2023

Conversation

andersy005
Copy link
Member

@andersy005 andersy005 commented Aug 17, 2023

this pull request introduces the initial prototype for NamedArray as discussed in issue #8073. the intention is to approach the implementation in multiple phases through separate pull requests. the main objectives of this PR are as follows:

  1. creation of a new class, xarray.named_array.NamedArray, which will encompass most of the necessary functionality for the lightweight version of xarray.Variable. As a result, xarray.Variable will inherit from this class and implement specific functionality related to xarray.

  2. removal of all imports of internal Xarray classes and utilities from the xarray.named_array sub-package. the aim is to eliminate dependencies on anything within xarray.core. This will facilitate the future goal of moving named_array into its own standalone package, with xarray then depending on it.

@TomNicholas
Copy link
Member

Should we use namedarray over named_array?

@keewis
Copy link
Collaborator

keewis commented Aug 17, 2023

Should we use namedarray over named_array?

the advantage is that the package name on PyPI / conda-forge would be the same as the import name

@TomNicholas
Copy link
Member

Also it's ironic that our NamedArray won't actually have a .name attribute, but at least pytorch's NamedTensor is guilty of the same sin 😅

@TomNicholas TomNicholas added the topic-NamedArray Lightweight version of Variable label Aug 17, 2023
xarray/named_array/core.py Outdated Show resolved Hide resolved
xarray/named_array/utils.py Outdated Show resolved Hide resolved
xarray/named_array/utils.py Outdated Show resolved Hide resolved
xarray/named_array/utils.py Outdated Show resolved Hide resolved
xarray/named_array/utils.py Outdated Show resolved Hide resolved
xarray/named_array/core.py Outdated Show resolved Hide resolved
xarray/core/utils.py Outdated Show resolved Hide resolved
xarray/core/utils.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/core/dataarray.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
xarray/tests/test_namedarray.py Outdated Show resolved Hide resolved
@andersy005 andersy005 requested a review from dcherian September 25, 2023 22:51
@andersy005
Copy link
Member Author

this initial prototype is ready for another round of review. however, there is still a significant amount of work that needs to be done

we are keeping track of all the tasks in this project board. for those who are interested in following along or contributing, you can find the project board here: Link

xarray/tests/test_namedarray.py Show resolved Hide resolved
xarray/namedarray/core.py Outdated Show resolved Hide resolved
@dcherian
Copy link
Contributor

Thanks for adding the tests @andersy005 .

Let's move forward here.

@dcherian dcherian changed the title initial prototype for NamedArray initial refactor for NamedArray Sep 27, 2023
@dcherian dcherian merged commit c3b5ead into pydata:main Sep 27, 2023
24 checks passed
@andersy005 andersy005 deleted the named-array branch September 27, 2023 15:35
@dcherian dcherian mentioned this pull request Sep 27, 2023
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review run-benchmark Run the ASV benchmark workflow topic-groupby topic-NamedArray Lightweight version of Variable topic-typing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants