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

datatree import (clean) #8688

Merged
merged 286 commits into from
Jan 31, 2024

Conversation

flamingbear
Copy link
Member

This is the exact same steps followed in #8656

But hopefully with a clean history.

I am copying the notes from the previous PR below.

https://github.com/flamingbear/rewritten-datatree is the version of datatree that was m
erged in this PR.


Previous PR notes
This PR imports xarray-contrib/datatree and its history to pydata/xarray/xarray/datatree_

Step one of issue #8572.
This imports the datatree code without exposing DataTree as a public API.

git filter repo https://github.com/newren/git-filter-repo was used to preserve some history for the merge.

Datatree tags were renamed to legacy-datatree-{tag}:

git filter-repo --tag-rename '':'legacy-datatree-'

Links to xarray-contrib/datatree original PRs are preserved by rewriting the messages using a replace-message file.

# standard github style pull request (#39)
regex:\(#(\d+)\)==>https://github.com/xarray-contrib/datatree/pull/\1

# "Merge pull request #11 from TomNicholas/single_datanode_class"
regex:pull request #(\d+)==>https://github.com/xarray-contrib/datatree/pull/\1

Links to the xarray-contrib/datatree Issues are preserved with a replace-text file.

# standard comment change "  # see issue #38"
regex:(\s*?#.*[ ])#(\d+)==>\1https://github.com/xarray-contrib/datatree/issues/\2

# also "    @pytest.mark.xfail(reason="Indexing needs to return whole tree (GH #77)")"
regex:(\(GH #(\d+)\))==>(GH https://github.com/xarray-contrib/datatree/issues/\2)

The datatree repo was relocated to a subdirectory

git-filter-repo --to-subdirectory xarray/datatree_

and the prepared datatree repository was added as a remote and merged into xarray.

git merge prepared-datatree/main --no-commit --allow-unrelated-histories

This should allow work to begin on the rest of the steps in #8572

TomNicholas and others added 30 commits August 24, 2021 00:21
Expose the methods that are explicitly defined in the Dataset class definition
Define all Dataset properties on DataTree
…finition

Add API methods in class definition
* black reformatting

* add setup.cfg to configure flake8/black/isort/mypy

* add setup.cfg to configure flake8/black/isort/mypy xarray-contrib/datatree#22

* passes flake8

* disabled mypy for now

Co-authored-by: Joseph Hamman <[email protected]>
TomNicholas and others added 17 commits October 27, 2023 18:44
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0)
- [github.com/psf/black: 23.9.1 → 23.10.1](psf/black@23.9.1...23.10.1)
- [github.com/keewis/blackdoc: v0.3.8 → v0.3.9](keewis/blackdoc@v0.3.8...v0.3.9)
- [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.1](pre-commit/mirrors-mypy@v1.5.1...v1.6.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…atree#275

* change default to_zarr mode to w-

* regression test

* add whats new entry
* keep attrs in map_over_subtree

* more intelligible logic

---------

Co-authored-by: Tom Nicholas <[email protected]>
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix import of xarray.testing internals that was changed by #8404

* bump minimum required version of xarray

* linting
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
updates:
- [github.com/PyCQA/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2)
- [github.com/psf/black: 23.10.1 → 23.12.1](psf/black@23.10.1...23.12.1)
- [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.8.0](pre-commit/mirrors-mypy@v1.6.1...v1.8.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Justus Magin <[email protected]>
…/datatree#285

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.10 to 1.8.11.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.8.10...v1.8.11)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justus Magin <[email protected]>
…rray-contrib/datatree#298

* Use napoleon instead of numpydoc, and fixes

* docs

* A mypy ignore for pre-commit run --all-files

* Updated whats-new.rst
typo found while reading the docs
…e#286

* Replace 'lineage' occurences in code by 'parents'

* Replace 'lineage' occurences in api.rst by 'parents'

* MyPy ignore

* whats-new

* Re-introduce lineage and deprecate it

* Added credit

* Added back lineage in api.rst

* Update datatree/tests/test_treenode.py

Co-authored-by: Tom Nicholas <[email protected]>

* Updated lineage and parents, broke tests

* Replaced slash by point, tests pass

* New PR

* Fix tests

* Remove iter_parents from api.rst

* Avoid entering into the more complex else branch

---------

Co-authored-by: Tom Nicholas <[email protected]>
* move from_dict to creation methods

* add section for pathlib-like interface

* add suggestions for missing pathlib-like api
…array-contrib/datatree#301

* Moves Tree Contents so that simpsons data tree in example is defined.

Also changes :py:meth => :py:class since it's a property not a method.

* Show result of datatree.match operation for clarity.

* fix typo wo => two

---------

Co-authored-by: Tom Nicholas <[email protected]>
@flamingbear flamingbear mentioned this pull request Jan 31, 2024
@flamingbear flamingbear force-pushed the mhs/third-times-a-charm/merge-datatree branch from 7c0c819 to c27f9db Compare January 31, 2024 15:37
@keewis
Copy link
Collaborator

keewis commented Jan 31, 2024

One tiny comment that I have is to put the PR numbers ((#8656, #8688)) at the end of the commit message, but I think I can do that just before doing the merge itself.

@pydata/xarray, can we temporarily freeze main until this is done? This shouldn't take more than an hour after the meeting.

@flamingbear flamingbear force-pushed the mhs/third-times-a-charm/merge-datatree branch from c27f9db to f4d9d87 Compare January 31, 2024 17:14
Skips datatree_ CI
Adds additional ignore to mypy
Adds additional ignore to doctests
Excludes xarray/datatree_ from all pre-commmit.ci
Adds MINIFEST.in to skip datatree_ packaging
@flamingbear flamingbear force-pushed the mhs/third-times-a-charm/merge-datatree branch from f4d9d87 to 4de10d4 Compare January 31, 2024 17:51
@keewis keewis merged commit 4de10d4 into pydata:main Jan 31, 2024
29 checks passed
Copy link

welcome bot commented Jan 31, 2024

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

@dcherian
Copy link
Contributor

Woot! Thanks everyone!

@flamingbear flamingbear deleted the mhs/third-times-a-charm/merge-datatree branch January 31, 2024 18:39
@flamingbear flamingbear mentioned this pull request Feb 12, 2024
4 tasks
@mathause
Copy link
Collaborator

mathause commented Mar 1, 2024

This makes git bisect very confusing - suddenly you get an empty folder (just a comment - nothing to do here)

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.