Skip to content

Commit

Permalink
Update readme with manual display details
Browse files Browse the repository at this point in the history
  • Loading branch information
aazuspan committed Mar 13, 2024
1 parent c439adb commit e6b78ed
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Add interactive Code Editor-style HTML reprs to Earth Engine objects in a Jupyte

## Setup

> [!TIP]
> `eerepr` is pre-installed in [Google Colab](https://colab.research.google.com/)!
Install from PyPI:

```bash
Expand All @@ -27,14 +30,35 @@ $ conda install -c conda-forge eerepr

## Usage

### Activating eerepr

```python
import eerepr
```

Importing `eerepr` in a Jupyter notebook adds an HTML repr method to all Earth Engine objects. When you print them, you'll see an interactive HTML repr instead of a boring old string repr. Simple as that!

> **Note**
> Just like in the Code Editor, printing huge collections can be slow and may hit memory limits.
> [!TIP]
> If you're using [geemap](https://github.com/gee-community/geemap), `eerepr` is automatically imported and activated by default!
### Manually Rendering Objects

Jupyter only automatically displays the last object in a cell. To manually render an HTML repr anywhere in a code block, use `IPython.display.display`.

```python
from IPython.display import display
import ee
import eerepr

ee.Initialize()

display(ee.FeatureCollection("LARSE/GEDI/GEDI02_A_002_INDEX").limit(3))
```

### Large Objects

> [!CAUTION]
> Just like in the Code Editor, printing huge collections can be slow and may hit memory limits. If a repr exceeds 100 Mb, `eerepr` will fallback to a string repr to avoid freezing the notebook. Adjust `eerepr.options.max_repr_mbs` to print larger objects.
## Caching

Expand Down

0 comments on commit e6b78ed

Please sign in to comment.