diff --git a/docs/source/examples/nested_structures.rst b/docs/source/examples/hierarchical_structures.rst similarity index 99% rename from docs/source/examples/nested_structures.rst rename to docs/source/examples/hierarchical_structures.rst index a64a046a..9c920f0e 100644 --- a/docs/source/examples/nested_structures.rst +++ b/docs/source/examples/hierarchical_structures.rst @@ -1,13 +1,13 @@ .. Comment: this file is automatically generated by `update_example_docs.py`. It should not be modified manually. -.. _example-category-nested_structures: +.. _example-category-hierarchical_structures: -Nested Structures +Hierarchical Structures ================= In these examples, we show how :func:`tyro.cli` can be used to instantiate -nested structures. This can enable modular, reusable, and composable CLI +hierarchical structures. This can enable modular, reusable, and composable CLI interfaces. @@ -127,7 +127,7 @@ Structures can also be used as input to functions. config: Experiment configuration. """ print(f"Saving to: {out_dir}") - print(f"Config: f{config}") + print(f"Config: {config}") if __name__ == "__main__": tyro.cli(train) @@ -169,7 +169,7 @@ Structures can also be used as input to functions.
$ python ./02_nesting_in_func.py --out-dir /tmp/test1
Saving to: /tmp/test1
- Config: fConfig(optimizer=OptimizerConfig(learning_rate=0.0003, weight_decay=0.01), seed=0)
+ Config: Config(optimizer=OptimizerConfig(learning_rate=0.0003, weight_decay=0.01), seed=0)
@@ -179,7 +179,7 @@ Structures can also be used as input to functions.
$ python ./02_nesting_in_func.py --out-dir /tmp/test2 --config.seed 4
Saving to: /tmp/test2
- Config: fConfig(optimizer=OptimizerConfig(learning_rate=0.0003, weight_decay=0.01), seed=4)
+ Config: Config(optimizer=OptimizerConfig(learning_rate=0.0003, weight_decay=0.01), seed=4)
.. _example-03_nesting_containers:
diff --git a/docs/source/index.md b/docs/source/index.md
index cb95fefd..e95497ef 100644
--- a/docs/source/index.md
+++ b/docs/source/index.md
@@ -97,7 +97,7 @@ shell completion.
:titlesonly:
./examples/basics.rst
- ./examples/nested_structures.rst
+ ./examples/hierarchical_structures.rst
./examples/subcommands.rst
./examples/overriding_configs.rst
./examples/generics.rst
diff --git a/examples/02_nested_structures/01_nesting.py b/examples/02_hierarchical_structures/01_nesting.py
similarity index 100%
rename from examples/02_nested_structures/01_nesting.py
rename to examples/02_hierarchical_structures/01_nesting.py
diff --git a/examples/02_nested_structures/02_nesting_in_func.py b/examples/02_hierarchical_structures/02_nesting_in_func.py
similarity index 96%
rename from examples/02_nested_structures/02_nesting_in_func.py
rename to examples/02_hierarchical_structures/02_nesting_in_func.py
index da0c81f0..89399446 100644
--- a/examples/02_nested_structures/02_nesting_in_func.py
+++ b/examples/02_hierarchical_structures/02_nesting_in_func.py
@@ -41,7 +41,7 @@ def train(
config: Experiment configuration.
"""
print(f"Saving to: {out_dir}")
- print(f"Config: f{config}")
+ print(f"Config: {config}")
if __name__ == "__main__":
diff --git a/examples/02_nested_structures/03_nesting_containers.py b/examples/02_hierarchical_structures/03_nesting_containers.py
similarity index 100%
rename from examples/02_nested_structures/03_nesting_containers.py
rename to examples/02_hierarchical_structures/03_nesting_containers.py
diff --git a/examples/02_nested_structures/04_dictionaries.py b/examples/02_hierarchical_structures/04_dictionaries.py
similarity index 100%
rename from examples/02_nested_structures/04_dictionaries.py
rename to examples/02_hierarchical_structures/04_dictionaries.py
diff --git a/examples/02_nested_structures/05_tuples.py b/examples/02_hierarchical_structures/05_tuples.py
similarity index 100%
rename from examples/02_nested_structures/05_tuples.py
rename to examples/02_hierarchical_structures/05_tuples.py
diff --git a/examples/02_nested_structures/06_pydantic.py b/examples/02_hierarchical_structures/06_pydantic.py
similarity index 100%
rename from examples/02_nested_structures/06_pydantic.py
rename to examples/02_hierarchical_structures/06_pydantic.py
diff --git a/examples/02_nested_structures/07_attrs.py b/examples/02_hierarchical_structures/07_attrs.py
similarity index 100%
rename from examples/02_nested_structures/07_attrs.py
rename to examples/02_hierarchical_structures/07_attrs.py
diff --git a/examples/02_nested_structures/README.rst b/examples/02_hierarchical_structures/README.rst
similarity index 50%
rename from examples/02_nested_structures/README.rst
rename to examples/02_hierarchical_structures/README.rst
index 8ec6ad9b..d4ffcfa5 100644
--- a/examples/02_nested_structures/README.rst
+++ b/examples/02_hierarchical_structures/README.rst
@@ -1,6 +1,6 @@
-Nested Structures
+Hierarchical Structures
=================
In these examples, we show how :func:`tyro.cli` can be used to instantiate
-nested structures. This can enable modular, reusable, and composable CLI
+hierarchical structures. This can enable modular, reusable, and composable CLI
interfaces.
diff --git a/tests/test_dcargs.py b/tests/test_dcargs.py
index e63f1107..317ad1b7 100644
--- a/tests/test_dcargs.py
+++ b/tests/test_dcargs.py
@@ -21,9 +21,10 @@
import pytest
import torch
-import tyro
from typing_extensions import Annotated, Final, Literal, TypeAlias
+import tyro
+
def test_no_args() -> None:
def main() -> int: