Skip to content

Commit

Permalink
Add a notebook recommendation to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
relativityhd committed Oct 27, 2024
1 parent 7dfebf5 commit 3bd3ad6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/cgohlke/geospatial-wheels>:

```cmd
rye sync -f --features gdal384_win64
Expand Down Expand Up @@ -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
```
31 changes: 31 additions & 0 deletions docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/cgohlke/geospatial-wheels>:

```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.
Expand Down Expand Up @@ -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
```

0 comments on commit 3bd3ad6

Please sign in to comment.