@@ -91,7 +91,7 @@ Then in a shell you could run:
9191 >>> auto_cli(Main, args = [" --max_prize=1000" , " person" , " Lucky" ]) # doctest: +ELLIPSIS
9292 'Lucky won ...€!'
9393
94- If the given class does not have any methods, there will be no sub-commands and
94+ If the given class does not have any methods, there will be no subcommands and
9595:func: `.auto_cli ` will return an instance of the class. For example:
9696
9797.. testcode ::
@@ -129,11 +129,11 @@ run via :ref:`sub-commands` similar to the single class example above, i.e.
129129``example.py function [arguments] `` where ``function `` is the name of the
130130function to execute. If multiple classes or a mixture of functions and classes
131131is given to :func: `.auto_cli `, to execute a method of a class, two levels of
132- :ref: `sub-commands ` are required. The first sub-command would be the name of the
132+ :ref: `sub-commands ` are required. The first subcommand would be the name of the
133133class and the second the name of the method, i.e. ``example.py class
134134[init_arguments] method [arguments] ``.
135135
136- Arbitrary levels of sub-commands with custom names can be defined by providing a
136+ Arbitrary levels of subcommands with custom names can be defined by providing a
137137``dict ``. For example:
138138
139139.. testcode ::
@@ -2560,7 +2560,7 @@ Experimental ``omegaconf+`` mode
25602560An experimental ``omegaconf+ `` parser mode is available, which addresses the
25612561limitations of the ``omegaconf `` mode mentioned earlier. Instead of applying
25622562OmegaConf resolvers to each YAML config individually, the resolving is performed
2563- once at the end of the parsing process. As a result, in nested sub-configs ,
2563+ once at the end of the parsing process. As a result, in nested subconfigs ,
25642564references to nodes must be either relative or parser-level absolute to function
25652565correctly. Alternatively, you can
25662566``set_parsing_settings(omegaconf_absolute_to_relative_paths=True) `` to enable
@@ -2569,7 +2569,7 @@ that this automatic conversion does not work for every possible case.
25692569
25702570Based on community feedback, this mode may become the default ``omegaconf `` mode
25712571in version 5.0.0. This change would introduce a breaking modification, as
2572- absolute node references would no longer work in nested sub-configs .
2572+ absolute node references would no longer work in nested subconfigs .
25732573
25742574
25752575.. _environment-variables :
@@ -2625,19 +2625,19 @@ variables.
26252625
26262626.. _sub-commands :
26272627
2628- Sub-commands
2629- ============
2628+ Subcommands
2629+ ===========
26302630
26312631A way to define parsers in a modular way is what in argparse is known as
2632- `sub-commands <https://docs.python.org/3/library/argparse.html#sub-commands >`__.
2633- However, to promote modularity, in jsonargparse sub-commands work a bit
2634- different than in argparse. To add sub-commands to a parser, the
2632+ `subcommands <https://docs.python.org/3/library/argparse.html#subcommands >`__.
2633+ However, to promote modularity, in jsonargparse subcommands work a bit
2634+ different than in argparse. To add subcommands to a parser, the
26352635:py:meth: `.ArgumentParser.add_subcommands ` method is used. Then an existing
2636- parser is added as a sub-command using :func: `.add_subcommand `. In a parsed
2637- config object the sub-command will be stored in the ``subcommand `` entry (or
2638- whatever ``dest `` was set to), and the values of the sub-command will be in an
2639- entry with the same name as the respective sub-command . An example of defining a
2640- parser with sub-commands is the following:
2636+ parser is added as a subcommand using :func: `.add_subcommand `. In a parsed
2637+ config object the subcommand will be stored in the ``subcommand `` entry (or
2638+ whatever ``dest `` was set to), and the values of the subcommand will be in an
2639+ entry with the same name as the respective subcommand . An example of defining a
2640+ parser with subcommands is the following:
26412641
26422642.. testcode ::
26432643
@@ -2680,29 +2680,29 @@ valid YAML would be:
26802680 Parsing of environment variables works similar to :class: `.ActionParser `. For
26812681the example parser above, all environment variables for ``subcomm1 `` would have
26822682as prefix ``APP_SUBCOMM1_ `` and likewise for ``subcomm2 `` as prefix
2683- ``APP_SUBCOMM2_ ``. The sub-command to use could be chosen by setting environment
2683+ ``APP_SUBCOMM2_ ``. The subcommand to use could be chosen by setting environment
26842684variable ``APP_SUBCOMMAND ``.
26852685
2686- It is possible to have multiple levels of sub-commands . With multiple levels
2687- there is one basic requirement: the sub-commands must be added in the order of
2686+ It is possible to have multiple levels of subcommands . With multiple levels
2687+ there is one basic requirement: the subcommands must be added in the order of
26882688the levels. This is, first call :func: `add_subcommands ` and
26892689:func: `add_subcommand ` for the first level. Only after do the same for the
26902690second level, and so on.
26912691
26922692
26932693.. _json-schemas :
26942694
2695- Json schemas
2695+ JSON Schemas
26962696============
26972697
26982698The :class: `.ActionJsonSchema ` class is provided to allow parsing and validation
26992699of values using a JSON Schema. This class requires the `jsonschema
27002700<https://pypi.org/project/jsonschema/> `__ Python package. Though note that
2701- jsonschema is not a requirement of the minimal jsonargparse install. To enable
2702- this functionality install with the ``jsonschema `` extra as explained in section
2703- :ref: `installation `.
2701+ `` jsonschema `` is not a requirement of the minimal jsonargparse install. To
2702+ enable this functionality install with the ``jsonschema `` extra as explained in
2703+ section :ref: `installation `.
27042704
2705- Check out the `jsonschema documentation
2705+ Check out the `JSON Schema documentation
27062706<https://python-jsonschema.readthedocs.io/> `__ to learn how to write a schema.
27072707The current version of jsonargparse uses Draft7Validator. Parsing an argument
27082708using a JSON Schema is done like in the following example:
0 commit comments