-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea8e7e8
commit b89a788
Showing
51 changed files
with
1,496 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ API | |
fv3 | ||
logging | ||
rocoto | ||
sfc_climo_gen | ||
template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
``uwtools.api.sfc_climo_gen`` | ||
============================= | ||
|
||
.. automodule:: uwtools.api.sfc_climo_gen | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ User Guide | |
installation | ||
cli/index | ||
api/index | ||
uw_yaml/index | ||
yaml/index |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -eu | ||
|
||
echo "=> Running black" | ||
black src | ||
|
||
echo "=> Running isort" | ||
isort -q src | ||
|
||
echo "=> Running docformatter" | ||
(cd src && docformatter . || test $$? -eq 3) | ||
|
||
echo "=> Running jq" | ||
for a in $(find src -type f -name "*.jsonschema"); do | ||
b=$(jq -S . $a) && echo "$b" >$a || (echo " in $a"; false) | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
""" | ||
API access to uwtools Rocoto support. | ||
""" | ||
from pathlib import Path | ||
from typing import Optional, Union | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
API access to the uwtools sfc_climo_gen driver. | ||
""" | ||
from pathlib import Path | ||
from typing import Dict | ||
|
||
import iotaa | ||
|
||
from uwtools.drivers.sfc_climo_gen import SfcClimoGen | ||
|
||
|
||
def execute( | ||
task: str, | ||
config_file: Path, | ||
batch: bool = False, | ||
dry_run: bool = False, | ||
) -> bool: | ||
""" | ||
Execute an sfc_climo_gen task. | ||
If ``batch`` is specified, a runscript will be written and submitted to the batch system. | ||
Otherwise, the forecast will be run directly on the current system. | ||
:param task: The task to execute | ||
:param config_file: Path to YAML config file | ||
:param batch: Submit run to the batch system | ||
:param dry_run: Do not run forecast, just report what would have been done | ||
:return: True if task completes without raising an exception | ||
""" | ||
obj = SfcClimoGen(config_file=config_file, batch=batch, dry_run=dry_run) | ||
getattr(obj, task)() | ||
return True | ||
|
||
|
||
def tasks() -> Dict[str, str]: | ||
""" | ||
Returns a mapping from task names to their one-line descriptions. | ||
""" | ||
return { | ||
task: getattr(SfcClimoGen, task).__doc__.strip().split("\n")[0] | ||
for task in iotaa.tasknames(SfcClimoGen) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.