Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions scripts/exgdas_global_marine_analysis_ecen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
Comment thread
AndrewEichmann-NOAA marked this conversation as resolved.
# exgdas_global_marine_analysis_ecen.py
# This script creates an MarineRecenter class
# and runs the initialize, run, and finalize methods
# which currently are stubs
import os

from wxflow import Logger, cast_strdict_as_dtypedict
from soca.marine_recenter import MarineRecenter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment with a TODO: to move marine_recenter.py to ush/python/pygfs/task in the global-workflow so that when the time comes, it is easily achieved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it helps, it would be:

from pygfs.task.marine_recenter import MarineRecenter


# Initialize root logger
logger = Logger(level='DEBUG', colored_log=True)


if __name__ == '__main__':

# Take configuration from environment and cast it as python dictionary
config = cast_strdict_as_dtypedict(os.environ)

# Instantiate the aerosol analysis task
MarineRecen = MarineRecenter(config)
MarineRecen.initialize()
MarineRecen.run()
MarineRecen.finalize()
1 change: 1 addition & 0 deletions test/soca/gw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ set(jjob_list "JGLOBAL_PREP_OCEAN_OBS"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_CHKPT"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_POST"
"JGDAS_GLOBAL_OCEAN_ANALYSIS_VRFY")
Expand Down
26 changes: 26 additions & 0 deletions ush/soca/marine_recenter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3

import os
from logging import getLogger
from typing import Dict, List, Any
from wxflow import logit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from wxflow import logit
from wxflow import Task, logit


logger = getLogger(__name__.split('.')[-1])


class MarineRecenter():
Comment thread
AndrewEichmann-NOAA marked this conversation as resolved.
Outdated

def __init__(self, config):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add stub documentation and follow typing hints. E.g.

Suggested change
def __init__(self, config):
def __init__(self, config: Dict) -> None:
"""Stub constructor for ocean recentering task
Parameters:
------------
config: Dict
configuration of XYZ
Returns
--------
None

Please see examples of tasks in ush/python/pygfs/task of the global-workflow.

logger.info("init")

@logit(logger)
def initialize(self):
logger.info("initialize")

@logit(logger)
def run(self):
logger.info("run")

@logit(logger)
def finalize(self):
logger.info("finalize")