From 3bd3ad6f9d190d3d58d67db58d36fb178884a06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6lzer?= Date: Sun, 27 Oct 2024 16:43:40 +0100 Subject: [PATCH] Add a notebook recommendation to readme --- README.md | 26 +++++++++++++++++++++++++- docs/contribute.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b775417..97349cc 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ rye add --optional=gdal384 "gdal==3.8.4" > IMPORTANT! If you installed any of clang or gdal with conda, please ensure that while installing dependencies and working on the project to have the conda environment activated in which you installed clang and or gdal. -Another option is to install the windows GDAL binary wheels compiled by cgoehlke from https://github.com/cgohlke/geospatial-wheels: +Another option is to install the windows GDAL binary wheels compiled by cgoehlke from : ```cmd rye sync -f --features gdal384_win64 @@ -104,3 +104,27 @@ Please see these issues: - [Rye: Can't specify per-dependency package index / can't specify uv behavior in config file](https://github.com/astral-sh/rye/issues/1210#issuecomment-2263761535) - [UV: Add support for pinning a package to a specific index](https://github.com/astral-sh/uv/issues/171) + +## Recommended Notebook header + +The following code snipped can be put in the very first cell of a notebook to already to add logging and initialize earth engine. + +```python +import logging + +from rich.logging import RichHandler +from rich.traceback import install + +from darts.utils.earthengine import init_ee +from darts.utils.logging import setup_logging + +setup_logging() +logging.basicConfig( + level=logging.INFO, + format="%(message)s", + datefmt="[%X]", + handlers=[RichHandler(rich_tracebacks=True)], +) +install(show_locals=True) # Change to False if you encounter too large tracebacks +init_ee("ee-project") # Replace with your project +``` diff --git a/docs/contribute.md b/docs/contribute.md index d891ba9..b79c04d 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -54,6 +54,12 @@ rye add --optional=gdal384 "gdal==3.8.4" > IMPORTANT! If you installed any of clang or gdal with conda, please ensure that while installing dependencies and working on the project to have the conda environment activated in which you installed clang and or gdal. +Another option is to install the windows GDAL binary wheels compiled by cgoehlke from : + +```cmd +rye sync -f --features gdal384_win64 +``` + ### Troubleshoot: Rye can't find the right versions Because the `pyproject.toml` specifies additional sources, e.g. `https://download.pytorch.org/whl/cpu`, it can happen that the a package with an older version is found in these package-indexes. @@ -82,3 +88,28 @@ Please see these issues: - [Rye: Can't specify per-dependency package index / can't specify uv behavior in config file](https://github.com/astral-sh/rye/issues/1210#issuecomment-2263761535) - [UV: Add support for pinning a package to a specific index](https://github.com/astral-sh/uv/issues/171) + + +## Recommended Notebook header + +The following code snipped can be put in the very first cell of a notebook to already to add logging and initialize earth engine. + +```python +import logging + +from rich.logging import RichHandler +from rich.traceback import install + +from darts.utils.earthengine import init_ee +from darts.utils.logging import setup_logging + +setup_logging() +logging.basicConfig( + level=logging.INFO, + format="%(message)s", + datefmt="[%X]", + handlers=[RichHandler(rich_tracebacks=True)], +) +install(show_locals=True) # Change to False if you encounter too large tracebacks +init_ee("ee-project") # Replace with your project +```