Skip to content

Commit

Permalink
replace all instances of pygw with wxflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul committed Jul 3, 2023
1 parent 6f48fd2 commit 58725c1
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion scripts/exgdas_global_marine_analysis_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import shutil
import logging
from datetime import datetime, timedelta
from pygw.file_utils import FileHandler
from wxflow.file_utils import FileHandler


# TODO: Move this somewhere else?
Expand Down
8 changes: 4 additions & 4 deletions scripts/exgdas_global_marine_analysis_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
from netCDF4 import Dataset
import xarray as xr
import numpy as np
from pygw.attrdict import AttrDict
from pygw.template import Template, TemplateConstants
from pygw.yaml_file import YAMLFile
from pygw.file_utils import FileHandler
from wxflow.attrdict import AttrDict
from wxflow.template import Template, TemplateConstants
from wxflow.yaml_file import YAMLFile
from wxflow.file_utils import FileHandler

# set up logger
logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S')
Expand Down
8 changes: 4 additions & 4 deletions test/aero/genyaml_3dvar.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# generate YAML from a template
# using pygw YAML tools
# using wxflow YAML tools
bindir=$1
srcdir=$2

Expand All @@ -27,9 +27,9 @@ mkdir -p $DATA

# run some python code to generate the YAML
python3 - <<EOF
from pygw.attrdict import AttrDict
from pygw.template import Template, TemplateConstants
from pygw.yaml_file import YAMLFile
from wxflow.attrdict import AttrDict
from wxflow.template import Template, TemplateConstants
from wxflow.yaml_file import YAMLFile
import datetime
config = YAMLFile(path='$YAMLin')
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/jjob_ens_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export NMEM_ENS=3
export ACCOUNT=da-cpu

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Detemine machine from config.base
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/jjob_ens_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/parm/config/gfs/config.com"

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Detemine machine from config.base
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/jjob_ens_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export NMEM_ENS=3
export ACCOUNT=da-cpu

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Detemine machine from config.base
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/jjob_var_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export NMEM_ENS=0
export ACCOUNT=da-cpu

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Detemine machine from config.base
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/jjob_var_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/parm/config/gfs/config.com"

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Detemine machine from config.base
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/jjob_var_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export NMEM_ENS=0
export ACCOUNT=da-cpu

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Detemine machine from config.base
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/run_jedi_exe_3denvar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fi
# Setup python path for workflow utilities and tasks
export HOMEgfs=$srcdir/../../ # TODO: HOMEgfs had to be hard-coded in config
echo $HOMEgfs
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Create test run directory
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/run_jedi_exe_3dhofx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fi
# Setup python path for workflow utilities and tasks
export HOMEgfs=$srcdir/../../ # TODO: HOMEgfs had to be hard-coded in config
echo $HOMEgfs
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Create test run directory
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/run_jedi_exe_3dvar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fi
# Setup python path for workflow utilities and tasks
export HOMEgfs=$srcdir/../../ # TODO: HOMEgfs had to be hard-coded in config
echo $HOMEgfs
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Create test run directory
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/run_jedi_exe_letkf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fi
# Setup python path for workflow utilities and tasks
export HOMEgfs=$srcdir/../../ # TODO: HOMEgfs had to be hard-coded in config
echo $HOMEgfs
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

# Create test run directory
Expand Down
2 changes: 1 addition & 1 deletion test/check_valid_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import pathlib
import sys
from pygw.yaml_file import YAMLFile
from wxflow.yaml_file import YAMLFile


