diff --git a/.github/workflows/ci_action.yml b/.github/workflows/ci_action.yml index 72379379f..c348e0430 100644 --- a/.github/workflows/ci_action.yml +++ b/.github/workflows/ci_action.yml @@ -51,26 +51,14 @@ jobs: # caching the entire environment is faster when cache exists but slower for cache creation - name: Install packages - run: | - pip install -r requirements-dev.txt --upgrade --upgrade-strategy eager - python install_all.py - pip install -r ml_tools/requirements-tdigest.txt + run: pip install .[DEV] --upgrade --upgrade-strategy eager - name: Run pylint - run: make pylint + run: pylint eolearn - name: Run mypy if: success() || failure() - run: | - mypy \ - core/eolearn/core \ - coregistration/eolearn/coregistration \ - geometry/eolearn/geometry \ - features/eolearn/features \ - io/eolearn/io \ - mask/eolearn/mask \ - ml_tools/eolearn/ml_tools \ - visualization/eolearn/visualization + run: mypy eolearn test-on-github: runs-on: ubuntu-latest @@ -95,19 +83,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - # cache: pip # uncomment when all requirements are in `pyproject.toml` + cache: pip - name: Install packages - if: matrix.python-version != '3.9' - run: | - pip install -r requirements-dev.txt --upgrade --upgrade-strategy eager - python install_all.py -e - - - name: Install zarr backend # this will run Zarr backend tests on 3.9 - if: matrix.python-version == '3.9' - run: | - pip install -r requirements-dev.txt -r core/requirements-zarr.txt --upgrade --upgrade-strategy eager - python install_all.py -e + run: pip install -e .[DEV] --upgrade --upgrade-strategy eager - name: Run full tests and code coverage if: ${{ matrix.full_test_suite }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f4f03215..71f367cc8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,6 @@ run_sh_integration_tests: - apt-get update - apt-get install -y build-essential libgdal-dev graphviz proj-bin gcc libproj-dev libspatialindex-dev script: - - pip install -r requirements-dev.txt --upgrade - - python install_all.py + - pip install eolearn[DEV] - sentinelhub.config --sh_client_id "$SH_CLIENT_ID" --sh_client_secret "$SH_CLIENT_SECRET" > /dev/null # Gitlab can't mask SH_CLIENT_SECRET in logs - pytest -m sh_integration diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3152f648..ee31fbec8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ For any question, feel free to contact us at [eoresearch@sinergise.com](eoresear We strive to provide high-quality working code, but bugs happen nevertheless. -When reporting a bug, please check [here][open-bug-list] whether the bug was already reported. If not, open an issue with the **bug** label and report the following information: +When reporting a bug, please check [the issue tracker][open-bug-list] whether the bug was already reported. If not, open an issue with the **bug** label and report the following information: * Issue description * How to reproduce the issue @@ -36,7 +36,7 @@ This information helps us to reproduce, pinpoint, and fix the reported issue. If ## Feature Requests -Existing feature requests can be found [here][existing-feature-requests]. +Existing feature requests can be found [in the issues][existing-feature-requests]. A new feature request can be created by opening a new issue with the **enhancement** label, and describing how the feature would benefit the **eo-learn** community. Providing an example use-case would help assessing the scope of the feature request. diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 07c61fc6f..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include requirements*.txt - -include README.md -include CREDITS.md -include LICENSE diff --git a/Makefile b/Makefile index 70e976d12..25520ee29 100644 --- a/Makefile +++ b/Makefile @@ -1,187 +1,21 @@ # Makefile for creating a new release of the package and uploading it to PyPI PYTHON = python3 -PACKAGES = core coregistration features geometry io mask ml_tools visualization -PYLINT = pylint .PHONY: $(PACKAGES:test) -.SILENT: pylint pylint-fast help: - @echo "Use 'make upload-' to upload the package to PyPi" - @echo "Use 'make pylint' to run pylint on the code of all subpackages" + @echo "Use 'make test-upload' to upload the package to testPyPi" + @echo "Use 'make upload' to upload the package to PyPi" -mypy: - mypy \ - core/eolearn/core \ - coregistration/eolearn/coregistration \ - geometry/eolearn/geometry \ - features/eolearn/features \ - io/eolearn/io \ - mask/eolearn/mask \ - ml_tools/eolearn/ml_tools \ - visualization/eolearn/visualization -pylint: - # Runs pylint on all subpackages consecutively and makes sure any error status code gets propagated. - export PYLINT_STATUS=0 - for package in $(PACKAGES) ; do \ - $(PYLINT) $$package/eolearn/$$package || export PYLINT_STATUS=$$?; \ - done; - exit $$PYLINT_STATUS - - -pylint-fast: - # Runs pylint on all subpackages in parallel. Because of that output verdicts are not in the order of package - # names and this process cannot be interrupted. - for package in $(PACKAGES) ; do \ - $(PYLINT) $$package/eolearn/$$package & \ - done; - wait - -.ONESHELL: -build-core: - cd core - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-coregistration: - cd coregistration - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-features: - cd features - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-geometry: - cd geometry - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-io: - cd io - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-mask: - cd mask - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-ml-tools: - cd ml_tools - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-visualization: - cd visualization - cp ../LICENSE LICENSE - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - rm LICENSE - -.ONESHELL: -build-abstract-package: - rm -r dist build | true - $(PYTHON) setup.py sdist bdist_wheel - -upload-core: build-core - twine upload core/dist/* - -upload-coregistration: build-coregistration - twine upload coregistration/dist/* - -upload-features: build-features - twine upload features/dist/* - -upload-geometry: build-geometry - twine upload geometry/dist/* - -upload-io: build-io - twine upload io/dist/* - -upload-mask: build-mask - twine upload mask/dist/* - -upload-ml-tools: build-ml-tools - twine upload ml_tools/dist/* - -upload-visualization: build-visualization - twine upload visualization/dist/* - -upload-abstract-package: build-abstract-package - twine upload dist/* - -upload-all: \ - upload-core \ - upload-coregistration \ - upload-features \ - upload-geometry \ - upload-io \ - upload-mask \ - upload-ml-tools \ - upload-visualization \ - upload-abstract-package +upload: + rm -r dist | true + python -m build --sdist --wheel + twine upload --skip-existing dist/* # For testing: - -test-upload-core: build-core - twine upload --repository testpypi core/dist/* - -test-upload-coregistration: build-coregistration - twine upload --repository testpypi coregistration/dist/* - -test-upload-features: build-features - twine upload --repository testpypi features/dist/* - -test-upload-geometry: build-geometry - twine upload --repository testpypi geometry/dist/* - -test-upload-io: build-io - twine upload --repository testpypi io/dist/* - -test-upload-mask: build-mask - twine upload --repository testpypi mask/dist/* - -test-upload-ml-tools: build-ml-tools - twine upload --repository testpypi ml_tools/dist/* - -test-upload-visualization: build-visualization - twine upload --repository testpypi visualization/dist/* - -test-upload-abstract-package: build-abstract-package - twine upload --repository testpypi dist/* - -test-upload-all: \ - test-upload-core \ - test-upload-coregistration \ - test-upload-features \ - test-upload-geometry \ - test-upload-io \ - test-upload-mask \ - test-upload-ml-tools \ - test-upload-visualization \ - test-upload-abstract-package +test-upload: + rm -r dist | true + python -m build --sdist --wheel + twine upload --repository testpypi --skip-existing dist/* diff --git a/README.md b/README.md index dab165af6..a9d9280ee 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Examples and introductions to the package can be found [here](https://github.com ## Contributions -The list of all `eo-learn` contributors can be found [here](./CONTRIBUTING.md). If you would like to contribute to `eo-learn`, please check our [contribution guidelines](./CONTRIBUTING.md). +The list of all `eo-learn` contributors are listed in the [credits file](./CREDITS.md). If you would like to contribute to `eo-learn`, please check our [contribution guidelines](./CONTRIBUTING.md). ## Blog posts and papers diff --git a/core/MANIFEST.in b/core/MANIFEST.in deleted file mode 100644 index 4b271965f..000000000 --- a/core/MANIFEST.in +++ /dev/null @@ -1,8 +0,0 @@ -include requirements*.txt -include LICENSE -include README.md -include eolearn/core/py.typed -exclude eolearn/tests/* -exclude eolearn/tests/test_extra/* -exclude eolearn/tests/test_utils/* -exclude eolearn/tests/stats/* diff --git a/core/eolearn/__init__.py b/core/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/core/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/coregistration/MANIFEST.in b/coregistration/MANIFEST.in deleted file mode 100644 index 7d9a0dcc1..000000000 --- a/coregistration/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include requirements*.txt -include LICENSE -include README.md -include eolearn/coregistration/py.typed -exclude eolearn/tests/* diff --git a/coregistration/eolearn/__init__.py b/coregistration/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/coregistration/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/coregistration/eolearn/coregistration/py.typed b/coregistration/eolearn/coregistration/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/eolearn.dockerfile b/docker/eolearn.dockerfile index c978c180f..50685d569 100644 --- a/docker/eolearn.dockerfile +++ b/docker/eolearn.dockerfile @@ -4,12 +4,12 @@ LABEL maintainer="Sinergise EO research team " LABEL description="An official eo-learn docker image with a full eo-learn installation and Jupyter notebook." RUN apt-get update && apt-get install -y \ - gcc \ - libgdal-dev \ - graphviz \ - proj-bin \ - libproj-dev \ - libspatialindex-dev \ + gcc \ + libgdal-dev \ + graphviz \ + proj-bin \ + libproj-dev \ + libspatialindex-dev \ && apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* ENV CPLUS_INCLUDE_PATH=/usr/include/gdal @@ -20,25 +20,10 @@ RUN pip3 install --no-cache-dir shapely --no-binary :all: WORKDIR /tmp -COPY core core -COPY coregistration coregistration -COPY features features -COPY geometry geometry -COPY io io -COPY mask mask -COPY ml_tools ml_tools -COPY visualization visualization -COPY setup.py README.md requirements-dev.txt ./ +COPY eolearn eolearn +COPY pyproject.toml README.md LICENSE ./ -RUN pip3 install --no-cache-dir \ - ./core[RAY] \ - ./coregistration \ - ./features \ - ./geometry \ - ./io[METEOBLUE] \ - ./mask \ - ./ml_tools \ - ./visualization +RUN pip3 install --no-cache-dir .[FULL] RUN pip3 install --no-cache-dir \ . \ @@ -56,4 +41,4 @@ WORKDIR /home/eolearner EXPOSE 8888 CMD ["/usr/local/bin/jupyter", "notebook", "--no-browser", "--port=8888", "--ip=0.0.0.0", \ - "--NotebookApp.token=''", "--allow-root"] + "--NotebookApp.token=''", "--allow-root"] diff --git a/docs/Makefile b/docs/Makefile index 0b88aba07..0227ea890 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -19,4 +19,4 @@ help: %: Makefile rm -rf ./build/ $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - rm -r source/examples source/markdowns source/reference source/eotasks.rst + # rm -r source/examples source/markdowns source/reference source/eotasks.rst diff --git a/docs/environment.yml b/docs/environment.yml index 8808b0b25..d7e3451e6 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -1,22 +1,15 @@ name: eo-learn-docs channels: -- conda-forge + - conda-forge dependencies: -- rasterio -- pip -- python=3.10 -- pip: - - Sphinx - - sphinx_rtd_theme - - nbsphinx - - jupyter - - sphinx_mdinclude + - rasterio + - pip + - python=3.10 + - pip: + - Sphinx + - sphinx_rtd_theme + - nbsphinx + - jupyter + - sphinx_mdinclude - - ./../core - - ./../coregistration - - ./../features - - ./../geometry - - ./../io[METEOBLUE] - - ./../mask - - ./../ml_tools[TDIGEST] - - ./../visualization + - ./../.[FULL] diff --git a/docs/source/conf.py b/docs/source/conf.py index 945afaf5b..99021a7cb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,7 +15,6 @@ import os import shutil import sys -from collections import defaultdict from typing import Any, Dict, Optional import sphinx.ext.autodoc @@ -43,11 +42,13 @@ # built documents. # # The release is read from __init__ file and version is shortened release string. -with open(os.path.join(os.path.dirname(__file__), "../../setup.py")) as setup_file: - for line in setup_file: - if "version=" in line: - release = line.split("=")[1].strip('", \n').strip("'") - version = release.rsplit(".", 1)[0] +with open(os.path.join(os.path.dirname(__file__), "../../eolearn/__init__.py")) as init_file: + for line in init_file: + if line.find("__version__") >= 0: + release = line.split("=")[1].strip() + release = release.strip('"').strip("'") + +version = release.rsplit(".", 1)[0] # -- General configuration --------------------------------------------------- @@ -221,9 +222,6 @@ # A list of files that should not be packed into the epub file. epub_exclude_files = ["search.html"] -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/3.8/": None} - # -- Custom settings ---------------------------------------------- @@ -356,10 +354,10 @@ def get_subclasses(cls): custom_reference_files = {filename.rsplit(".", 1)[0] for filename in os.listdir(custom_reference_dir)} repository_dir = os.path.join(current_dir, "..", "..") -modules = ["core", "coregistration", "features", "geometry", "io", "mask", "ml_tools", "visualization"] +module = "eolearn" APIDOC_OPTIONS = ["--module-first", "--separate", "--no-toc", "--templatedir", os.path.join(current_dir, "_templates")] -APIDOC_EXCLUDE = defaultdict(list, {"core": ["graph.py", "eodata_io.py", "eodata_merge.py"]}) +APIDOC_EXCLUDE = ["graph.py", "eodata_io.py", "eodata_merge.py"] shutil.rmtree(reference_dir, ignore_errors=True) shutil.copytree(custom_reference_dir, reference_dir) @@ -369,13 +367,9 @@ def run_apidoc(_): from sphinx.ext.apidoc import main sys.path.append(os.path.join(os.path.dirname(__file__), "..")) - for module in modules: - module_dir = os.path.join(current_dir, "..", "..", module) - - exclude = [os.path.join(module_dir, "eolearn", module, filename) for filename in APIDOC_EXCLUDE[module]] - exclude.extend([os.path.join(module_dir, "setup.py"), os.path.join(module_dir, "eolearn", "tests")]) - - main(["-e", "-o", reference_dir, module_dir, *exclude, *APIDOC_OPTIONS]) + module_dir = os.path.join(current_dir, "..", "..", module) + exclude = [os.path.join(module_dir, "core", filename) for filename in APIDOC_EXCLUDE] + main(["-e", "-o", reference_dir, module_dir, *exclude, *APIDOC_OPTIONS]) def configure_github_link(_app: Any, pagename: str, _templatename: Any, context: Dict[str, Any], _doctree: Any) -> None: diff --git a/eolearn/__init__.py b/eolearn/__init__.py new file mode 100644 index 000000000..0f4393e52 --- /dev/null +++ b/eolearn/__init__.py @@ -0,0 +1,2 @@ +"""Main module of the `eolearn` package.""" +__version__ = "1.4.2" diff --git a/core/eolearn/core/__init__.py b/eolearn/core/__init__.py similarity index 100% rename from core/eolearn/core/__init__.py rename to eolearn/core/__init__.py diff --git a/core/eolearn/core/constants.py b/eolearn/core/constants.py similarity index 100% rename from core/eolearn/core/constants.py rename to eolearn/core/constants.py diff --git a/core/eolearn/core/core_tasks.py b/eolearn/core/core_tasks.py similarity index 100% rename from core/eolearn/core/core_tasks.py rename to eolearn/core/core_tasks.py diff --git a/core/eolearn/core/eodata.py b/eolearn/core/eodata.py similarity index 100% rename from core/eolearn/core/eodata.py rename to eolearn/core/eodata.py diff --git a/core/eolearn/core/eodata_io.py b/eolearn/core/eodata_io.py similarity index 100% rename from core/eolearn/core/eodata_io.py rename to eolearn/core/eodata_io.py diff --git a/core/eolearn/core/eodata_merge.py b/eolearn/core/eodata_merge.py similarity index 100% rename from core/eolearn/core/eodata_merge.py rename to eolearn/core/eodata_merge.py diff --git a/core/eolearn/core/eoexecution.py b/eolearn/core/eoexecution.py similarity index 100% rename from core/eolearn/core/eoexecution.py rename to eolearn/core/eoexecution.py diff --git a/core/eolearn/core/eonode.py b/eolearn/core/eonode.py similarity index 100% rename from core/eolearn/core/eonode.py rename to eolearn/core/eonode.py diff --git a/core/eolearn/core/eotask.py b/eolearn/core/eotask.py similarity index 100% rename from core/eolearn/core/eotask.py rename to eolearn/core/eotask.py diff --git a/core/eolearn/core/eoworkflow.py b/eolearn/core/eoworkflow.py similarity index 100% rename from core/eolearn/core/eoworkflow.py rename to eolearn/core/eoworkflow.py diff --git a/core/eolearn/core/eoworkflow_tasks.py b/eolearn/core/eoworkflow_tasks.py similarity index 100% rename from core/eolearn/core/eoworkflow_tasks.py rename to eolearn/core/eoworkflow_tasks.py diff --git a/core/eolearn/core/exceptions.py b/eolearn/core/exceptions.py similarity index 100% rename from core/eolearn/core/exceptions.py rename to eolearn/core/exceptions.py diff --git a/core/eolearn/core/extra/__init__.py b/eolearn/core/extra/__init__.py similarity index 100% rename from core/eolearn/core/extra/__init__.py rename to eolearn/core/extra/__init__.py diff --git a/core/eolearn/core/extra/ray.py b/eolearn/core/extra/ray.py similarity index 100% rename from core/eolearn/core/extra/ray.py rename to eolearn/core/extra/ray.py diff --git a/core/eolearn/core/graph.py b/eolearn/core/graph.py similarity index 100% rename from core/eolearn/core/graph.py rename to eolearn/core/graph.py diff --git a/core/eolearn/core/types.py b/eolearn/core/types.py similarity index 100% rename from core/eolearn/core/types.py rename to eolearn/core/types.py diff --git a/core/eolearn/core/utils/__init__.py b/eolearn/core/utils/__init__.py similarity index 100% rename from core/eolearn/core/utils/__init__.py rename to eolearn/core/utils/__init__.py diff --git a/core/eolearn/core/utils/common.py b/eolearn/core/utils/common.py similarity index 100% rename from core/eolearn/core/utils/common.py rename to eolearn/core/utils/common.py diff --git a/core/eolearn/core/utils/fs.py b/eolearn/core/utils/fs.py similarity index 100% rename from core/eolearn/core/utils/fs.py rename to eolearn/core/utils/fs.py diff --git a/core/eolearn/core/utils/logging.py b/eolearn/core/utils/logging.py similarity index 100% rename from core/eolearn/core/utils/logging.py rename to eolearn/core/utils/logging.py diff --git a/core/eolearn/core/utils/parallelize.py b/eolearn/core/utils/parallelize.py similarity index 100% rename from core/eolearn/core/utils/parallelize.py rename to eolearn/core/utils/parallelize.py diff --git a/core/eolearn/core/utils/parsing.py b/eolearn/core/utils/parsing.py similarity index 100% rename from core/eolearn/core/utils/parsing.py rename to eolearn/core/utils/parsing.py diff --git a/core/eolearn/core/utils/raster.py b/eolearn/core/utils/raster.py similarity index 100% rename from core/eolearn/core/utils/raster.py rename to eolearn/core/utils/raster.py diff --git a/core/eolearn/core/utils/testing.py b/eolearn/core/utils/testing.py similarity index 100% rename from core/eolearn/core/utils/testing.py rename to eolearn/core/utils/testing.py diff --git a/core/eolearn/core/utils/types.py b/eolearn/core/utils/types.py similarity index 100% rename from core/eolearn/core/utils/types.py rename to eolearn/core/utils/types.py diff --git a/coregistration/eolearn/coregistration/__init__.py b/eolearn/coregistration/__init__.py similarity index 100% rename from coregistration/eolearn/coregistration/__init__.py rename to eolearn/coregistration/__init__.py diff --git a/coregistration/eolearn/coregistration/coregistration.py b/eolearn/coregistration/coregistration.py similarity index 100% rename from coregistration/eolearn/coregistration/coregistration.py rename to eolearn/coregistration/coregistration.py diff --git a/features/eolearn/features/__init__.py b/eolearn/features/__init__.py similarity index 100% rename from features/eolearn/features/__init__.py rename to eolearn/features/__init__.py diff --git a/features/eolearn/features/bands_extraction.py b/eolearn/features/bands_extraction.py similarity index 100% rename from features/eolearn/features/bands_extraction.py rename to eolearn/features/bands_extraction.py diff --git a/features/eolearn/features/blob.py b/eolearn/features/blob.py similarity index 100% rename from features/eolearn/features/blob.py rename to eolearn/features/blob.py diff --git a/features/eolearn/features/clustering.py b/eolearn/features/clustering.py similarity index 100% rename from features/eolearn/features/clustering.py rename to eolearn/features/clustering.py diff --git a/features/eolearn/features/doubly_logistic_approximation.py b/eolearn/features/doubly_logistic_approximation.py similarity index 100% rename from features/eolearn/features/doubly_logistic_approximation.py rename to eolearn/features/doubly_logistic_approximation.py diff --git a/features/eolearn/features/feature_manipulation.py b/eolearn/features/feature_manipulation.py similarity index 100% rename from features/eolearn/features/feature_manipulation.py rename to eolearn/features/feature_manipulation.py diff --git a/features/eolearn/features/haralick.py b/eolearn/features/haralick.py similarity index 100% rename from features/eolearn/features/haralick.py rename to eolearn/features/haralick.py diff --git a/features/eolearn/features/hog.py b/eolearn/features/hog.py similarity index 100% rename from features/eolearn/features/hog.py rename to eolearn/features/hog.py diff --git a/features/eolearn/features/interpolation.py b/eolearn/features/interpolation.py similarity index 100% rename from features/eolearn/features/interpolation.py rename to eolearn/features/interpolation.py diff --git a/features/eolearn/features/local_binary_pattern.py b/eolearn/features/local_binary_pattern.py similarity index 100% rename from features/eolearn/features/local_binary_pattern.py rename to eolearn/features/local_binary_pattern.py diff --git a/features/eolearn/features/radiometric_normalization.py b/eolearn/features/radiometric_normalization.py similarity index 100% rename from features/eolearn/features/radiometric_normalization.py rename to eolearn/features/radiometric_normalization.py diff --git a/features/eolearn/features/temporal_features.py b/eolearn/features/temporal_features.py similarity index 100% rename from features/eolearn/features/temporal_features.py rename to eolearn/features/temporal_features.py diff --git a/features/eolearn/features/utils.py b/eolearn/features/utils.py similarity index 100% rename from features/eolearn/features/utils.py rename to eolearn/features/utils.py diff --git a/geometry/eolearn/geometry/__init__.py b/eolearn/geometry/__init__.py similarity index 100% rename from geometry/eolearn/geometry/__init__.py rename to eolearn/geometry/__init__.py diff --git a/geometry/eolearn/geometry/morphology.py b/eolearn/geometry/morphology.py similarity index 100% rename from geometry/eolearn/geometry/morphology.py rename to eolearn/geometry/morphology.py diff --git a/geometry/eolearn/geometry/superpixel.py b/eolearn/geometry/superpixel.py similarity index 100% rename from geometry/eolearn/geometry/superpixel.py rename to eolearn/geometry/superpixel.py diff --git a/geometry/eolearn/geometry/transformations.py b/eolearn/geometry/transformations.py similarity index 100% rename from geometry/eolearn/geometry/transformations.py rename to eolearn/geometry/transformations.py diff --git a/io/eolearn/io/__init__.py b/eolearn/io/__init__.py similarity index 100% rename from io/eolearn/io/__init__.py rename to eolearn/io/__init__.py diff --git a/io/eolearn/io/extra/__init__.py b/eolearn/io/extra/__init__.py similarity index 100% rename from io/eolearn/io/extra/__init__.py rename to eolearn/io/extra/__init__.py diff --git a/io/eolearn/io/extra/geodb.py b/eolearn/io/extra/geodb.py similarity index 100% rename from io/eolearn/io/extra/geodb.py rename to eolearn/io/extra/geodb.py diff --git a/io/eolearn/io/extra/meteoblue.py b/eolearn/io/extra/meteoblue.py similarity index 100% rename from io/eolearn/io/extra/meteoblue.py rename to eolearn/io/extra/meteoblue.py diff --git a/io/eolearn/io/geometry_io.py b/eolearn/io/geometry_io.py similarity index 100% rename from io/eolearn/io/geometry_io.py rename to eolearn/io/geometry_io.py diff --git a/io/eolearn/io/geopedia.py b/eolearn/io/geopedia.py similarity index 100% rename from io/eolearn/io/geopedia.py rename to eolearn/io/geopedia.py diff --git a/io/eolearn/io/raster_io.py b/eolearn/io/raster_io.py similarity index 100% rename from io/eolearn/io/raster_io.py rename to eolearn/io/raster_io.py diff --git a/io/eolearn/io/sentinelhub_process.py b/eolearn/io/sentinelhub_process.py similarity index 100% rename from io/eolearn/io/sentinelhub_process.py rename to eolearn/io/sentinelhub_process.py diff --git a/mask/eolearn/mask/__init__.py b/eolearn/mask/__init__.py similarity index 100% rename from mask/eolearn/mask/__init__.py rename to eolearn/mask/__init__.py diff --git a/mask/eolearn/mask/cloud_mask.py b/eolearn/mask/cloud_mask.py similarity index 100% rename from mask/eolearn/mask/cloud_mask.py rename to eolearn/mask/cloud_mask.py diff --git a/mask/eolearn/mask/mask_counting.py b/eolearn/mask/mask_counting.py similarity index 100% rename from mask/eolearn/mask/mask_counting.py rename to eolearn/mask/mask_counting.py diff --git a/mask/eolearn/mask/masking.py b/eolearn/mask/masking.py similarity index 100% rename from mask/eolearn/mask/masking.py rename to eolearn/mask/masking.py diff --git a/mask/eolearn/mask/models/pixel_s2_cloud_detector_lightGBM_v0.2.txt b/eolearn/mask/models/pixel_s2_cloud_detector_lightGBM_v0.2.txt similarity index 100% rename from mask/eolearn/mask/models/pixel_s2_cloud_detector_lightGBM_v0.2.txt rename to eolearn/mask/models/pixel_s2_cloud_detector_lightGBM_v0.2.txt diff --git a/mask/eolearn/mask/models/ssim_s2_cloud_detector_lightGBM_v0.2.txt b/eolearn/mask/models/ssim_s2_cloud_detector_lightGBM_v0.2.txt similarity index 100% rename from mask/eolearn/mask/models/ssim_s2_cloud_detector_lightGBM_v0.2.txt rename to eolearn/mask/models/ssim_s2_cloud_detector_lightGBM_v0.2.txt diff --git a/mask/eolearn/mask/snow_mask.py b/eolearn/mask/snow_mask.py similarity index 100% rename from mask/eolearn/mask/snow_mask.py rename to eolearn/mask/snow_mask.py diff --git a/mask/eolearn/mask/utils.py b/eolearn/mask/utils.py similarity index 100% rename from mask/eolearn/mask/utils.py rename to eolearn/mask/utils.py diff --git a/ml_tools/eolearn/ml_tools/__init__.py b/eolearn/ml_tools/__init__.py similarity index 100% rename from ml_tools/eolearn/ml_tools/__init__.py rename to eolearn/ml_tools/__init__.py diff --git a/ml_tools/eolearn/ml_tools/extra/__init__.py b/eolearn/ml_tools/extra/__init__.py similarity index 100% rename from ml_tools/eolearn/ml_tools/extra/__init__.py rename to eolearn/ml_tools/extra/__init__.py diff --git a/ml_tools/eolearn/ml_tools/extra/plotting.py b/eolearn/ml_tools/extra/plotting.py similarity index 100% rename from ml_tools/eolearn/ml_tools/extra/plotting.py rename to eolearn/ml_tools/extra/plotting.py diff --git a/ml_tools/eolearn/ml_tools/sampling.py b/eolearn/ml_tools/sampling.py similarity index 100% rename from ml_tools/eolearn/ml_tools/sampling.py rename to eolearn/ml_tools/sampling.py diff --git a/ml_tools/eolearn/ml_tools/tdigest.py b/eolearn/ml_tools/tdigest.py similarity index 100% rename from ml_tools/eolearn/ml_tools/tdigest.py rename to eolearn/ml_tools/tdigest.py diff --git a/ml_tools/eolearn/ml_tools/train_test_split.py b/eolearn/ml_tools/train_test_split.py similarity index 100% rename from ml_tools/eolearn/ml_tools/train_test_split.py rename to eolearn/ml_tools/train_test_split.py diff --git a/ml_tools/eolearn/ml_tools/utils.py b/eolearn/ml_tools/utils.py similarity index 100% rename from ml_tools/eolearn/ml_tools/utils.py rename to eolearn/ml_tools/utils.py diff --git a/core/eolearn/core/py.typed b/eolearn/py.typed similarity index 100% rename from core/eolearn/core/py.typed rename to eolearn/py.typed diff --git a/visualization/eolearn/visualization/__init__.py b/eolearn/visualization/__init__.py similarity index 100% rename from visualization/eolearn/visualization/__init__.py rename to eolearn/visualization/__init__.py diff --git a/visualization/eolearn/visualization/eoexecutor.py b/eolearn/visualization/eoexecutor.py similarity index 100% rename from visualization/eolearn/visualization/eoexecutor.py rename to eolearn/visualization/eoexecutor.py diff --git a/visualization/eolearn/visualization/eopatch.py b/eolearn/visualization/eopatch.py similarity index 100% rename from visualization/eolearn/visualization/eopatch.py rename to eolearn/visualization/eopatch.py diff --git a/visualization/eolearn/visualization/eoworkflow.py b/eolearn/visualization/eoworkflow.py similarity index 100% rename from visualization/eolearn/visualization/eoworkflow.py rename to eolearn/visualization/eoworkflow.py diff --git a/visualization/eolearn/visualization/report_templates/report.html b/eolearn/visualization/report_templates/report.html similarity index 100% rename from visualization/eolearn/visualization/report_templates/report.html rename to eolearn/visualization/report_templates/report.html diff --git a/features/MANIFEST.in b/features/MANIFEST.in deleted file mode 100644 index 9f43ca148..000000000 --- a/features/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include requirements*.txt -include LICENSE -include README.md -include eolearn/features/py.typed -exclude eolearn/tests/* diff --git a/features/eolearn/__init__.py b/features/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/features/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/features/eolearn/features/py.typed b/features/eolearn/features/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/geometry/MANIFEST.in b/geometry/MANIFEST.in deleted file mode 100644 index b7faef195..000000000 --- a/geometry/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include requirements*.txt -include LICENSE -include README.md -include eolearn/geometry/py.typed -exclude eolearn/tests/* diff --git a/geometry/eolearn/__init__.py b/geometry/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/geometry/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/geometry/eolearn/geometry/py.typed b/geometry/eolearn/geometry/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/install_all.py b/install_all.py index 2ead69bfa..90ac76ad4 100644 --- a/install_all.py +++ b/install_all.py @@ -10,24 +10,11 @@ import subprocess import sys - -SUBPACKAGE_LIST = [ - "core", - "coregistration", - "features", - "geometry", - "io[METEOBLUE]", - "mask", - "ml_tools", - "visualization", -] - - -def pip_command(name, args): - args = [arg for arg in args if not arg.startswith(".")] - subprocess.check_call([sys.executable, "-m", "pip", "install", *args, f"./{name}"]) - +import warnings if __name__ == "__main__": - for subpackage in SUBPACKAGE_LIST: - pip_command(subpackage, sys.argv[1:]) + subprocess.check_call([sys.executable, "-m", "pip", "install", *sys.argv[1:], ".[ALL]"]) + warnings.warn( + "Installing via `install_all.py` is no longer necessary and has been deprecated. Use `pip install" + " eo-learn[ALL]` instead." + ) diff --git a/io/MANIFEST.in b/io/MANIFEST.in deleted file mode 100644 index 7802b675f..000000000 --- a/io/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include requirements*.txt -include LICENSE -include README.md -include eolearn/io/py.typed -exclude eolearn/tests/* -exclude eolearn/tests/test_extra/* -exclude eolearn/tests/TestInputs/* diff --git a/io/eolearn/__init__.py b/io/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/io/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/io/eolearn/io/py.typed b/io/eolearn/io/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/mask/MANIFEST.in b/mask/MANIFEST.in deleted file mode 100644 index dad260ce5..000000000 --- a/mask/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include requirements*.txt -include eolearn/mask/models/* -include LICENSE -include README.md -include eolearn/mask/py.typed -exclude eolearn/tests/* diff --git a/mask/eolearn/__init__.py b/mask/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/mask/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/mask/eolearn/mask/py.typed b/mask/eolearn/mask/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/ml_tools/eolearn/__init__.py b/ml_tools/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/ml_tools/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/ml_tools/eolearn/ml_tools/py.typed b/ml_tools/eolearn/ml_tools/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/pyproject.toml b/pyproject.toml index 2534c18dd..6d2b38df3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,120 @@ +[build-system] +requires = ['hatchling'] +build-backend = 'hatchling.build' + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.version] +path = 'eolearn/__init__.py' + +[tool.hatch.build.targets.sdist] +include = ['/README.md', '/LICENSE.md', '/eolearn'] + +[tool.hatch.build.targets.wheel] +include = ['/eolearn'] + +[project] +name = "eo-learn" +dynamic = ["version"] +description = "Earth observation processing framework for machine learning in Python" +readme = "README.md" +requires-python = ">= 3.8" +license = { file = "LICENSE" } +authors = [ + { name = "Sinergise EO research team", email = "eoresearch@sinergise.com" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: GIS", + "Topic :: Scientific/Engineering :: Image Processing", +] +dependencies = [ + "boto3", + "fs", + "fs-s3fs", + "geopandas>=0.11.0", + "numpy>=1.20.0", + "python-dateutil", + "sentinelhub>=3.9.0", + "tqdm>=4.27", + "typing-extensions", +] + +[project.optional-dependencies] +all = [ + "eo-learn[COREGISTRATION,FEATURES,GEOMETRY,IO,MASK,MLTOOLS,VISUALIZATION]", +] +full = ["eo-learn[ALL,RAY,ZARR,METEOBLUE,TDIGEST]"] +ray = ["ray[default]"] +zarr = ["s3fs", "zarr"] +coregistration = [ + "opencv-python-headless", +] # using headless version of opencv, otherwise gitlab runners fail +features = [ + "numba>=0.53.0", + "pillow>=9.1.0", + "scikit-image>=0.19.0", + "scikit-learn", + "scipy", +] +geometry = ["rasterio>=1.2.7", "scikit-image>=0.15.0", "shapely"] +io = ["affine", "fiona>=1.8.18", "rasterio>=1.2.7"] +geodb = [ + "python-dotenv", + "xcube-geodb @ git+git://github.com/dcs4cop/xcube-geodb.git", +] +meteoblue = ["meteoblue_dataset_sdk>=1,<2"] +mask = ["lightgbm>=2.0.11, <4", "opencv-python-headless", "scikit-image>=0.13.0"] +mltools = ["shapely"] +tdigest = ["tdigest==0.5.2.2"] +mltoolsplotting = ["matplotlib"] +visualization = ["graphviz>=0.10.1", "jinja2", "matplotlib", "pygments"] +docs = [ + "eo-learn[ALL]", + "jupyter", + "nbsphinx", + "sphinx", + "sphinx_mdinclude", + "sphinx_rtd_theme", +] +dev = [ + "build", + "eo-learn[FULL]", + "hypothesis", + "moto", + "mypy>=0.990", + "pylint>=2.14.0", + "pytest>=7.0.0", + "pytest-cov", + "pytest-lazy-fixture", + "pytest-mock", + "twine", + "types-python-dateutil", +] + +[project.urls] +Homepage = "https://github.com/sentinel-hub/eo-learn" +Documentation = "https://eo-learn.readthedocs.io" +Issues = "https://github.com/sentinel-hub/eo-learn/issues" +Source = "https://github.com/sentinel-hub/eo-learn" +Forum = "https://forum.sentinel-hub.com" + + [tool.black] line-length = 120 preview = true @@ -89,6 +206,7 @@ disable = [ "unspecified-encoding", "unnecessary-ellipsis", "use-dict-literal", + "cyclic-import", ] [tool.pylint.design] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 928639c88..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,11 +0,0 @@ -hypothesis -moto -mypy>=0.990 -pylint>=2.14.0 -pytest>=7.0.0 -pytest-cov -pytest-lazy-fixture -pytest-mock -ray[default] -twine -types-python-dateutil diff --git a/requirements-docs.txt b/requirements-docs.txt deleted file mode 100644 index 8066f501b..000000000 --- a/requirements-docs.txt +++ /dev/null @@ -1,14 +0,0 @@ - --e ./core --e ./coregistration --e ./features --e ./geometry --e ./io --e ./mask --e ./ml_tools --e ./visualization -jupyter -nbsphinx -sphinx -sphinx_mdinclude -sphinx_rtd_theme diff --git a/setup.py b/setup.py deleted file mode 100644 index a7b77d8f7..000000000 --- a/setup.py +++ /dev/null @@ -1,73 +0,0 @@ -from __future__ import annotations - -import os - -from setuptools import setup - - -def get_long_description(): - this_directory = os.path.abspath(os.path.dirname(__file__)) - - with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f: - long_description = f.read() - - # Removes lines with an image from description - return "\n".join(line for line in long_description.split("\n") if not line.strip().startswith(" str: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data", "TestEOPatch") + return os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data", "TestEOPatch") @pytest.fixture(name="test_eopatch") diff --git a/core/eolearn/tests/stats/test_save_stats.pkl b/tests/core/stats/test_save_stats.pkl similarity index 100% rename from core/eolearn/tests/stats/test_save_stats.pkl rename to tests/core/stats/test_save_stats.pkl diff --git a/core/eolearn/tests/test_constants.py b/tests/core/test_constants.py similarity index 100% rename from core/eolearn/tests/test_constants.py rename to tests/core/test_constants.py diff --git a/core/eolearn/tests/test_core_tasks.py b/tests/core/test_core_tasks.py similarity index 100% rename from core/eolearn/tests/test_core_tasks.py rename to tests/core/test_core_tasks.py diff --git a/core/eolearn/tests/test_eodata.py b/tests/core/test_eodata.py similarity index 100% rename from core/eolearn/tests/test_eodata.py rename to tests/core/test_eodata.py diff --git a/core/eolearn/tests/test_eodata_io.py b/tests/core/test_eodata_io.py similarity index 100% rename from core/eolearn/tests/test_eodata_io.py rename to tests/core/test_eodata_io.py diff --git a/core/eolearn/tests/test_eodata_merge.py b/tests/core/test_eodata_merge.py similarity index 100% rename from core/eolearn/tests/test_eodata_merge.py rename to tests/core/test_eodata_merge.py diff --git a/core/eolearn/tests/test_eoexecutor.py b/tests/core/test_eoexecutor.py similarity index 100% rename from core/eolearn/tests/test_eoexecutor.py rename to tests/core/test_eoexecutor.py diff --git a/core/eolearn/tests/test_eonode.py b/tests/core/test_eonode.py similarity index 100% rename from core/eolearn/tests/test_eonode.py rename to tests/core/test_eonode.py diff --git a/core/eolearn/tests/test_eotask.py b/tests/core/test_eotask.py similarity index 100% rename from core/eolearn/tests/test_eotask.py rename to tests/core/test_eotask.py diff --git a/core/eolearn/tests/test_eoworkflow.py b/tests/core/test_eoworkflow.py similarity index 100% rename from core/eolearn/tests/test_eoworkflow.py rename to tests/core/test_eoworkflow.py diff --git a/core/eolearn/tests/test_eoworkflow_tasks.py b/tests/core/test_eoworkflow_tasks.py similarity index 100% rename from core/eolearn/tests/test_eoworkflow_tasks.py rename to tests/core/test_eoworkflow_tasks.py diff --git a/tests/core/test_extra/__init__.py b/tests/core/test_extra/__init__.py new file mode 100644 index 000000000..cda745988 --- /dev/null +++ b/tests/core/test_extra/__init__.py @@ -0,0 +1 @@ +# Required for Ray tests diff --git a/core/eolearn/tests/test_extra/test_ray.py b/tests/core/test_extra/test_ray.py similarity index 100% rename from core/eolearn/tests/test_extra/test_ray.py rename to tests/core/test_extra/test_ray.py diff --git a/core/eolearn/tests/test_graph.py b/tests/core/test_graph.py similarity index 100% rename from core/eolearn/tests/test_graph.py rename to tests/core/test_graph.py diff --git a/core/eolearn/tests/test_utils/test_common.py b/tests/core/test_utils/test_common.py similarity index 100% rename from core/eolearn/tests/test_utils/test_common.py rename to tests/core/test_utils/test_common.py diff --git a/core/eolearn/tests/test_utils/test_fs.py b/tests/core/test_utils/test_fs.py similarity index 100% rename from core/eolearn/tests/test_utils/test_fs.py rename to tests/core/test_utils/test_fs.py diff --git a/core/eolearn/tests/test_utils/test_parallelize.py b/tests/core/test_utils/test_parallelize.py similarity index 100% rename from core/eolearn/tests/test_utils/test_parallelize.py rename to tests/core/test_utils/test_parallelize.py diff --git a/core/eolearn/tests/test_utils/test_parsing.py b/tests/core/test_utils/test_parsing.py similarity index 100% rename from core/eolearn/tests/test_utils/test_parsing.py rename to tests/core/test_utils/test_parsing.py diff --git a/core/eolearn/tests/test_utils/test_raster.py b/tests/core/test_utils/test_raster.py similarity index 100% rename from core/eolearn/tests/test_utils/test_raster.py rename to tests/core/test_utils/test_raster.py diff --git a/core/eolearn/tests/test_utils/test_testing.py b/tests/core/test_utils/test_testing.py similarity index 100% rename from core/eolearn/tests/test_utils/test_testing.py rename to tests/core/test_utils/test_testing.py diff --git a/coregistration/eolearn/tests/conftest.py b/tests/coregistration/conftest.py similarity index 94% rename from coregistration/eolearn/tests/conftest.py rename to tests/coregistration/conftest.py index 12bd0b889..b40eff87a 100644 --- a/coregistration/eolearn/tests/conftest.py +++ b/tests/coregistration/conftest.py @@ -16,7 +16,7 @@ pytest.register_assert_rewrite("sentinelhub.testing_utils") # makes asserts in helper functions work with pytest -EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data") +EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data") EXAMPLE_EOPATCH_PATH = os.path.join(EXAMPLE_DATA_PATH, "TestEOPatch") diff --git a/coregistration/eolearn/tests/test_coregistration.py b/tests/coregistration/test_coregistration.py similarity index 100% rename from coregistration/eolearn/tests/test_coregistration.py rename to tests/coregistration/test_coregistration.py diff --git a/features/eolearn/tests/conftest.py b/tests/features/conftest.py similarity index 92% rename from features/eolearn/tests/conftest.py rename to tests/features/conftest.py index a45f6f31a..77c533c41 100644 --- a/features/eolearn/tests/conftest.py +++ b/tests/features/conftest.py @@ -20,12 +20,12 @@ @pytest.fixture(scope="session", name="example_data_path") def example_data_path_fixture() -> str: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data") + return os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data") @pytest.fixture(name="example_eopatch") def example_eopatch_fixture(): - path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data", "TestEOPatch") + path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data", "TestEOPatch") return EOPatch.load(path, lazy_loading=True) diff --git a/features/eolearn/tests/test_bands_extraction.py b/tests/features/test_bands_extraction.py similarity index 100% rename from features/eolearn/tests/test_bands_extraction.py rename to tests/features/test_bands_extraction.py diff --git a/features/eolearn/tests/test_blob.py b/tests/features/test_blob.py similarity index 100% rename from features/eolearn/tests/test_blob.py rename to tests/features/test_blob.py diff --git a/features/eolearn/tests/test_clustering.py b/tests/features/test_clustering.py similarity index 100% rename from features/eolearn/tests/test_clustering.py rename to tests/features/test_clustering.py diff --git a/features/eolearn/tests/test_doubly_logistic_approximation.py b/tests/features/test_doubly_logistic_approximation.py similarity index 100% rename from features/eolearn/tests/test_doubly_logistic_approximation.py rename to tests/features/test_doubly_logistic_approximation.py diff --git a/features/eolearn/tests/test_feature_manipulation.py b/tests/features/test_feature_manipulation.py similarity index 100% rename from features/eolearn/tests/test_feature_manipulation.py rename to tests/features/test_feature_manipulation.py diff --git a/features/eolearn/tests/test_features_utils.py b/tests/features/test_features_utils.py similarity index 100% rename from features/eolearn/tests/test_features_utils.py rename to tests/features/test_features_utils.py diff --git a/features/eolearn/tests/test_haralick.py b/tests/features/test_haralick.py similarity index 100% rename from features/eolearn/tests/test_haralick.py rename to tests/features/test_haralick.py diff --git a/features/eolearn/tests/test_hog.py b/tests/features/test_hog.py similarity index 100% rename from features/eolearn/tests/test_hog.py rename to tests/features/test_hog.py diff --git a/features/eolearn/tests/test_interpolation.py b/tests/features/test_interpolation.py similarity index 100% rename from features/eolearn/tests/test_interpolation.py rename to tests/features/test_interpolation.py diff --git a/features/eolearn/tests/test_local_binary_pattern.py b/tests/features/test_local_binary_pattern.py similarity index 100% rename from features/eolearn/tests/test_local_binary_pattern.py rename to tests/features/test_local_binary_pattern.py diff --git a/features/eolearn/tests/test_radiometric_normalization.py b/tests/features/test_radiometric_normalization.py similarity index 100% rename from features/eolearn/tests/test_radiometric_normalization.py rename to tests/features/test_radiometric_normalization.py diff --git a/features/eolearn/tests/test_temporal_features.py b/tests/features/test_temporal_features.py similarity index 100% rename from features/eolearn/tests/test_temporal_features.py rename to tests/features/test_temporal_features.py diff --git a/mask/eolearn/tests/conftest.py b/tests/geometry/conftest.py similarity index 93% rename from mask/eolearn/tests/conftest.py rename to tests/geometry/conftest.py index b8a63f2f0..95de24661 100644 --- a/mask/eolearn/tests/conftest.py +++ b/tests/geometry/conftest.py @@ -14,7 +14,7 @@ from eolearn.core import EOPatch -EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data") +EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data") TEST_EOPATCH_PATH = os.path.join(EXAMPLE_DATA_PATH, "TestEOPatch") diff --git a/geometry/eolearn/tests/test_morphology.py b/tests/geometry/test_morphology.py similarity index 100% rename from geometry/eolearn/tests/test_morphology.py rename to tests/geometry/test_morphology.py diff --git a/geometry/eolearn/tests/test_superpixel.py b/tests/geometry/test_superpixel.py similarity index 100% rename from geometry/eolearn/tests/test_superpixel.py rename to tests/geometry/test_superpixel.py diff --git a/geometry/eolearn/tests/test_transformations.py b/tests/geometry/test_transformations.py similarity index 100% rename from geometry/eolearn/tests/test_transformations.py rename to tests/geometry/test_transformations.py diff --git a/io/eolearn/tests/TestInputs/test_meteoblue_raster_input.bin b/tests/io/TestInputs/test_meteoblue_raster_input.bin similarity index 100% rename from io/eolearn/tests/TestInputs/test_meteoblue_raster_input.bin rename to tests/io/TestInputs/test_meteoblue_raster_input.bin diff --git a/io/eolearn/tests/TestInputs/test_meteoblue_vector_input.bin b/tests/io/TestInputs/test_meteoblue_vector_input.bin similarity index 100% rename from io/eolearn/tests/TestInputs/test_meteoblue_vector_input.bin rename to tests/io/TestInputs/test_meteoblue_vector_input.bin diff --git a/io/eolearn/tests/conftest.py b/tests/io/conftest.py similarity index 96% rename from io/eolearn/tests/conftest.py rename to tests/io/conftest.py index 1464b571e..1ef98753b 100644 --- a/io/eolearn/tests/conftest.py +++ b/tests/io/conftest.py @@ -20,7 +20,7 @@ from eolearn.core import EOPatch # noqa: E402 -EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data") +EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data") TEST_EOPATCH_PATH = os.path.join(EXAMPLE_DATA_PATH, "TestEOPatch") @@ -37,7 +37,7 @@ def example_data_path_fixture(): @pytest.fixture(name="gpkg_file") def local_gpkg_example_file_fixture(): """A pytest fixture to retrieve a gpkg example file""" - return os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../../example_data/import-gpkg-test.gpkg") + return os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../example_data/import-gpkg-test.gpkg") @pytest.fixture(name="s3_gpkg_file") diff --git a/io/eolearn/tests/test_extra/test_geodb.py b/tests/io/test_extra/test_geodb.py similarity index 100% rename from io/eolearn/tests/test_extra/test_geodb.py rename to tests/io/test_extra/test_geodb.py diff --git a/io/eolearn/tests/test_extra/test_meteoblue.py b/tests/io/test_extra/test_meteoblue.py similarity index 100% rename from io/eolearn/tests/test_extra/test_meteoblue.py rename to tests/io/test_extra/test_meteoblue.py diff --git a/io/eolearn/tests/test_geometry_io.py b/tests/io/test_geometry_io.py similarity index 100% rename from io/eolearn/tests/test_geometry_io.py rename to tests/io/test_geometry_io.py diff --git a/io/eolearn/tests/test_raster_io.py b/tests/io/test_raster_io.py similarity index 100% rename from io/eolearn/tests/test_raster_io.py rename to tests/io/test_raster_io.py diff --git a/io/eolearn/tests/test_sentinelhub_process.py b/tests/io/test_sentinelhub_process.py similarity index 100% rename from io/eolearn/tests/test_sentinelhub_process.py rename to tests/io/test_sentinelhub_process.py diff --git a/geometry/eolearn/tests/conftest.py b/tests/mask/conftest.py similarity index 93% rename from geometry/eolearn/tests/conftest.py rename to tests/mask/conftest.py index 4aec778ed..d82805448 100644 --- a/geometry/eolearn/tests/conftest.py +++ b/tests/mask/conftest.py @@ -16,7 +16,7 @@ pytest.register_assert_rewrite("sentinelhub.testing_utils") -EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data") +EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data") TEST_EOPATCH_PATH = os.path.join(EXAMPLE_DATA_PATH, "TestEOPatch") diff --git a/mask/eolearn/tests/test_cloud_mask.py b/tests/mask/test_cloud_mask.py similarity index 100% rename from mask/eolearn/tests/test_cloud_mask.py rename to tests/mask/test_cloud_mask.py diff --git a/mask/eolearn/tests/test_mask_counting.py b/tests/mask/test_mask_counting.py similarity index 100% rename from mask/eolearn/tests/test_mask_counting.py rename to tests/mask/test_mask_counting.py diff --git a/mask/eolearn/tests/test_mask_utils.py b/tests/mask/test_mask_utils.py similarity index 100% rename from mask/eolearn/tests/test_mask_utils.py rename to tests/mask/test_mask_utils.py diff --git a/mask/eolearn/tests/test_masking.py b/tests/mask/test_masking.py similarity index 100% rename from mask/eolearn/tests/test_masking.py rename to tests/mask/test_masking.py diff --git a/mask/eolearn/tests/test_snow_mask.py b/tests/mask/test_snow_mask.py similarity index 100% rename from mask/eolearn/tests/test_snow_mask.py rename to tests/mask/test_snow_mask.py diff --git a/ml_tools/eolearn/tests/conftest.py b/tests/ml_tools/conftest.py similarity index 93% rename from ml_tools/eolearn/tests/conftest.py rename to tests/ml_tools/conftest.py index 7767390ba..92513cf05 100644 --- a/ml_tools/eolearn/tests/conftest.py +++ b/tests/ml_tools/conftest.py @@ -14,7 +14,7 @@ from eolearn.core import EOPatch -EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data") +EXAMPLE_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data") TEST_EOPATCH_PATH = os.path.join(EXAMPLE_DATA_PATH, "TestEOPatch") diff --git a/ml_tools/eolearn/tests/test_sampling.py b/tests/ml_tools/test_sampling.py similarity index 100% rename from ml_tools/eolearn/tests/test_sampling.py rename to tests/ml_tools/test_sampling.py diff --git a/ml_tools/eolearn/tests/test_train_split.py b/tests/ml_tools/test_train_split.py similarity index 100% rename from ml_tools/eolearn/tests/test_train_split.py rename to tests/ml_tools/test_train_split.py diff --git a/visualization/eolearn/tests/test_eoexecutor.py b/tests/visualization/test_eoexecutor.py similarity index 100% rename from visualization/eolearn/tests/test_eoexecutor.py rename to tests/visualization/test_eoexecutor.py diff --git a/visualization/eolearn/tests/test_eopatch.py b/tests/visualization/test_eopatch.py similarity index 97% rename from visualization/eolearn/tests/test_eopatch.py rename to tests/visualization/test_eopatch.py index b10acf804..8ac826ac8 100644 --- a/visualization/eolearn/tests/test_eopatch.py +++ b/tests/visualization/test_eopatch.py @@ -20,7 +20,7 @@ @pytest.fixture(name="eopatch", scope="module") def eopatch_fixture(): - path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "example_data", "TestEOPatch") + path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "example_data", "TestEOPatch") return EOPatch.load(path) diff --git a/visualization/eolearn/tests/test_eoworkflow.py b/tests/visualization/test_eoworkflow.py similarity index 100% rename from visualization/eolearn/tests/test_eoworkflow.py rename to tests/visualization/test_eoworkflow.py diff --git a/visualization/MANIFEST.in b/visualization/MANIFEST.in deleted file mode 100644 index 84f45995e..000000000 --- a/visualization/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include requirements*.txt -include eolearn/visualization/report_templates/report.html -include LICENSE -include README.md -include eolearn/visualization/py.typed -exclude eolearn/tests/* diff --git a/visualization/eolearn/__init__.py b/visualization/eolearn/__init__.py deleted file mode 100644 index 8db66d3d0..000000000 --- a/visualization/eolearn/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/visualization/eolearn/visualization/py.typed b/visualization/eolearn/visualization/py.typed deleted file mode 100644 index e69de29bb..000000000