-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #8656
Datatree import #8656
Changes from all commits
a5a5428
478f193
b38e97e
6df675e
0cdcdab
448ead4
7c73ea9
51e89d3
f160cc2
4cd5e2d
fca03b1
5bcb5c0
d5035d8
e784f91
0c3ceab
4eed833
d765c99
5f0fe4e
d3bb49e
c531432
bbdd7fc
c1785e0
81af7d1
75511c7
afc29f5
2aea280
fe66ea7
60d38b7
494d16e
5cc4bb1
0be5907
f71c69b
bef183a
2de7650
79fef60
a9ed61d
4ad5485
997a218
fc4d0f9
02d2d29
360118e
c99dea4
21a3b3f
251fbc6
ca6830f
9727d3e
c5b23b7
18309f0
49cb5dc
f591be2
549d199
9afcd21
9f02a88
1d6d96b
0352ad4
bc9afde
e7ee7b7
ac39f0d
122735e
ae5b893
1888e91
e6dc4d8
86baba6
5f16828
1f81fd6
9af72aa
55d425c
dc1514b
13fe531
bd1d6dd
928fd95
dd75acc
a82542c
0a3c8d0
96b6b65
0892f5d
1d5e12e
0624408
370cd24
5b087d0
7cb892b
4658642
e985dab
76d8666
ca40321
c7bad48
7218164
dbd8f60
fb831ac
2479bc7
636957d
c1402a3
0a88621
8011829
7231e13
a1764a1
08988ca
205320d
3259821
6b4de29
7c99ed7
3b4e181
9637a2e
90c53d9
a1851c8
aefc0e0
f8f4efc
bc47b2d
380db26
e4df20a
d498a0c
18be084
95d9a8c
9ba6008
2f305ec
53a63bc
d2dd270
e94f4fc
7d59c36
40a6ca6
007ee5c
a267907
834c22b
064b88a
ace5455
6900b59
6123fb0
c5a6037
70f3c37
202e401
44c28d3
7fdbf5b
42dbefd
be79a04
fd55a11
4520332
26c14b4
7367474
dbe47a7
aa9eefd
c57214c
340e8a8
ac11883
1476a9a
672c4f2
885ccaf
34e6de8
03dc30f
20eb9d9
91bc86d
4de5306
6a7dae3
245bb8c
6dabe6d
77b7c5c
6441658
5247692
54d940f
8442193
e43d7ab
191de90
a1f4923
2baea0a
77d8c29
8521640
6e5be2a
34c0a01
6e419c4
ea91203
09025d1
968a84e
c97f016
8d6255a
5d4242d
5eec9cc
80ce2ee
c3d1a27
2b53788
18ccffe
81a24ef
31f74ab
f7546ab
99a212e
fd0938e
5522d90
06a336c
2b5c7d9
98a77d6
9986c5a
d954320
c3d5e7b
1899ad5
d257806
f0720ad
0b9bde5
f36203e
d783099
ac65afc
a783137
adfc354
b0f39cb
a655d42
f6b47b7
aed947f
9cd3ac2
f632523
6635691
2f2f0b9
d416fa1
1ab3ba0
dc4a283
a7881fa
60555c9
15672a2
8a64309
0477856
09023b0
002e7cb
944cd0f
02ec20b
333bfa8
52590cb
256ce55
cc4de87
20aa09a
12ca491
494ace1
6b778c4
ced8367
1ca8452
7cfb6b2
b40cad3
11995b0
804b3f7
a01cc36
a156da9
d030502
65a7d24
fca7fe4
25020f0
0315175
92a9c5d
e137a35
25e8eab
087400b
8eb2aa3
5eeef57
d9948e5
3599a14
3de55c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
prune xarray/datatree_* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[flake8] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed |
||
ignore = | ||
# whitespace before ':' - doesn't work well with black | ||
E203 | ||
# module level import not at top of file | ||
E402 | ||
# line too long - let black worry about that | ||
E501 | ||
# do not assign a lambda expression, use a def | ||
E731 | ||
# line break before binary operator | ||
W503 | ||
exclude= | ||
.eggs | ||
doc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node: $Format:%H$ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed |
||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true)$ | ||
ref-names: $Format:%D$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed |
||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every weekday | ||
interval: "daily" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- Feel free to remove check-list items aren't relevant to your change --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed |
||
|
||
- [ ] Closes #xxxx | ||
- [ ] Tests added | ||
- [ ] Passes `pre-commit run --all-files` | ||
- [ ] New functions/methods are listed in `api.rst` | ||
- [ ] Changes are summarized in `docs/source/whats-new.rst` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: CI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed. |
||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
|
||
test: | ||
name: ${{ matrix.python-version }}-build | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create conda environment | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
cache-downloads: true | ||
micromamba-version: 'latest' | ||
environment-file: ci/environment.yml | ||
extra-specs: | | ||
python=${{ matrix.python-version }} | ||
|
||
- name: Conda info | ||
run: conda info | ||
|
||
- name: Install datatree | ||
run: | | ||
python -m pip install -e . --no-deps --force-reinstall | ||
|
||
- name: Conda list | ||
run: conda list | ||
|
||
- name: Running Tests | ||
run: | | ||
python -m pytest --cov=./ --cov-report=xml --verbose | ||
|
||
- name: Upload code coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: false | ||
|
||
|
||
test-upstream: | ||
name: ${{ matrix.python-version }}-dev-build | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create conda environment | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
cache-downloads: true | ||
micromamba-version: 'latest' | ||
environment-file: ci/environment.yml | ||
extra-specs: | | ||
python=${{ matrix.python-version }} | ||
|
||
- name: Conda info | ||
run: conda info | ||
|
||
- name: Install dev reqs | ||
run: | | ||
python -m pip install --no-deps --upgrade \ | ||
git+https://github.com/pydata/xarray \ | ||
git+https://github.com/Unidata/netcdf4-python | ||
|
||
python -m pip install -e . --no-deps --force-reinstall | ||
|
||
- name: Conda list | ||
run: conda list | ||
|
||
- name: Running Tests | ||
run: | | ||
python -m pytest --verbose |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Build distribution | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed |
||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-artifacts: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'xarray-contrib/datatree' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v5 | ||
name: Install Python | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build | ||
|
||
- name: Build tarball and wheels | ||
run: | | ||
git clean -xdf | ||
git restore -SW . | ||
python -m build --sdist --wheel . | ||
|
||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: releases | ||
path: dist | ||
|
||
test-built-dist: | ||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
name: Install Python | ||
with: | ||
python-version: '3.10' | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: releases | ||
path: dist | ||
- name: List contents of built dist | ||
run: | | ||
ls -ltrh | ||
ls -ltrh dist | ||
|
||
- name: Verify the built dist/wheel is valid | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install dist/xarray_datatree*.whl | ||
python -c "import datatree; print(datatree.__version__)" | ||
|
||
upload-to-pypi: | ||
needs: test-built-dist | ||
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: releases | ||
path: dist | ||
- name: Publish package to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: ${{ secrets.PYPI_USERNAME }} | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
verbose: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Byte-compiled / optimized / DLL files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file can be removed |
||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
docs/source/generated | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# version | ||
_version.py | ||
|
||
# Ignore vscode specific settings | ||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What fails here?
Ideally we want to promote exclusions into the tools themselves — like we have for mypy — rather than in the pre-commit-config. Since editors will run many of these by default, and will only pick up on exclusions from the tools' configs...
Though if someone wants to own fixing the issues soon after merging, no need to slow down the initial merge...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff
is the one that fails. However,pre-commit
passes all (changed) files explicitly, so I'm not sure how easy it would be to exclude directly inruff
(we could add an additionalexclude
toruff
's config, though).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unable to generate an exclude for ruff's config only that actually seemed to be respected.
In this exclude block https://github.com/flamingbear/xarray/blob/datatree-import/pyproject.toml#L233
I tried variations on "xarray/datatree_.*", "xarray/datatree_", and "datatree_"
I'm open to suggestions.
edited: It may have been a conflict with
project.toml
. I'm looking again.