Skip to content

Commit

Permalink
Fix issues from scrutiniser inspection results.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Nov 7, 2017
1 parent 7af1e1a commit 98b5272
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 4 additions & 2 deletions colour/continuous/abstract.py
Expand Up @@ -150,7 +150,7 @@ def _get_dtype(self):
Abstract continuous function dtype.
"""

return self._dtype
pass

def _set_dtype(self, value):
"""
Expand All @@ -160,6 +160,8 @@ def _set_dtype(self, value):

pass

domain = abstractproperty(_get_dtype, _set_dtype)

def _get_domain(self):
"""
Getter and setter property for the abstract continuous function
Expand Down Expand Up @@ -694,7 +696,7 @@ def __ipow__(self, a):
return self.arithmetical_operation(a, '**', True)

@abstractmethod
def arithmetical_operation(self, a, operation, in_place):
def arithmetical_operation(self, a, operation, in_place=False):
"""
Performs given arithmetical operation with :math:`a` operand, the
operation can be either performed on a copy or in-place, must be
Expand Down
15 changes: 15 additions & 0 deletions colour/continuous/signal.py
Expand Up @@ -845,6 +845,21 @@ def _create_function(self):
else:

def _undefined_function(*args, **kwargs):
"""
Raises a `RuntimeError` exception.
Other Parameters
----------------
\*args : list, optional
Arguments.
\**kwargs : dict, optional
Keywords arguments.
Raises
------
RuntimeError
"""

raise RuntimeError(
'Underlying signal interpolator function does not exists, '
'please ensure you defined both '
Expand Down
4 changes: 2 additions & 2 deletions colour/continuous/tests/test_signal.py
Expand Up @@ -475,12 +475,12 @@ def test_arithmetical_operation(self):

np.testing.assert_array_almost_equal(
signal.arithmetical_operation(self._range, '+', False).range,
signal._range + self._range,
signal.range + self._range,
decimal=7)

np.testing.assert_array_almost_equal(
signal.arithmetical_operation(signal, '+', False).range,
signal._range + signal._range,
signal.range + signal._range,
decimal=7)

def test_is_uniform(self):
Expand Down
2 changes: 1 addition & 1 deletion colour/utilities/tests/test_array.py
Expand Up @@ -237,7 +237,7 @@ def test_interval(self):
np.testing.assert_almost_equal(
interval([1, 2, 3, 4, 6, 6.5]), np.array([0.5, 1.0, 2.0]))

self.equal = np.testing.assert_almost_equal(
np.testing.assert_almost_equal(
interval([1, 2, 3, 4, 6, 6.5], False),
np.array([1.0, 1.0, 1.0, 2.0, 0.5]))

Expand Down

0 comments on commit 98b5272

Please sign in to comment.