Skip to content

Commit

Permalink
Docs nits
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Nov 11, 2024
1 parent f150c73 commit b9e72b7
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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.


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -169,7 +169,7 @@ Structures can also be used as input to functions.
<pre class="highlight" style="padding: 1em; box-sizing: border-box; font-size: 0.85em; line-height: 1.2em;">
<strong style="opacity: 0.7; padding-bottom: 0.5em; display: inline-block"><span style="user-select: none">$ </span>python ./02_nesting_in_func.py --out-dir /tmp/test1</strong>
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)
</pre>


Expand All @@ -179,7 +179,7 @@ Structures can also be used as input to functions.
<pre class="highlight" style="padding: 1em; box-sizing: border-box; font-size: 0.85em; line-height: 1.2em;">
<strong style="opacity: 0.7; padding-bottom: 0.5em; display: inline-block"><span style="user-select: none">$ </span>python ./02_nesting_in_func.py --out-dir /tmp/test2 --config.seed 4</strong>
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)
</pre>
.. _example-03_nesting_containers:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion tests/test_dcargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b9e72b7

Please sign in to comment.