Skip to content

Commit 93d3b07

Browse files
committed
-
1 parent 7146583 commit 93d3b07

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

python_toolbox/math_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numbers
99

1010

11-
def sign(x):
11+
def get_sign(x):
1212
'''Get the sign of a number.'''
1313
if x > 0:
1414
return 1
@@ -45,7 +45,7 @@ def convert_to_base_in_tuple(number, base):
4545
assert isinstance(number, numbers.Integral)
4646
assert isinstance(base, numbers.Integral)
4747
assert base >= 2
48-
sign_ = sign(number)
48+
sign_ = get_sign(number)
4949
if sign_ == 0:
5050
return (0,)
5151
elif sign_ == -1:

python_toolbox/wx_tools/widgets/knob/knob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ def _angle_to_ratio(self, angle):
154154
def _ratio_to_value(self, ratio):
155155
'''Convert from ratio to value.'''
156156
return self.sensitivity * \
157-
math_tools.sign(ratio) * \
157+
math_tools.get_sign(ratio) * \
158158
(4 / math.pi**2) * \
159159
math.log(math.cos(ratio * math.pi / 2))**2
160160

161161
def _value_to_ratio(self, value):
162162
'''Convert from value to ratio.'''
163-
return math_tools.sign(value) * \
163+
return math_tools.get_sign(value) * \
164164
(2 / math.pi) * \
165165
math.acos(
166166
math.exp(

test_python_toolbox/test_sequence_tools/test_parse_slice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def test():
3030

3131
# Replacing `infinity` with huge number cause Python's lists can't
3232
# handle `infinity`:
33-
if abs(start) == infinity: start = 10**10 * math_tools.sign(start)
34-
if abs(stop) == infinity: stop = 10**10 * math_tools.sign(stop)
35-
if abs(step) == infinity: step = 10**10 * math_tools.sign(step)
33+
if abs(start) == infinity: start = 10**10 * math_tools.get_sign(start)
34+
if abs(stop) == infinity: stop = 10**10 * math_tools.get_sign(stop)
35+
if abs(step) == infinity: step = 10**10 * math_tools.get_sign(step)
3636
#######################################################################
3737

3838
assert [start, stop, step].count(None) == 0

0 commit comments

Comments
 (0)