omg does myst_nb execute in the cwd of the file, that's even better

This commit is contained in:
sneakers-the-rat 2024-09-21 04:37:13 -07:00
parent 2f453f1d03
commit 135b74aa2e
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D

View file

@ -81,7 +81,7 @@ print(model.model_dump_json())
```
```{code-cell}
model = MyModel(array="docs/data/test.avi")
model = MyModel(array="data/test.avi")
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.
```{code-cell}
model = MyModel(array="docs/data/test.avi")
model = MyModel(array="data/test.avi")
print_json(model.model_dump_json(round_trip=True))
```
```{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))
```
@ -169,7 +169,7 @@ you might want to serialize relative to each of them:
print_json(
model.model_dump_json(
round_trip=True,
context={"relative_to": Path('./docs/data')}
context={"relative_to": Path('./data')}
))
```
@ -261,7 +261,7 @@ Supported interfaces:
- (all)
```{code-cell}
model = MyModel(array=("docs/data/test.h5", "/data"))
model = MyModel(array=("data/test.h5", "/data"))
data = model.model_dump_json(
round_trip=True,
context={"absolute_paths": True}
@ -278,7 +278,7 @@ Supported interfaces:
- (all)
```{code-cell}
model = MyModel(array=("docs/data/test.h5", "/data"))
model = MyModel(array=("data/test.h5", "/data"))
data = model.model_dump_json(
round_trip=True,
context={"relative_to": Path('../')}
@ -294,7 +294,7 @@ Supported interfaces:
- {class}`.ZarrInterface`
```{code-cell}
model = MyModel(array=("docs/data/test.zarr",))
model = MyModel(array=("data/test.zarr",))
data = model.model_dump_json(
round_trip=True,
context={"dump_array": True}