[med-svn] [invesalius] 01/01: d/p/20: Avoid division by zero, Closes: #779655

Gert Wollny gewo at moszumanska.debian.org
Fri Sep 15 08:36:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

gewo pushed a commit to branch master
in repository invesalius.

commit 5a3d1240b0dc9a7e8f49ddc659842c914c949b88
Author: Gert Wollny <gewo at debian.org>
Date:   Fri Sep 15 08:36:41 2017 +0000

    d/p/20: Avoid division by zero, Closes: #779655
---
 debian/patches/10_import_cython_modules.patch | 20 +++++---------------
 debian/patches/20_fix_division_by_zero.patch  | 18 ++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/debian/patches/10_import_cython_modules.patch b/debian/patches/10_import_cython_modules.patch
index 0aded21..00fe63a 100644
--- a/debian/patches/10_import_cython_modules.patch
+++ b/debian/patches/10_import_cython_modules.patch
@@ -2,11 +2,9 @@ Author: Thiago Franco Moraes
 Last-Update: 2016-10-06 14:28:25 +0000
 Description: Import cython modules
 
-diff --git a/invesalius/data/mask.py b/invesalius/data/mask.py
-index d00d22e..be9423a 100644
 --- a/invesalius/data/mask.py
 +++ b/invesalius/data/mask.py
-@@ -30,7 +30,7 @@ import invesalius.constants as const
+@@ -30,7 +30,7 @@
  import invesalius.data.imagedata_utils as iu
  import invesalius.session as ses
  
@@ -15,11 +13,9 @@ index d00d22e..be9423a 100644
  
  from wx.lib.pubsub import pub as Publisher
  from scipy import ndimage
-diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py
-index 48f6f46..59bdf7f 100644
 --- a/invesalius/data/slice_.py
 +++ b/invesalius/data/slice_.py
-@@ -31,9 +31,9 @@ import invesalius.session as ses
+@@ -31,9 +31,9 @@
  import invesalius.utils as utils
  from invesalius.data.mask import Mask
  from invesalius.project import Project
@@ -31,11 +27,9 @@ index 48f6f46..59bdf7f 100644
  import invesalius.data.transformations as transformations
  OTHER=0
  PLIST=1
-diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py
-index fc3b67f..8063b59 100644
 --- a/invesalius/data/styles.py
 +++ b/invesalius/data/styles.py
-@@ -45,7 +45,7 @@ from skimage.morphology import watershed
+@@ -45,7 +45,7 @@
  import invesalius.gui.dialogs as dialogs
  from invesalius.data.measures import MeasureData
  
@@ -44,11 +38,9 @@ index fc3b67f..8063b59 100644
  
  import invesalius.data.watershed_process as watershed_process
  import invesalius.utils as utils
-diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py
-index 8845085..603c20c 100644
 --- a/invesalius/data/surface.py
 +++ b/invesalius/data/surface.py
-@@ -37,7 +37,7 @@ import invesalius.data.surface_process as surface_process
+@@ -48,7 +48,7 @@
  import invesalius.utils as utl
  import invesalius.data.vtk_utils as vu
  
@@ -57,11 +49,9 @@ index 8845085..603c20c 100644
  # TODO: Verificar ReleaseDataFlagOn and SetSource 
  
  class Surface():
-diff --git a/setup.py b/setup.py
-index cc05315..6913ec4 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -11,26 +11,26 @@ import numpy
+@@ -11,26 +11,26 @@
  if sys.platform == 'linux2':
      setup(
          cmdclass = {'build_ext': build_ext},
diff --git a/debian/patches/20_fix_division_by_zero.patch b/debian/patches/20_fix_division_by_zero.patch
new file mode 100644
index 0000000..4df2b6a
--- /dev/null
+++ b/debian/patches/20_fix_division_by_zero.patch
@@ -0,0 +1,18 @@
+Description: Avoid division by zero in progress display 
+Author: Gert Wollny <gewo at debian.org>
+Debian-Bug: https://bugs.debian.org/779655
+
+--- a/invesalius/data/vtk_utils.py
++++ b/invesalius/data/vtk_utils.py
+@@ -49,7 +49,10 @@
+ 
+     # when the pipeline is larger than 1, we have to consider this object
+     # percentage
+-    ratio = (100.0 / number_of_filters)
++    if number_of_filters > 0: 
++        ratio = (100.0 / number_of_filters)
++    else:
++        ratio = 100.0
+ 
+     def UpdateProgress(obj, label=""):
+         """
diff --git a/debian/patches/series b/debian/patches/series
index b3dac6e..9ea65a7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 10_sample_path.patch
 10_import_cython_modules.patch
+20_fix_division_by_zero.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/invesalius.git



More information about the debian-med-commit mailing list