[
https://issues.apache.org/jira/browse/CLIMATE-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Huikyo Lee resolved CLIMATE-168.
--------------------------------
Resolution: Fixed
> Refactored Functions in metrics.py return a different number of variables
> -------------------------------------------------------------------------
>
> Key: CLIMATE-168
> URL: https://issues.apache.org/jira/browse/CLIMATE-168
> Project: Apache Open Climate Workbench
> Issue Type: Bug
> Components: metrics, rcmet
> Affects Versions: 0.1-incubating
> Environment: OS X 10.7.4
> Reporter: Cameron Goodale
> Assignee: Huikyo Lee
> Priority: Blocker
> Fix For: 0.1-incubating
>
>
> While testing the command line version of OCW i encountered the following
> error message:
> Traceback (most recent call last):
> File "rcmet.py", line 263, in <module>
> ui.rcmetUI()
> File
> "/Users/cgoodale/Desktop/climate-0.1-incubating-rc3/rcmet/src/main/python/rcmes/cli/rcmet_ui.py",
> line 100, in rcmetUI
> toolkit.metrics.metrics_plots(modelVarName, numOBS, numMDL, nT, ngrdY,
> ngrdX, Times, lons, lats, obsData, mdlData, obsList, mdlName, workDir,
> subRegions, fileOutputOption)
> File
> "/Users/cgoodale/Desktop/climate-0.1-incubating-rc3/rcmet/src/main/python/rcmes/toolkit/metrics.py",
> line 734, in metrics_plots
> mTser, mClim = calcAnnualCycleMeans(mdlData[mdlSelect, :, :, :])
> ValueError: too many values to unpack
> The core problem is that calcAnnualCycleMeans no longer returns a tuple of 2
> values, instead it returns a single value. Python doesn't know how to handle
> this situation so the program crashes.
> Complete List of all Functions in this file that need attention:
> *calcAnnualCycleMeans* - returns 1 value (used to return 2)
> 734 mTser, mClim = calcAnnualCycleMeans(mdlData[mdlSelect, :,
> :, :])
> 735 oTser, oClim = calcAnnualCycleMeans(obsData[mdlSelect, :,
> :, :])
> These lines should also return a more meaningful/descriptive variable name
> and get updated throughout the rest of the code. My comments on variable
> names will be posted in the Comments section so we can discuss it.
> *calcBiasAveragedOverTime* - returns 1 value (used to return 2)
> 754 metricDat, sigLev = calcBiasAveragedOverTime(mTser, oTser,
> 'abs')
> calcPatternCorrelationEachTime - Returns 2 values, but line 920 only expects 1
> Line 920: tempCOR = calcPatternCorrelationEachTime(mdlAnnCyc,
> obsAnnCyc)
> This one might be an easy fix by just adding back in the significanceLevel to
> this line.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira