Skip to content

Commit 61c46a4

Browse files
authored
Fix config docs: float -> int (#1077)
1 parent dd22cca commit 61c46a4

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

docs/docs/configuration.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ When creating and opening Icechunk repositories, there are many configuration op
66

77
The `RepositoryConfig` object is used to configure the repository. For convenience, this can be constructed using some sane defaults:
88

9-
```python
9+
```python exec="on" session="config" source="material-block"
10+
import icechunk
11+
1012
config = icechunk.RepositoryConfig.default()
1113
```
1214

@@ -30,7 +32,7 @@ The number of concurrent requests to make when getting partial values from stora
3032

3133
Icechunk uses Zstd compression to compress its metadata files. [`CompressionConfig`](./reference.md#icechunk.CompressionConfig) allows you to configure the [compression level](./reference.md#icechunk.CompressionConfig.level) and [algorithm](./reference.md#icechunk.CompressionConfig.algorithm). Currently, the only algorithm available is [`Zstd`](https://facebook.github.io/zstd/).
3234

33-
```python
35+
```python exec="on" session="config" source="material-block"
3436
config.compression = icechunk.CompressionConfig(
3537
level=3,
3638
algorithm=icechunk.CompressionAlgorithm.Zstd,
@@ -41,25 +43,25 @@ config.compression = icechunk.CompressionConfig(
4143

4244
Icechunk caches files (metadata and chunks) to speed up common operations. [`CachingConfig`](./reference.md#icechunk.CachingConfig) allows you to configure the caching behavior for the repository.
4345

44-
```python
46+
```python exec="on" session="config" source="material-block"
4547
config.caching = icechunk.CachingConfig(
4648
num_snapshot_nodes=100,
4749
num_chunk_refs=100,
4850
num_transaction_changes=100,
49-
num_bytes_attributes=1e4,
50-
num_bytes_chunks=1e6,
51+
num_bytes_attributes=10_000,
52+
num_bytes_chunks=1_000_000,
5153
)
5254
```
5355

5456
### [`storage`](./reference.md#icechunk.RepositoryConfig.storage)
5557

5658
This configures how Icechunk loads data from the storage backend. [`StorageSettings`](./reference.md#icechunk.StorageSettings) allows you to configure the storage settings.
5759

58-
```python
60+
```python exec="on" session="config" source="material-block"
5961
config.storage = icechunk.StorageSettings(
6062
concurrency=icechunk.StorageConcurrencySettings(
6163
max_concurrent_requests_for_object=10,
62-
ideal_concurrent_request_size=1e6,
64+
ideal_concurrent_request_size=1_000_000,
6365
),
6466
storage_class="STANDARD",
6567
metadata_storage_class="STANDARD_IA",
@@ -79,25 +81,25 @@ Icechunk allows repos to contain [virtual chunks](./virtual.md). To allow for re
7981

8082
For example, if we wanted to configure an icechunk repo to be able to contain virtual chunks from an `s3` bucket called `my-s3-bucket` in `us-east-1`, we would do the following:
8183

82-
```python
84+
```python exec="on" session="config" source="material-block"
8385
config.virtual_chunk_containers = [
8486
icechunk.VirtualChunkContainer(
8587
url_prefix="s3://my-s3-bucket/",
8688
storage=icechunk.StorageSettings(
87-
storage=icechunk.s3_storage(bucket="my-s3-bucket", region="us-east-1"),
89+
storage=icechunk.s3_storage(bucket="my-s3-bucket", prefix="foo", region="us-east-1"),
8890
),
8991
),
9092
]
9193
```
9294

9395
If we also wanted to configure the repo to be able to contain virtual chunks from another `s3` bucket called `my-other-s3-bucket` in `us-west-2`, we would do the following:
9496

95-
```python
97+
```python exec="on" session="config" source="material-block"
9698
config.set_virtual_chunk_container(
9799
icechunk.VirtualChunkContainer(
98100
url_prefix="s3://my-other-s3-bucket/",
99101
storage=icechunk.StorageSettings(
100-
storage=icechunk.s3_storage(bucket="my-other-s3-bucket", region="us-west-2"),
102+
storage=icechunk.s3_storage(bucket="my-other-s3-bucket", prefix="other-foo", region="us-west-2"),
101103
),
102104
),
103105
)
@@ -117,10 +119,10 @@ The manifest configuration for the repository. [`ManifestConfig`](./reference.md
117119

118120
For example, if we have a repo which contains data that we plan to open as an [`Xarray`](./xarray.md) dataset, we may want to configure the manifest preload to only preload manifests that contain arrays that are coordinates, in our case `time`, `latitude`, and `longitude`.
119121

120-
```python
122+
```python exec="on" session="config" source="material-block"
121123
config.manifest = icechunk.ManifestConfig(
122124
preload=icechunk.ManifestPreloadConfig(
123-
max_total_refs=1e8,
125+
max_total_refs=100_000_000,
124126
preload_if=icechunk.ManifestPreloadCondition.name_matches(".*time|.*latitude|.*longitude"),
125127
),
126128
)

0 commit comments

Comments
 (0)