Skip to content

Commit

Permalink
Improved range method docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Sep 12, 2018
1 parent 458c0a5 commit c50200a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
13 changes: 10 additions & 3 deletions holoviews/core/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,16 @@ def sort(self, by=[], reverse=False):

def range(self, dim, data_range=True, dimension_range=True):
"""
Computes the range of values along a supplied dimension, taking
into account the range and soft_range defined on the Dimension
object.
Returns the range of values along the specified dimension.
dimension: str/int/Dimension
The dimension to compute the range on.
data_range: bool
Whether the range should include the data range or only
the dimension ranges
dimension_range:
Whether to compute the range including the Dimension range
and soft_range
"""
dim = self.get_dimension(dim)

Expand Down
11 changes: 8 additions & 3 deletions holoviews/core/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,14 @@ def range(self, dimension, data_range=True, dimension_range=True):
"""
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer
the appropriate range. Otherwise, (None,None) is returned to
indicate that no range is defined.
dimension: str or int or Dimension
The dimension to compute the range on.
data_range: bool (optional)
Whether the range should include the data range or only
the dimension ranges
dimension_range: bool (optional)
Whether to compute the range including the Dimension range
and soft_range.
"""
dimension = self.get_dimension(dimension)
if dimension is None or (not data_range and not dimension_range):
Expand Down

0 comments on commit c50200a

Please sign in to comment.