File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
test_python_toolbox/test_sequence_tools Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 88import 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 :
Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments