From 135b74aa2e4d6e5a755c27d3bb7fe170650058d3 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Sat, 21 Sep 2024 04:37:13 -0700 Subject: [PATCH] omg does myst_nb execute in the cwd of the file, that's even better --- docs/serialization.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/serialization.md b/docs/serialization.md index f18b8f6..5812f30 100644 --- a/docs/serialization.md +++ b/docs/serialization.md @@ -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}