Skip to content

Commit

Permalink
should pass test suite now
Browse files Browse the repository at this point in the history
  • Loading branch information
doutriaux1 committed Feb 9, 2018
1 parent be034cc commit 171e723
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 24 deletions.
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
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
2 changes: 1 addition & 1 deletion tests/basepmpgraphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def checkImage(self,fnm,src=None,threshold=checkimage.defaultThreshold,pngReady=
print "Test file :",fnm
print "Source file:",src
if not pngReady:
self.x.png(fnm,width=self.x.bgX,height=self.x.bgY,units="pixels")
self.x.png(fnm,width=self.x.width, height=self.x.height, units="pixels")
ret = checkimage.check_result_image(fnm,src,threshold, update_baseline=self.update)
self.assertEqual(ret,0)
return ret
Expand Down
1 change: 1 addition & 0 deletions tests/test_monsoon_wang.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def checkAllClose(self, a, b):
def testMonsoonWang(self):

cmd = 'mpindex_compute.py --mp tests/monsoon/data/pr_1961_1999_MRI-CGCM3_regrid_MODS.nc --op tests/monsoon/obs/pr_gpcp_79_07_mseas.nc --mns "[\'xa\',]" --outpd test_monsoon --outpj test_monsoon --threshold=2.5'
print("CMD:",cmd)
p = subprocess.Popen(shlex.split(cmd))
o, e = p.communicate()

Expand Down

0 comments on commit 171e723

Please sign in to comment.