You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/11/06 00:28:23 UTC
[1/3] git commit: CLIMATE-549: Update variable names in RMSError
Repository: climate
Updated Branches:
refs/heads/master 7deda4000 -> 3e8d1bf0b
CLIMATE-549: Update variable names in RMSError
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8a69a1c8
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8a69a1c8
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8a69a1c8
Branch: refs/heads/master
Commit: 8a69a1c851d1e9575ecbda71fe272ec0e506338f
Parents: 7deda40
Author: rlaidlaw <rl...@gmail.com>
Authored: Wed Nov 5 15:15:58 2014 -0800
Committer: rlaidlaw <rl...@gmail.com>
Committed: Wed Nov 5 15:15:58 2014 -0800
----------------------------------------------------------------------
ocw/metrics.py | 13 +++++++------
ocw/tests/test_metrics.py | 22 +++++++++++-----------
2 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/8a69a1c8/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index fb7bce3..eae3d07 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -201,22 +201,23 @@ class RMSError(BinaryMetric):
'''Calculate the Root Mean Square Difference (RMS Error), with the mean
calculated over time and space.'''
- def run(self, eval_dataset, ref_dataset):
+ def run(self, reference_dataset, target_dataset):
'''Calculate the Root Mean Square Difference (RMS Error), with the mean
calculated over time and space.
.. note::
Overrides BinaryMetric.run()
- :param eval_dataset: The dataset to evaluate against the reference
- dataset
- :type eval_dataset: ocw.dataset.Dataset object
- :param ref_dataset: The reference dataset for the metric
+ :param reference_dataset: The reference dataset to use in this metric
+ run
+ :type reference_dataset: ocw.dataset.Dataset object
+ :param target_dataset: The target dataset to evaluate against the
+ reference dataset in this metric run
:type target_dataset: ocw.dataset.Dataset object
:returns: The RMS error, with the mean calculated over time and space
'''
- sqdiff = (eval_dataset.values - ref_dataset.values) ** 2
+ sqdiff = (reference_dataset.values - target_dataset.values) ** 2
return numpy.sqrt(sqdiff.mean())
http://git-wip-us.apache.org/repos/asf/climate/blob/8a69a1c8/ocw/tests/test_metrics.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_metrics.py b/ocw/tests/test_metrics.py
index a2ca025..affb937 100644
--- a/ocw/tests/test_metrics.py
+++ b/ocw/tests/test_metrics.py
@@ -202,27 +202,27 @@ class TestRMSError(unittest.TestCase):
def setUp(self):
# Set metric.
self.metric = metrics.RMSError()
- # Initialize evaluation dataset.
- self.eval_lats = np.array([10, 20, 30, 40, 50])
- self.eval_lons = np.array([5, 15, 25, 35, 45])
- self.eval_times = np.array([dt.datetime(2000, x, 1)
- for x in range(1, 13)])
- self.eval_values = np.array([4] * 300).reshape(12, 5, 5)
- self.eval_variable = "eval"
- self.eval_dataset = Dataset(self.eval_lats, self.eval_lons,
- self.eval_times, self.eval_values, self.eval_variable)
# Initialize reference dataset.
self.ref_lats = np.array([10, 20, 30, 40, 50])
self.ref_lons = np.array([5, 15, 25, 35, 45])
self.ref_times = np.array([dt.datetime(2000, x, 1)
for x in range(1, 13)])
- self.ref_values = np.array([2] * 300).reshape(12, 5, 5)
+ self.ref_values = np.array([4] * 300).reshape(12, 5, 5)
self.ref_variable = "ref"
self.ref_dataset = Dataset(self.ref_lats, self.ref_lons,
self.ref_times, self.ref_values, self.ref_variable)
+ # Initialize target dataset.
+ self.tgt_lats = np.array([10, 20, 30, 40, 50])
+ self.tgt_lons = np.array([5, 15, 25, 35, 45])
+ self.tgt_times = np.array([dt.datetime(2000, x, 1)
+ for x in range(1, 13)])
+ self.tgt_values = np.array([2] * 300).reshape(12, 5, 5)
+ self.tgt_variable = "tgt"
+ self.tgt_dataset = Dataset(self.tgt_lats, self.tgt_lons,
+ self.tgt_times, self.tgt_values, self.tgt_variable)
def test_function_run(self):
- result = self.metric.run(self.eval_dataset, self.ref_dataset)
+ result = self.metric.run(self.ref_dataset, self.tgt_dataset)
self.assertEqual(result, 2.0)
[2/3] git commit: CLIMATE-549: Correct comments in
SpatialMeanOfTemporalMeanBias
Posted by jo...@apache.org.
CLIMATE-549: Correct comments in SpatialMeanOfTemporalMeanBias
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/bc86cf39
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/bc86cf39
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/bc86cf39
Branch: refs/heads/master
Commit: bc86cf39ba8d1d819e104ea6ec2710edcc4fa047
Parents: 8a69a1c
Author: rlaidlaw <rl...@gmail.com>
Authored: Wed Nov 5 15:18:49 2014 -0800
Committer: rlaidlaw <rl...@gmail.com>
Committed: Wed Nov 5 15:18:49 2014 -0800
----------------------------------------------------------------------
ocw/metrics.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/bc86cf39/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index eae3d07..ee5c1f9 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -184,8 +184,9 @@ class SpatialMeanOfTemporalMeanBias(BinaryMetric):
.. note::
Overrides BinaryMetric.run()
- :param ref_dataset: The reference dataset to use in this metric run
- :type ref_dataset: ocw.dataset.Dataset object
+ :param reference_dataset: The reference dataset to use in this metric
+ run
+ :type reference_dataset: ocw.dataset.Dataset object
:param target_dataset: The target dataset to evaluate against the
reference dataset in this metric run
:type target_dataset: ocw.dataset.Dataset object
[3/3] git commit: Resolve CLIMATE-549. Merge PR #126.
Posted by jo...@apache.org.
Resolve CLIMATE-549. Merge PR #126.
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/3e8d1bf0
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/3e8d1bf0
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/3e8d1bf0
Branch: refs/heads/master
Commit: 3e8d1bf0ba32e563cc238d2a1fc1a6ac0ba04f21
Parents: 7deda40 bc86cf3
Author: Michael Joyce <jo...@apache.org>
Authored: Wed Nov 5 15:27:55 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Wed Nov 5 15:27:55 2014 -0800
----------------------------------------------------------------------
ocw/metrics.py | 18 ++++++++++--------
ocw/tests/test_metrics.py | 22 +++++++++++-----------
2 files changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------