Skip to content

Commit

Permalink
Merge pull request #524 from PCMDI/cia
Browse files Browse the repository at this point in the history
Cia
  • Loading branch information
doutriaux1 committed Feb 12, 2018
2 parents dddf781 + 07cd539 commit ffdebf8
Show file tree
Hide file tree
Showing 21 changed files with 230 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ before_install:
- conda update -y -q conda

script:
- conda create -q -n py2 -c uvcdat/label/nightly -c conda-forge -c uvcdat vcs vcsaddons cdp mesalib image-compare flake8 nose
- conda create -q -n py2 -c uvcdat/label/nightly -c conda-forge -c uvcdat -c pcmdi vcs vcsaddons cdp mesalib image-compare flake8 nose cia
# Useful for debugging any issues with conda
- conda info -a
- source activate py2
Expand Down
15 changes: 8 additions & 7 deletions recipes/pcmdi_metrics/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package:
name: pcmdi_metrics
version: 1.1.2
version: 2.12.2018.02.08.16.44.{{ GIT_FULL_HASH }}

source:
git_url: git:https://github.com/PCMDI/pcmdi_metrics
git_rev: 1.1.2
git_rev: master

build:
script: python setup.py install
Expand All @@ -16,14 +16,15 @@ requirements:
- setuptools
- numpy
run:
- vcs ==2.10
- vcsaddons ==2.10
- cdms2 ==2.10
- genutil ==2.10
- cdutil ==2.10
- vcs >=2.10
- vcsaddons >=2.10
- cdms2 >=2.10
- genutil >=2.10
- cdutil >=2.10
- cdp
- matplotlib
- numpy
- cia


about:
Expand Down
1 change: 1 addition & 0 deletions recipes/pcmdi_metrics/meta.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ requirements:
- cdp
- matplotlib
- numpy
- cia


about:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
# test = True

P = pmp_parser.PMPParser(
description='Runs PCMDI Monsoon Computations',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
description='Runs PCMDI Monsoon Computations')

P.add_argument("-j", "--json",
type=str,
Expand Down
3 changes: 1 addition & 2 deletions src/python/diurnal/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import genutil
import argparse
from pcmdi_metrics.driver.pmp_parser import PMPParser

monthname_d = {1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun',
Expand All @@ -23,7 +22,7 @@ def populateStringConstructor(template, args):
return template


P = PMPParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
P = PMPParser()
P.add_argument("-i", "--modroot",
default='data',
help="Root directory for model (or observed) 3-hourly data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import genutil
import MV2
import os
import sys
import glob
import cdtime
import cdp
Expand Down Expand Up @@ -175,7 +174,7 @@ def compute(params):


print 'done'
args = P.parse_args(sys.argv[1:])
args = P.get_parameter()

month = args.month
monthname = monthname_d[args.month]
Expand Down
3 changes: 1 addition & 2 deletions src/python/diurnal/scripts/computeStdDailyMeansWrapped.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import numpy.ma
import os
import glob
import sys
import cdp

from pcmdi_metrics.diurnal.common import monthname_d, P, populateStringConstructor, INPUT
Expand Down Expand Up @@ -94,7 +93,7 @@ def compute(params):
g.close()


args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
startyear = args.firstyear
finalyear = args.lastyear
Expand Down
3 changes: 1 addition & 2 deletions src/python/diurnal/scripts/fourierDiurnalAllGridWrapped.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import cdms2
import MV2
from pcmdi_metrics.diurnal.fourierFFT import fastAllGridFT
import sys
import glob
import os

Expand All @@ -27,7 +26,7 @@
default="pr_%(model)_LocalSolarTimes.nc",
help="template for file names point to Local Solar Time Files")

args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
monthname = monthname_d[month]
startyear = args.firstyear
Expand Down
3 changes: 1 addition & 2 deletions src/python/diurnal/scripts/fourierDiurnalGridpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from __future__ import print_function
import cdms2
import MV2
import sys
import glob
import os

Expand Down Expand Up @@ -50,7 +49,7 @@
dest='outnameasc',
default='pr_%(month)_%(firstyear)-%(lastyear)_fourierDiurnalGridPoints.asc',
help="Output name for ascs")
args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
monthname = monthname_d[month]
startyear = args.firstyear
Expand Down
2 changes: 1 addition & 1 deletion src/python/diurnal/scripts/savg_fourierWrappedInOut.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
help="template for sftlf file names")
P.add_argument("--model", default="*")

args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
monthname = monthname_d[month]
startyear = args.firstyear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def compute(param):
default="pr_%(model)_%(month)_%(firstyear)-%(lastyear)_std_of_dailymeans.nc")
P.add_argument("--model", default="*")

args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
monthname = monthname_d[month]
startyear = args.firstyear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def compute(param):
default="pr_%(model)_%(month)_%(firstyear)-%(lastyear)_diurnal_std.nc")
P.add_argument("--model", default="*")

args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
monthname = monthname_d[month]
startyear = args.firstyear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def compute(param):
default="pr_%(model)_%(month)_%(firstyear)-%(lastyear)_diurnal_avg.nc")
P.add_argument("--model", default="*")

args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
month = args.month
monthname = monthname_d[month]
startyear = args.firstyear
Expand Down
3 changes: 2 additions & 1 deletion src/python/monsoon_wang/scripts/mpindex_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
help="Threshold for a hit when computing skill score")


args = P.parse_args(sys.argv[1:])
# args = P.parse_args(sys.argv[1:])
args = P.get_parameter()
modpath = args.modpath
outpathjsons = args.outpathjsons
outpathdata = args.outpathdata
Expand Down
7 changes: 4 additions & 3 deletions src/python/pcmdi/scripts/driver/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def create_sftlf(parameter):
sftlf = {}

for test in parameter.test_data_set:
sft = Base(parameter.test_data_path,
getattr(parameter, "sftlf_filename_template",
parameter.filename_template))
tmp_name = getattr(parameter, "sftlf_filename_template")
if tmp_name is None: # Not defined from commandline or param file
tmp_name = parameter.filename_template
sft = Base(parameter.test_data_path, tmp_name)
sft.model_version = test
sft.table = "fx"
sft.realm = "atmos"
Expand Down
5 changes: 5 additions & 0 deletions src/python/pcmdi/scripts/driver/pmp_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@


class PMPParameter(cdp.cdp_parameter.CDPParameter):
def __init__(self):
logging.getLogger("pmp").setLevel(LOG_LEVEL)


class PMPMetricsParameter(cdp.cdp_parameter.CDPParameter):
def __init__(self):
logging.getLogger("pcmdi_metrics").setLevel(LOG_LEVEL)

Expand Down
Loading

0 comments on commit ffdebf8

Please sign in to comment.