diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a105fd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,136 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# dummy test product +tests/test_data/directories/input/ +tests/test_data/directories/output/ + +# 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 + +# 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/ + +# VS code +.vscode + +# Ruff +.ruff_cache diff --git a/src/zampy/__pycache__/__init__.cpython-310.pyc b/src/zampy/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 1dc2f91..0000000 Binary files a/src/zampy/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/src/zampy/datasets/dataset_protocol.py b/src/zampy/datasets/dataset_protocol.py index 3f1604f..b40046d 100644 --- a/src/zampy/datasets/dataset_protocol.py +++ b/src/zampy/datasets/dataset_protocol.py @@ -1,8 +1,8 @@ """Outline of the dataset protocol.""" from dataclasses import dataclass from pathlib import Path -from typing import Protocol from typing import List +from typing import Protocol from typing import Tuple import numpy as np import xarray as xr diff --git a/src/zampy/datasets/eth_canopy_height.py b/src/zampy/datasets/eth_canopy_height.py index 407f0b2..f75bd7c 100644 --- a/src/zampy/datasets/eth_canopy_height.py +++ b/src/zampy/datasets/eth_canopy_height.py @@ -56,10 +56,8 @@ def download( download_folder.mkdir(parents=True, exist_ok=True) for fname in tqdm( - download_files, - desc="Downloading canopy height files", - unit="files" - ): + download_files, desc="Downloading canopy height files", unit="files" + ): file = requests.get(self.data_url + fname) (download_folder / fname).open(mode="wb").write(file.content) return True @@ -70,12 +68,8 @@ def get_filenames(bounds: SpatialBounds) -> List[str]: step = 3 locs = np.meshgrid( - np.arange( - start=bounds.south, stop=bounds.north + step, step=step - ), - np.arange( - start=bounds.west, stop=bounds.east + step, step=step - ), + np.arange(start=bounds.south, stop=bounds.north + step, step=step), + np.arange(start=bounds.west, stop=bounds.east + step, step=step), ) lats = locs[0].flatten() lons = locs[1].flatten()