Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions api-reference/tilebox.datasets/Collection.delete.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Collection.delete
icon: download
icon: layer-group
---

```python
def Collection.delete(datapoints: xr.Dataset) -> int
def Collection.delete(datapoints: DatapointIDs) -> int
```

Delete datapoints from the collection.
Expand All @@ -17,8 +17,17 @@ Datapoints are identified and deleted by their ids.

## Parameters

<ParamField path="datapoints" type="xr.Dataset">
An [`xarray.Dataset`](/sdks/python/xarray) containing an "id" variable consisting of datapoint IDs to delete.
<ParamField path="datapoints" type="DatapointIDs">
Datapoint IDs to delete from the collection.

Supported `DatapointIDs` types are.
- A `pandas.DataFrame` containing an `id` column.
- A `pandas.Series` containing datapoint IDs.
- An `xarray.Dataset` containing an "id" variable.
- An `xarray.DataArray` containing datapoint IDs.
- A `numpy.ndarray` containing datapoint IDs.
- A `Collection[UUID]` containing datapoint IDs as python built-in `UUID` objects, e.g. `list[UUID]`.
- A `Collection[str]` containing datapoint IDs as strings, e.g. `list[str]`.
</ParamField>

## Returns
Expand All @@ -27,8 +36,19 @@ The number of datapoints that were deleted.

<RequestExample>
```python Python
datapoints = collection.load("2023-05-01 12:45:33.423")

n_deleted = collection.delete(datapoints)
collection.delete([
"0195c87a-49f6-5ffa-e3cb-92215d057ea6",
"0195c87b-bd0e-3998-05cf-af6538f34957",
])
```
</RequestExample>

## Errors

<ParamField path="NotFoundError" type="No such collection: Non-existent-Collection">
One of the data points is not found in the collection. If any of the data points are not found,
nothing will be deleted.
</ParamField>
<ParamField path="ValueError" type="Invalid UUID">
One of the specified ids is not a valid UUID
</ParamField>
36 changes: 0 additions & 36 deletions api-reference/tilebox.datasets/Collection.delete_ids.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion api-reference/tilebox.datasets/Collection.find.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Collection.find
icon: download
icon: layer-group
---

```python
Expand Down
2 changes: 1 addition & 1 deletion api-reference/tilebox.datasets/Collection.info.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Collection.info
icon: download
icon: layer-group
---

```python
Expand Down
62 changes: 62 additions & 0 deletions api-reference/tilebox.datasets/Collection.ingest.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Collection.ingest
icon: layer-group
---

```python
def Collection.ingest(
data: IngestionData,
allow_existing: bool = True
) -> list[UUID]
```

Ingest data into a collection.

<Note>
You need to have write permission on the collection to be able to delete datapoints.
</Note>

## Parameters

<ParamField path="data" type="IngestionData">
The data to ingest.

Supported `IngestionData` data types are:
- A `pandas.DataFrame`, mapping the column names to dataset fields.
- An `xarray.Dataset`, mapping variables and coordinates to dataset fields.
- `Iterable`, `dict` or `nd-array`: Ingest any object that can be converted to a `pandas.DataFrame` using
it's constructor, equivalent to `ingest(pd.DataFrame(data))`.
</ParamField>
<ParamField path="allow_existing" type="bool">
Datapoint fields are used to generate a deterministic unique `UUID` for each
datapoint in a collection. Duplicate datapoints result in the same ID being generated.
If `allow_existing` is `True`, `ingest` will skip those datapoints, since they already exist.
If `allow_existing` is `False`, `ingest` will raise an error if any of the generated datapoint IDs already exist.
Defaults to `True`.
</ParamField>

## Returns

List of datapoint ids that were ingested, including the IDs of already existing datapoints in case of duplicates and
`allow_existing=True`.

<RequestExample>
```python Python
import pandas as pd

collection.ingest(pd.DataFrame({
"time": [
"2023-05-01T12:00:00Z",
"2023-05-02T12:00:00Z",
],
"value": [1, 2],
"sensor": ["A", "B"],
}))
```
</RequestExample>

## Errors

<ParamField path="ArgumentError" type="found existing datapoints with same id">
If `allow_existing` is `False` and any of the datapoints attempting to ingest already exist.
</ParamField>
4 changes: 2 additions & 2 deletions api-reference/tilebox.datasets/Collection.load.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Collection.load
icon: download
icon: layer-group
---

```python
Expand Down Expand Up @@ -32,7 +32,7 @@ If no data exists for the requested time or interval, an empty `xarray.Dataset`
</ParamField>

<ParamField path="skip_data" type="bool">
If `True`, the response contains only the [datapoint metadata](/datasets/timeseries) without the actual dataset-specific fields. Defaults to `False`.
If `True`, the response contains only the [required fields for the dataset type](/datasets/types/timeseries) without the actual dataset-specific fields. Defaults to `False`.
</ParamField>

<ParamField path="show_progress" type="bool">
Expand Down
2 changes: 1 addition & 1 deletion api-reference/tilebox.datasets/Dataset.collection.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Dataset.collection
icon: layer-group
icon: database
---

```python
Expand Down
2 changes: 1 addition & 1 deletion api-reference/tilebox.datasets/Dataset.collections.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Dataset.collections
icon: layer-group
icon: database
---

```python
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Dataset.create_collection
icon: layer-group
icon: database
---

```python
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Dataset.get_or_create_collection
icon: layer-group
sidebarTitle: Dataset.get_or_create_c...
icon: database
---

```python
Expand Down
Binary file added assets/guides/ingest/dataset-schema-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/dataset-schema-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/dataset-slug-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/dataset-slug-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/explorer-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/explorer-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/modis-explore-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/ingest/modis-explore-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions assets/jupyter/tilebox-banner-python.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading