You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2014/06/20 17:51:48 UTC
[1/4] git commit: CLIMATE-476 - Add __str__ implementation to Dataset
Repository: climate
Updated Branches:
refs/heads/master 79f20d4ab -> 0951a933e
CLIMATE-476 - Add __str__ implementation to Dataset
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/a2a072f9
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/a2a072f9
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/a2a072f9
Branch: refs/heads/master
Commit: a2a072f9b388cb88544ba2e4e829d27d78b01c3a
Parents: ab179cb
Author: Michael Joyce <jo...@apache.org>
Authored: Thu Jun 19 12:32:33 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Thu Jun 19 12:32:33 2014 -0700
----------------------------------------------------------------------
ocw/dataset.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/a2a072f9/ocw/dataset.py
----------------------------------------------------------------------
diff --git a/ocw/dataset.py b/ocw/dataset.py
index 80ab18e..0621255 100644
--- a/ocw/dataset.py
+++ b/ocw/dataset.py
@@ -178,6 +178,29 @@ Expected shape (%s, %s, %s) but received (%s, %s, %s)""" % (time_count,
logger.error(err_msg)
raise ValueError(err_msg)
+ def __str__(self):
+ lat_min, lat_max, lon_min, lon_max = self.spatial_boundaries()
+ start, end = self.time_range()
+ lat_range = "({}, {})".format(lat_min, lon_min)
+ lon_range = "({}, {})".format(lon_min, lon_min)
+ time_range = "({}, {})".format(start, end)
+
+ formatted_repr = (
+ "<Dataset - name: {}, "
+ "lat-range: {}, "
+ "lon-range: {}, "
+ "time_range: {}, "
+ "var: {}>"
+ )
+
+ return formatted_repr.format(
+ self.name if self.name != "" else None,
+ lat_range,
+ lon_range,
+ time_range,
+ self.variable
+ )
+
class Bounds(object):
'''Container for holding spatial and temporal bounds information.
[3/4] git commit: CLIMATE-476 - Add __str__ implementation to
Evaluation
Posted by go...@apache.org.
CLIMATE-476 - Add __str__ implementation to Evaluation
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/be6b4b85
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/be6b4b85
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/be6b4b85
Branch: refs/heads/master
Commit: be6b4b85d9a04d2d854feda27ccbaa761f43037a
Parents: cf7395a
Author: Michael Joyce <jo...@apache.org>
Authored: Thu Jun 19 12:49:57 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Thu Jun 19 12:49:57 2014 -0700
----------------------------------------------------------------------
ocw/evaluation.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/be6b4b85/ocw/evaluation.py
----------------------------------------------------------------------
diff --git a/ocw/evaluation.py b/ocw/evaluation.py
index 9f7dfee..a27a27f 100644
--- a/ocw/evaluation.py
+++ b/ocw/evaluation.py
@@ -299,3 +299,20 @@ class Evaluation(object):
unary_results[-1].append(metric.run(target))
return unary_results
+ def __str__(self):
+ formatted_repr = (
+ "<Evaluation - ref_dataset: {}, "
+ "target_dataset(s): {}, "
+ "binary_metric(s): {}, "
+ "unary_metric(s): {}, "
+ "subregion(s): {}>"
+ )
+
+ return formatted_repr.format(
+ str(self._ref_dataset),
+ [str(ds) for ds in self.target_datasets],
+ [str(m) for m in self.metrics],
+ [str(m) for m in self.unary_metrics],
+ str(self.subregions)
+ )
+
[4/4] git commit: Merge branch 'CLIMATE-476'
Posted by go...@apache.org.
Merge branch 'CLIMATE-476'
- Closes PR#79
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/0951a933
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/0951a933
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/0951a933
Branch: refs/heads/master
Commit: 0951a933ededa0148fba08d3f7932b33a2584704
Parents: 79f20d4 be6b4b8
Author: cgoodale <si...@gmail.com>
Authored: Fri Jun 20 08:50:13 2014 -0700
Committer: cgoodale <si...@gmail.com>
Committed: Fri Jun 20 08:50:13 2014 -0700
----------------------------------------------------------------------
ocw/dataset.py | 41 +++++++++++++++++++++++++++++++++++++++++
ocw/evaluation.py | 17 +++++++++++++++++
2 files changed, 58 insertions(+)
----------------------------------------------------------------------
[2/4] git commit: CLIMATE-476 - Add __str__ implementation to Bounds
Posted by go...@apache.org.
CLIMATE-476 - Add __str__ implementation to Bounds
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/cf7395ab
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/cf7395ab
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/cf7395ab
Branch: refs/heads/master
Commit: cf7395aba2ca7e7a4493d5e9bdd1eb9ccaf13b6f
Parents: a2a072f
Author: Michael Joyce <jo...@apache.org>
Authored: Thu Jun 19 12:37:11 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Thu Jun 19 12:37:11 2014 -0700
----------------------------------------------------------------------
ocw/dataset.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/cf7395ab/ocw/dataset.py
----------------------------------------------------------------------
diff --git a/ocw/dataset.py b/ocw/dataset.py
index 0621255..6cb5e24 100644
--- a/ocw/dataset.py
+++ b/ocw/dataset.py
@@ -324,3 +324,21 @@ class Bounds(object):
raise ValueError(error)
self._end = value
+
+ def __str__(self):
+ lat_range = "({}, {})".format(self._lat_min, self._lon_min)
+ lon_range = "({}, {})".format(self._lon_min, self._lon_min)
+ time_range = "({}, {})".format(self._start, self._end)
+
+ formatted_repr = (
+ "<Bounds - "
+ "lat-range: {}, "
+ "lon-range: {}, "
+ "time_range: {}> "
+ )
+
+ return formatted_repr.format(
+ lat_range,
+ lon_range,
+ time_range,
+ )