Skip to content

Commit f893d31

Browse files
author
David Lonie
committed
Merge pull request #865 from UV-CDAT/issue_850_mkscale_great_range
fix #850
2 parents c1f12c9 + 661b7cf commit f893d31

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

Packages/vcs/Lib/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ def minmax(*data) :
662662
Function : minmax
663663
Description of Function
664664
Return the minimum and maximum of a serie of array/list/tuples (or combination of these)
665-
Values those absolute value are greater than 1.E20, are masked
666665
You can combined list/tuples/... pretty much any combination is allowed
667666
668667
Examples of Use
@@ -682,9 +681,8 @@ def minmax(*data) :
682681
def myfunction(d,mx,mn):
683682
if d is None:
684683
return mx,mn
685-
from numpy.ma import maximum,minimum,masked_where,absolute,greater,count
684+
from numpy.ma import maximum,minimum,count
686685
try:
687-
d=masked_where(greater(absolute(d),9.9E19),d)
688686
if count(d)==0 : return mx,mn
689687
mx=float(maximum(mx,float(maximum(d))))
690688
mn=float(minimum(mn,float(minimum(d))))

testing/vcs/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ add_test(vcs_verify_init
2020
${CMAKE_INSTALL_PREFIX}/bin/python
2121
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_init.py
2222
)
23+
add_test(vcs_mkscale_great_range
24+
${CMAKE_INSTALL_PREFIX}/bin/python
25+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_mkscale_great_range.py
26+
)
2327
add_test(vcs_verify_boxfill_basics
2428
${CMAKE_INSTALL_PREFIX}/bin/python
2529
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_boxfill_basics_no_plot.py
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import vcs,numpy
2+
3+
assert numpy.allclose(vcs.mkscale(0,1.e35,16) , [0.0, 9.9999999999999995e+33, 1.9999999999999999e+34, 2.9999999999999997e+34, 3.9999999999999998e+34, 4.9999999999999998e+34, 5.9999999999999994e+34, 7e+34, 7.9999999999999996e+34, 9.0000000000000001e+34, 9.9999999999999997e+34])

0 commit comments

Comments
 (0)