From c98db93703e7d6fb75de62ff2d78450a4aaeb948 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Tue, 10 Oct 2023 19:22:38 +0200
Subject: [PATCH] Tests for logger problem with standalone dev/test

---
 ohmpi/hardware_system.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py
index f2526fb1..be28b882 100644
--- a/ohmpi/hardware_system.py
+++ b/ohmpi/hardware_system.py
@@ -11,6 +11,7 @@ from ohmpi.logging_setup import create_stdout_logger
 from ohmpi.utils import update_dict
 from ohmpi.config import HARDWARE_CONFIG
 from threading import Thread, Event, Barrier, BrokenBarrierError
+import warnings
 
 # plt.switch_backend('agg')  # for thread safe operations...
 
@@ -371,6 +372,7 @@ class OhmPiHardware:
 
     def _plot_readings(self, save_fig=False):
         # Plot graphs
+        warnings.filterwarnings("ignore", category=DeprecationWarning)
         fig, ax = plt.subplots(nrows=5, sharex=True)
         ax[0].plot(self.readings[:, 0], self.readings[:, 3], '-r', marker='.', label='iab')
         ax[0].set_ylabel('Iab [mA]')
@@ -389,6 +391,7 @@ class OhmPiHardware:
             fig.savefig(f'figures/test.png')
         else:
             plt.show()
+        warnings.resetwarnings()
 
     def calibrate_rx_bias(self):
         self.rx._bias += (np.mean(self.readings[self.readings[:, 2] == 1, 4])
-- 
GitLab