Skip to content

Test failures on MacOS / Arm64 #66

@tskisner

Description

@tskisner

One of the sotodlib unit tests fails on macos arm64:

2025-10-26T03:44:16.0308950Z =================================== FAILURES ===================================
2025-10-26T03:44:16.0330100Z ____________________________ PSDTest.test_wn_debias ____________________________
2025-10-26T03:44:16.0330870Z 
2025-10-26T03:44:16.0331110Z self = <tests.test_psd.PSDTest testMethod=test_wn_debias>
2025-10-26T03:44:16.0331280Z 
2025-10-26T03:44:16.0331420Z     def test_wn_debias(self):
2025-10-26T03:44:16.0331670Z         # prep
2025-10-26T03:44:16.0331870Z         timestamps, az = get_scan(
2025-10-26T03:44:16.0332350Z             n_scans=20, scan_accel=0.25, scanrate=0.5, az0=0, az1=40)
2025-10-26T03:44:16.0332740Z     
2025-10-26T03:44:16.0332940Z         nsamps = len(timestamps)
2025-10-26T03:44:16.0333210Z         ndets = 100
2025-10-26T03:44:16.0333460Z         np.random.seed(0)
2025-10-26T03:44:16.0333810Z         signal = np.random.normal(0, 1, size=(ndets, nsamps))
2025-10-26T03:44:16.0334130Z     
2025-10-26T03:44:16.0334370Z         dets = [f"det{i}" for i in range(ndets)]
2025-10-26T03:44:16.0334680Z         aman = core.AxisManager(
2025-10-26T03:44:16.0334930Z                 core.LabelAxis("dets", dets),
2025-10-26T03:44:16.0335190Z                 core.IndexAxis("samps", nsamps)
2025-10-26T03:44:16.0335570Z         )
2025-10-26T03:44:16.0335790Z         aman.wrap("timestamps", timestamps, [(0, "samps")])
2025-10-26T03:44:16.0336190Z         aman.wrap("signal", signal, [(0, "dets"), (1, "samps")])
2025-10-26T03:44:16.0336560Z         boresight = core.AxisManager(aman.samps)
2025-10-26T03:44:16.0336830Z         boresight.wrap("az", az, [(0, "samps")])
2025-10-26T03:44:16.0337130Z         aman.wrap('boresight', boresight)
2025-10-26T03:44:16.0337450Z         aman.wrap('flags', core.AxisManager(aman.dets, aman.samps))
2025-10-26T03:44:16.0338280Z         get_turnaround_flags(aman)
2025-10-26T03:44:16.0338540Z
2025-10-26T03:44:16.0339120Z         # test default arguments, this is biased
2025-10-26T03:44:16.0339380Z         calc_psd(aman, merge=True, nperseg=2**18)
2025-10-26T03:44:16.0339720Z         wn = calc_wn(aman)
2025-10-26T03:44:16.0339980Z         ratio = np.average(wn) / np.sqrt(np.average(aman.Pxx))
2025-10-26T03:44:16.0340320Z         self.assertTrue(abs(ratio - 1) > TOL_BIAS)
2025-10-26T03:44:16.0341060Z         # test debias, full_output=True, noverlap=0
2025-10-26T03:44:16.0341380Z         freqs, Pxx, nseg = calc_psd(aman, merge=False, full_output=True,
2025-10-26T03:44:16.0341690Z                                     noverlap=0, nperseg=2**18)
2025-10-26T03:44:16.0341960Z         wn = calc_wn(aman, Pxx, freqs, nseg)
2025-10-26T03:44:16.0342420Z         ratio = np.average(wn) / np.sqrt(np.average(Pxx))
2025-10-26T03:44:16.0342700Z         self.assertAlmostEqual(ratio, 1, delta=TOL_BIAS)
2025-10-26T03:44:16.0342980Z         # test quarter nperseg
2025-10-26T03:44:16.0343560Z         freqs, Pxx, nseg = calc_psd(aman, merge=False, full_output=True,
2025-10-26T03:44:16.0343870Z                                     noverlap=0, nperseg=2**16)
2025-10-26T03:44:16.0344250Z         wn = calc_wn(aman, Pxx, freqs, nseg)
2025-10-26T03:44:16.0344530Z         ratio = np.average(wn) / np.sqrt(np.average(Pxx))
2025-10-26T03:44:16.0344920Z         self.assertAlmostEqual(ratio, 1, delta=TOL_BIAS)
2025-10-26T03:44:16.0345240Z         # test defulat nperseg
2025-10-26T03:44:16.0345570Z         freqs, Pxx, nseg = calc_psd(aman, merge=False, full_output=True,
2025-10-26T03:44:16.0346080Z                                     noverlap=0)
2025-10-26T03:44:16.0346380Z         wn = calc_wn(aman, Pxx, freqs, nseg)
2025-10-26T03:44:16.0346660Z         ratio = np.average(wn) / np.sqrt(np.average(Pxx))
2025-10-26T03:44:16.0347290Z         self.assertAlmostEqual(ratio, 1, delta=TOL_BIAS)
2025-10-26T03:44:16.0347890Z         # test subscan
2025-10-26T03:44:16.0348170Z         freqs, Pxx, nseg = calc_psd(aman, merge=False, full_output=True,
2025-10-26T03:44:16.0348550Z                                     noverlap=0, subscan=True)
2025-10-26T03:44:16.0348960Z         wn = calc_wn(aman, Pxx, freqs, nseg)
2025-10-26T03:44:16.0349360Z         ratio = np.average(wn) / np.sqrt(np.average(Pxx))
2025-10-26T03:44:16.0350180Z >       self.assertAlmostEqual(ratio, 1, delta=TOL_BIAS)
2025-10-26T03:44:16.0350660Z E       AssertionError: np.float64(nan) != 1 within 0.005 delta (np.float64(nan) difference)
2025-10-26T03:44:16.0351240Z 
2025-10-26T03:44:16.0351310Z ../tests/test_psd.py:117: AssertionError

Note that this does not seem to happen using a virtualenv in the sotodlib CI tests, so maybe something to do with the conda stack or configuration on that platform. This will not hold up our production releases, but it should be investigated as resources permit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions