Skip to content
/ xarray Public
forked from pydata/xarray

Commit 4227b38

Browse files
committed
import the datatree code and history
2 parents e91ee89 + 94d60ca commit 4227b38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+9726
-0
lines changed

xarray/datatree_/.flake8

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[flake8]
2+
ignore =
3+
# whitespace before ':' - doesn't work well with black
4+
E203
5+
# module level import not at top of file
6+
E402
7+
# line too long - let black worry about that
8+
E501
9+
# do not assign a lambda expression, use a def
10+
E731
11+
# line break before binary operator
12+
W503
13+
exclude=
14+
.eggs
15+
doc

xarray/datatree_/.git_archival.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true)$
4+
ref-names: $Format:%D$
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
# Check for updates to GitHub Actions every weekday
11+
interval: "daily"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Feel free to remove check-list items aren't relevant to your change -->
2+
3+
- [ ] Closes #xxxx
4+
- [ ] Tests added
5+
- [ ] Passes `pre-commit run --all-files`
6+
- [ ] New functions/methods are listed in `api.rst`
7+
- [ ] Changes are summarized in `docs/source/whats-new.rst`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 0 * * *"
12+
13+
jobs:
14+
15+
test:
16+
name: ${{ matrix.python-version }}-build
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
shell: bash -l {0}
21+
strategy:
22+
matrix:
23+
python-version: ["3.9", "3.10", "3.11", "3.12"]
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Create conda environment
28+
uses: mamba-org/provision-with-micromamba@main
29+
with:
30+
cache-downloads: true
31+
micromamba-version: 'latest'
32+
environment-file: ci/environment.yml
33+
extra-specs: |
34+
python=${{ matrix.python-version }}
35+
36+
- name: Conda info
37+
run: conda info
38+
39+
- name: Install datatree
40+
run: |
41+
python -m pip install -e . --no-deps --force-reinstall
42+
43+
- name: Conda list
44+
run: conda list
45+
46+
- name: Running Tests
47+
run: |
48+
python -m pytest --cov=./ --cov-report=xml --verbose
49+
50+
- name: Upload code coverage to Codecov
51+
uses: codecov/[email protected]
52+
with:
53+
file: ./coverage.xml
54+
flags: unittests
55+
env_vars: OS,PYTHON
56+
name: codecov-umbrella
57+
fail_ci_if_error: false
58+
59+
60+
test-upstream:
61+
name: ${{ matrix.python-version }}-dev-build
62+
runs-on: ubuntu-latest
63+
defaults:
64+
run:
65+
shell: bash -l {0}
66+
strategy:
67+
matrix:
68+
python-version: ["3.9", "3.10", "3.11", "3.12"]
69+
steps:
70+
- uses: actions/checkout@v4
71+
72+
- name: Create conda environment
73+
uses: mamba-org/provision-with-micromamba@main
74+
with:
75+
cache-downloads: true
76+
micromamba-version: 'latest'
77+
environment-file: ci/environment.yml
78+
extra-specs: |
79+
python=${{ matrix.python-version }}
80+
81+
- name: Conda info
82+
run: conda info
83+
84+
- name: Install dev reqs
85+
run: |
86+
python -m pip install --no-deps --upgrade \
87+
git+https://github.com/pydata/xarray \
88+
git+https://github.com/Unidata/netcdf4-python
89+
90+
python -m pip install -e . --no-deps --force-reinstall
91+
92+
- name: Conda list
93+
run: conda list
94+
95+
- name: Running Tests
96+
run: |
97+
python -m pytest --verbose
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build distribution
2+
on:
3+
release:
4+
types:
5+
- published
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-artifacts:
19+
runs-on: ubuntu-latest
20+
if: github.repository == 'xarray-contrib/datatree'
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- uses: actions/setup-python@v5
26+
name: Install Python
27+
with:
28+
python-version: 3.9
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install build
34+
35+
- name: Build tarball and wheels
36+
run: |
37+
git clean -xdf
38+
git restore -SW .
39+
python -m build --sdist --wheel .
40+
41+
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: releases
45+
path: dist
46+
47+
test-built-dist:
48+
needs: build-artifacts
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/setup-python@v5
52+
name: Install Python
53+
with:
54+
python-version: '3.10'
55+
- uses: actions/download-artifact@v4
56+
with:
57+
name: releases
58+
path: dist
59+
- name: List contents of built dist
60+
run: |
61+
ls -ltrh
62+
ls -ltrh dist
63+
64+
- name: Verify the built dist/wheel is valid
65+
run: |
66+
python -m pip install --upgrade pip
67+
python -m pip install dist/xarray_datatree*.whl
68+
python -c "import datatree; print(datatree.__version__)"
69+
70+
upload-to-pypi:
71+
needs: test-built-dist
72+
if: github.event_name == 'release'
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/download-artifact@v4
76+
with:
77+
name: releases
78+
path: dist
79+
- name: Publish package to PyPI
80+
uses: pypa/[email protected]
81+
with:
82+
user: ${{ secrets.PYPI_USERNAME }}
83+
password: ${{ secrets.PYPI_PASSWORD }}
84+
verbose: true

xarray/datatree_/.gitignore

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
docs/source/generated
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
.python-version
87+
88+
# pipenv
89+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
91+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
92+
# install all needed dependencies.
93+
#Pipfile.lock
94+
95+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
96+
__pypackages__/
97+
98+
# Celery stuff
99+
celerybeat-schedule
100+
celerybeat.pid
101+
102+
# SageMath parsed files
103+
*.sage.py
104+
105+
# Environments
106+
.env
107+
.venv
108+
env/
109+
venv/
110+
ENV/
111+
env.bak/
112+
venv.bak/
113+
114+
# Spyder project settings
115+
.spyderproject
116+
.spyproject
117+
118+
# Rope project settings
119+
.ropeproject
120+
121+
# mkdocs documentation
122+
/site
123+
124+
# mypy
125+
.mypy_cache/
126+
.dmypy.json
127+
dmypy.json
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
# version
133+
_version.py
134+
135+
.vscode

0 commit comments

Comments
 (0)