Skip to content
Snippets Groups Projects

Make sure no division by zero can occur

Merged Andre Offringa requested to merge fix-division-by-zero into master
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
+ 2
1
@@ -218,7 +218,8 @@ class Screen(object):
@@ -218,7 +218,8 @@ class Screen(object):
# Add additional breaks to gaps_ind to keep memory usage within that available
# Add additional breaks to gaps_ind to keep memory usage within that available
if len(self.times_ph) > 2:
if len(self.times_ph) > 2:
available_mem_gb = cluster.get_available_memory()
available_mem_gb = cluster.get_available_memory()
max_ntimes = max(1, int(available_mem_gb / (self.get_memory_usage(cellsize_deg))))
memory_usage = max(1, self.get_memory_usage(cellsize_deg))
 
max_ntimes = max(1, int(available_mem_gb / memory_usage))
check_gaps = True
check_gaps = True
while check_gaps:
while check_gaps:
check_gaps = False
check_gaps = False
Loading