Skip to content

Commit

Permalink
doc: add doctest for ConfigNamelist
Browse files Browse the repository at this point in the history
also add the last 2 missing `kw_only=True` to @DataClass
  • Loading branch information
leclairm committed Jan 27, 2025
1 parent 2691656 commit e4045ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/sirocco/core/_tasks/shell_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
from sirocco.parsing._yaml_data_models import ConfigShellTaskSpecs


@dataclass
@dataclass(kw_only=True)
class ShellTask(ConfigShellTaskSpecs, Task):
pass
13 changes: 6 additions & 7 deletions src/sirocco/parsing/_yaml_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,13 @@ class ConfigNamelist:
- specs is a dictionnary containing the specifications of parameters
to change in the original namelist file
For example:
... python
Example:
ConfigNamelist(path="/some/path/to/icon.nml",
specs={"first_nml_block":{"first_param": first_value,
"second_param": second_value},
"second_nml_block":{"third_param": third_value}})
>>> path="/some/path/to/icon.nml"
>>> specs = {"first_nml_block": {"first_param": "a string value",
... "second_param": 0},
... "second_nml_block": {"third_param": False}}
>>> config_nml = ConfigNamelist(path=path, specs=specs)
"""

path: Path
Expand Down
2 changes: 1 addition & 1 deletion src/sirocco/pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from sirocco import core


@dataclasses.dataclass
@dataclasses.dataclass(kw_only=True)
class PrettyPrinter:
"""
Pretty print unrolled workflow graph elements in a reproducible and human readable format.
Expand Down

0 comments on commit e4045ef

Please sign in to comment.