mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2024-11-14 18:54:28 +00:00
omg does myst_nb execute in the cwd of the file, that's even better
This commit is contained in:
parent
2f453f1d03
commit
135b74aa2e
1 changed files with 7 additions and 7 deletions
|
@ -81,7 +81,7 @@ print(model.model_dump_json())
|
||||||
```
|
```
|
||||||
|
|
||||||
```{code-cell}
|
```{code-cell}
|
||||||
model = MyModel(array="docs/data/test.avi")
|
model = MyModel(array="data/test.avi")
|
||||||
print(model.model_dump_json())
|
print(model.model_dump_json())
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -138,12 +138,12 @@ When possible, the full content of the array is omitted in favor
|
||||||
of the path to the file that provided it.
|
of the path to the file that provided it.
|
||||||
|
|
||||||
```{code-cell}
|
```{code-cell}
|
||||||
model = MyModel(array="docs/data/test.avi")
|
model = MyModel(array="data/test.avi")
|
||||||
print_json(model.model_dump_json(round_trip=True))
|
print_json(model.model_dump_json(round_trip=True))
|
||||||
```
|
```
|
||||||
|
|
||||||
```{code-cell}
|
```{code-cell}
|
||||||
model = MyModel(array=("docs/data/test.h5", "/data"))
|
model = MyModel(array=("data/test.h5", "/data"))
|
||||||
print_json(model.model_dump_json(round_trip=True))
|
print_json(model.model_dump_json(round_trip=True))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ you might want to serialize relative to each of them:
|
||||||
print_json(
|
print_json(
|
||||||
model.model_dump_json(
|
model.model_dump_json(
|
||||||
round_trip=True,
|
round_trip=True,
|
||||||
context={"relative_to": Path('./docs/data')}
|
context={"relative_to": Path('./data')}
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ Supported interfaces:
|
||||||
- (all)
|
- (all)
|
||||||
|
|
||||||
```{code-cell}
|
```{code-cell}
|
||||||
model = MyModel(array=("docs/data/test.h5", "/data"))
|
model = MyModel(array=("data/test.h5", "/data"))
|
||||||
data = model.model_dump_json(
|
data = model.model_dump_json(
|
||||||
round_trip=True,
|
round_trip=True,
|
||||||
context={"absolute_paths": True}
|
context={"absolute_paths": True}
|
||||||
|
@ -278,7 +278,7 @@ Supported interfaces:
|
||||||
- (all)
|
- (all)
|
||||||
|
|
||||||
```{code-cell}
|
```{code-cell}
|
||||||
model = MyModel(array=("docs/data/test.h5", "/data"))
|
model = MyModel(array=("data/test.h5", "/data"))
|
||||||
data = model.model_dump_json(
|
data = model.model_dump_json(
|
||||||
round_trip=True,
|
round_trip=True,
|
||||||
context={"relative_to": Path('../')}
|
context={"relative_to": Path('../')}
|
||||||
|
@ -294,7 +294,7 @@ Supported interfaces:
|
||||||
- {class}`.ZarrInterface`
|
- {class}`.ZarrInterface`
|
||||||
|
|
||||||
```{code-cell}
|
```{code-cell}
|
||||||
model = MyModel(array=("docs/data/test.zarr",))
|
model = MyModel(array=("data/test.zarr",))
|
||||||
data = model.model_dump_json(
|
data = model.model_dump_json(
|
||||||
round_trip=True,
|
round_trip=True,
|
||||||
context={"dump_array": True}
|
context={"dump_array": True}
|
||||||
|
|
Loading…
Reference in a new issue