Skip to content

Commit

Permalink
5% rel diff now, also using Linux Ubuntu diff sinc eit's travis
Browse files Browse the repository at this point in the history
  • Loading branch information
doutriaux1 committed Dec 21, 2017
1 parent 1c31c26 commit 7b6a6ff
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 181 deletions.
4 changes: 2 additions & 2 deletions tests/basepmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def checkAllClose(self, a, b, rtol=1e-05, atol=1e-08):
print "(",
for indx in d:
print "%i," % indx,
print "). Test value %.3f vs expected value: %.3f" % (a[tuple(d)],b[tuple(d)])
print "). Test value %.3f vs expected value: %.3f realtive: %.3f%%" % (a[tuple(d)],b[tuple(d)],abs((a[tuple(d)]-b[tuple(d)])/b[tuple(d)])*100.)
return False
return True

def assertSimilarJsons(self, test_file, correct_file, rtol=1e-05, atol=1e-08, raiseOnError=True):

print "Comparing:",test_file, correct_file, "atol:",atol
print "Comparing:",test_file, correct_file, "atol:",atol,"rtol:",rtol
T = pcmdi_metrics.io.base.JSONs([test_file], oneVariablePerFile=False)
test = T()

Expand Down
2 changes: 1 addition & 1 deletion tests/basepmpdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def runPMP(self,parameterFile):
if self.update:
shutil.copy(fnm, gnm)
else:
correct = self.assertSimilarJsons(fnm, gnm, atol=1.E-2, raiseOnError=False)
correct = self.assertSimilarJsons(fnm, gnm, rtol=5.E-3, atol=0., raiseOnError=False)
allCorrect = allCorrect and correct
if not allCorrect:
raise Exception("Error Encountered on some of the output files, check log")
Expand Down
134 changes: 67 additions & 67 deletions tests/pcmdi/customRegions/tas_2.5x2.5_regrid2_linear_metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
},
"ocean": {
"bias_xy": {
"ann": "-0.539",
"ann": "-0.538",
"son": "-0.723",
"mam": "-0.383",
"jja": "-0.398",
Expand All @@ -300,74 +300,74 @@
"custom_model_max": 303.598876953125,
"mae_xy": {
"ann": "1.593",
"son": "1.570",
"son": "1.569",
"mam": "1.696",
"jja": "1.370",
"djf": "1.962"
"djf": "1.961"
},
"mean-obs_xy": {
"ann": "289.550",
"son": "289.444",
"mam": "289.601",
"ann": "289.544",
"son": "289.439",
"mam": "289.594",
"jja": "289.824",
"djf": "289.331"
"djf": "289.318"
},
"mean_xy": {
"ann": "289.339",
"son": "289.003",
"mam": "289.617",
"jja": "289.633",
"djf": "289.113"
"ann": "289.341",
"son": "289.004",
"mam": "289.619",
"jja": "289.634",
"djf": "289.115"
},
"rms_devzm": {
"ann": "1.028"
"ann": "1.029"
},
"rms_xy": {
"ann": "2.056",
"son": "1.997",
"ann": "2.055",
"son": "1.996",
"mam": "2.294",
"jja": "1.757",
"djf": "2.805"
"djf": "2.804"
},
"rms_xyt": {
"ann": "2.315"
},
"rms_y": {
"ann": "2.452"
"ann": "2.447"
},
"rmsc_xy": {
"ann": "1.984",
"ann": "1.983",
"son": "1.861",
"mam": "2.262",
"jja": "1.711",
"djf": "2.729"
},
"some_custom": 1.5,
"std-obs_xy": {
"ann": "11.461",
"ann": "11.462",
"son": "11.524",
"mam": "11.983",
"jja": "11.501",
"djf": "12.251"
"mam": "11.984",
"jja": "11.498",
"djf": "12.262"
},
"std-obs_xy_devzm": {
"ann": "2.136"
"ann": "2.138"
},
"std-obs_xyt": {
"ann": "11.904"
"ann": "11.907"
},
"std_xy": {
"ann": "10.655",
"son": "10.802",
"mam": "11.102",
"jja": "10.162",
"djf": "12.288"
"ann": "10.652",
"son": "10.800",
"mam": "11.099",
"jja": "10.161",
"djf": "12.283"
},
"std_xy_devzm": {
"ann": "1.869"
},
"std_xyt": {
"ann": "11.230"
"ann": "11.227"
}
},
"NHEX": {
Expand Down Expand Up @@ -482,11 +482,11 @@
"djf": "1.545"
},
"mean-obs_xy": {
"ann": "296.324",
"son": "297.252",
"mam": "295.474",
"jja": "297.728",
"djf": "294.816"
"ann": "296.301",
"son": "297.232",
"mam": "295.447",
"jja": "297.717",
"djf": "294.781"
},
"mean_xy": {
"ann": "295.153",
Expand All @@ -496,7 +496,7 @@
"djf": "293.422"
},
"rms_devzm": {
"ann": "1.119"
"ann": "1.120"
},
"rms_xy": {
"ann": "1.634",
Expand All @@ -509,7 +509,7 @@
"ann": "1.862"
},
"rms_y": {
"ann": "1.256"
"ann": "1.249"
},
"rmsc_xy": {
"ann": "1.160",
Expand All @@ -520,17 +520,17 @@
},
"some_custom": 1.5,
"std-obs_xy": {
"ann": "4.307",
"son": "3.604",
"mam": "5.275",
"jja": "3.559",
"djf": "5.399"
"ann": "4.346",
"son": "3.638",
"mam": "5.317",
"jja": "3.568",
"djf": "5.473"
},
"std-obs_xy_devzm": {
"ann": "1.743"
"ann": "1.747"
},
"std-obs_xyt": {
"ann": "4.778"
"ann": "4.822"
},
"std_xy": {
"ann": "4.324",
Expand Down Expand Up @@ -809,47 +809,47 @@
"provenance": {
"platform": {
"OS": "Linux",
"Version": "2.6.32-696.3.1.el6.x86_64",
"Name": "crunchy.llnl.gov"
"Version": "4.13.0-19-generic",
"Name": "drdoom"
},
"userId": "doutriaux1",
"osAccess": false,
"commandLine": "/export/doutriaux1/miniconda2/envs/dev-nox/bin/pcmdi_metrics_driver.py -p /export/doutriaux1/git/pcmdi_metrics/tests/pcmdi/region_specs_test.py",
"date": "2017-10-12 13:39:27",
"commandLine": "/home/doutriaux1/anaconda2/envs/nightly2/bin/pcmdi_metrics_driver.py -p /git/pcmdi_metrics/tests/pcmdi/region_specs_test.py",
"date": "2017-12-21 15:30:29",
"conda": {
"Platform": "linux-64",
"Version": "4.3.25",
"Version": "4.3.30",
"IsPrivate": "False",
"envVersion": "4.3.25",
"buildVersion": "3.0.15",
"PythonVersion": "2.7.13.final.0",
"RootEnvironment": "/export/doutriaux1/miniconda2 (writable)",
"DefaultEnvironment": "/export/doutriaux1/miniconda2/envs/dev-nox"
"envVersion": "4.3.30",
"buildVersion": "3.0.28",
"PythonVersion": "2.7.14.final.0",
"RootEnvironment": "/home/doutriaux1/anaconda2 (writable)",
"DefaultEnvironment": "/home/doutriaux1/anaconda2/envs/nightly2"
},
"packages": {
"cdms": "2.12",
"CDP": "2017.09.07",
"cdtime": "2.12",
"cdutil": "2.12",
"cdms": "2.12.2017.11.30.06.06.14b9b9380c14680498a0ba8e9aefb4c84d2756be",
"CDP": "1.1.0",
"cdtime": "2017.11.15",
"cdutil": "2.12.2017.11.16.21.46.e717f782e07d0a187f2b616a408103af20ceb57f",
"clapack": "3.2.1",
"lapack": "3.6.1",
"esmf": "7.0.0",
"esmpy": "7.0.0",
"genutil": "2.12",
"python": "2.7.13",
"matplotlib": "1.5.3",
"genutil": "2017.11.15",
"python": "2.7.14",
"matplotlib": "2.1.1",
"mesalib": "17.2.0",
"numpy": "1.13.1",
"vcs": "2.12.2017.09.13.00.29.5669624a25139ad2e19e4af8b921d0571338375d",
"numpy": "1.13.3",
"vcs": "2.12.2017.12.14.17.01.99491e457b26e4e5fbb875e5ba75e7265f5e5b1b",
"vtk": "7.1.0.2.12",
"blas": null,
"PMP": "g8bcb816",
"PMP": "ga6c40fd",
"PMPObs": null
},
"openGL": {
"vendor": "VMware, Inc.",
"renderer": "Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits)",
"version": "2.1 Mesa 11.0.7",
"vendor": "X.Org",
"renderer": "AMD TURKS (DRM 2.50.0 / 4.13.0-19-generic, LLVM 5.0.0)",
"version": "3.0 Mesa 17.2.2",
"shading language version": "1.30",
"GLX": {
"client": {
Expand Down
Loading

0 comments on commit 7b6a6ff

Please sign in to comment.