File: fix-test.patch

package info (click to toggle)
meep-openmpi 1.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 25,828 kB
  • sloc: cpp: 27,370; python: 10,574; lisp: 1,213; makefile: 437; sh: 28
file content (16 lines) | stat: -rw-r--r-- 653 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: patch to avoid division by zero
             (cherry picked for this version)
Author: upstream deevlopers
diff --git a/python/simulation.py b/python/simulation.py
index 2671225..cbe2b32 100644
--- a/python/simulation.py
+++ b/python/simulation.py
@@ -418,7 +418,7 @@ class Harminv(object):
 
         modes = []
         for freq, amp, err in bands:
-            Q = freq.real / (-2 * freq.imag)
+            Q = freq.real / (-2 * freq.imag) if freq.imag != 0 else float('inf')
             modes.append(Mode(freq.real, freq.imag, Q, amp, err))
             display_run_data(sim, 'harminv', [freq.real, freq.imag, Q, abs(amp), amp, err])