def check_valid_yaml(repodir):
Expand Down
2 changes: 1 addition & 1 deletion test/soca/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ add_test(NAME test_gdasapp_soca_obsdb
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/test/soca/obs/)
set_tests_properties(test_gdasapp_soca_obsdb
PROPERTIES
ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/ush:${PROJECT_SOURCE_DIR}/../../ush/python/pygw/src:$ENV{PYTHONPATH};SOCA_TEST_OBS=${PROJECT_SOURCE_DIR}/test/soca/testdata")
ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/ush:${PROJECT_SOURCE_DIR}/../../ush/python/wxflow/src:$ENV{PYTHONPATH};SOCA_TEST_OBS=${PROJECT_SOURCE_DIR}/test/soca/testdata")

# Test exgdas scripts from the global-worflow
if (WORKFLOW_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion test/soca/gw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_test(NAME test_gdasapp_soca_prep
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/test/soca/gw)
set_tests_properties(test_gdasapp_soca_prep
PROPERTIES
ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/ush:${PROJECT_SOURCE_DIR}/../../ush/python/pygw/src:$ENV{PYTHONPATH}")
ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/ush:${PROJECT_SOURCE_DIR}/../../ush/python/wxflow/src:$ENV{PYTHONPATH}")

# Identify machine
set(MACHINE "container")
Expand Down
4 changes: 2 additions & 2 deletions ush/ioda/gen_bufr2ioda_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# and certain configuration parameters
import argparse
import os
from pygw.template import Template, TemplateConstants
from pygw.yaml_file import YAMLFile
from wxflow.template import Template, TemplateConstants
from wxflow.yaml_file import YAMLFile


# list of satellite radiance BUFR files that need split by SatId
Expand Down
4 changes: 2 additions & 2 deletions ush/run_jedi_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import subprocess
import sys
import yaml
import pygw
from pygw.yaml_file import parse_j2yaml, save_as_yaml
import wxflow
from wxflow.yaml_file import parse_j2yaml, save_as_yaml


def export_envar(yamlfile, bashout):
Expand Down
2 changes: 1 addition & 1 deletion ush/soca/run_jjobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def export_env_vars_script(self):
self.f.write(f"export CDATE='{CDATE}'\n")

# Add to python environement
self.f.write("PYTHONPATH=${HOMEgfs}/ush/python/pygw/src:${PYTHONPATH}\n")
self.f.write("PYTHONPATH=${HOMEgfs}/ush/python/wxflow/src:${PYTHONPATH}\n")

def setupexpt(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion ush/socaincr2mom6.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from netCDF4 import Dataset
from scipy.interpolate import griddata
import ufsda
from pygw.yaml_file import YAMLFile
from wxflow.yaml_file import YAMLFile


def socaincr2mom6(incr, bkg, grid, incr_out, nsst_yaml=None):
Expand Down
2 changes: 1 addition & 1 deletion ush/ufsda/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shutil
import datetime as dt
import ufsda
from pygw.yaml_file import YAMLFile
from wxflow.yaml_file import YAMLFile

__all__ = ['atm_diags']

Expand Down
4 changes: 2 additions & 2 deletions ush/ufsda/genYAML.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import os
import re
import yaml
from pygw.template import Template, TemplateConstants
from pygw.yaml_file import YAMLFile
from wxflow.template import Template, TemplateConstants
from wxflow.yaml_file import YAMLFile


def genYAML(yamlconfig, output=None):
Expand Down
2 changes: 1 addition & 1 deletion ush/ufsda/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import logging
import glob
import numpy as np
from pygw.yaml_file import YAMLFile, parse_yaml, parse_j2yaml
from wxflow.yaml_file import YAMLFile, parse_yaml, parse_j2yaml
import ufsda.soca_utils

__all__ = ['atm_background', 'atm_obs', 'bias_obs', 'background', 'background_ens', 'fv3jedi', 'obs', 'berror', 'gdas_fix', 'gdas_single_cycle']
Expand Down
4 changes: 2 additions & 2 deletions ush/ufsda/yamltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from solo.yaml_file import YAMLFile
from solo.template import TemplateConstants, Template
from ufsda.misc_utils import isTrue
import pygw
import wxflow

logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s',
level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S')
Expand Down Expand Up @@ -36,7 +36,7 @@ def save_check(config, target, app='var'):
config['cost function']['observations']['observers'] = cleaned_obs_spaces

# save cleaned yaml
pygw.yaml_file.save_as_yaml(config, target)
wxflow.yaml_file.save_as_yaml(config, target)


def parse_config(input_config_dict, template=None, clean=True):
Expand Down

0 comments on commit 58725c1

Please sign in to comment.