Skip to content

Commit 6613341

Browse files
resolve the ModuleNotFoundError
1 parent a6d962f commit 6613341

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Utilities/LivePlotter_v10.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ploter for the Live_plots_Temperature_dependendent_V
22
import pandas as pd
33
import matplotlib.pyplot as plt
4-
from matplotlib.animation import FuncAnimation
4+
import matplotlib.animation as animation
55
import os
66
import tkinter
77
from tkinter import filedialog
@@ -69,7 +69,7 @@ def animate(i):
6969
axs[2].set_ylabel('Voltage (V)', fontsize=13)
7070
axs[2].legend(loc='upper left')
7171

72-
ani = FuncAnimation(plt.gcf(), animate, interval=1000, cache_frame_data=False)
72+
ani = animation.FuncAnimation(plt.gcf(), animate, interval=1000, cache_frame_data=False)
7373

7474
plt.tight_layout()
7575
plt.show()

tests/test_gui_iv_k2400.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ def tearDown(self):
2424

2525
@patch('Keithley_2400.IV_K2400_GUI_v5.Keithley2400_IV_Backend')
2626
@patch('matplotlib.figure.Figure.subplots', return_value=(MagicMock(), MagicMock()))
27-
def test_start_measurement_logic(self, mock_fig_subplots, MockBackend):
27+
def test_start_measurement_logic(self, mock_subplots, MockBackend):
2828
"""
2929
Tests the core logic of the 'Start' button click.
3030
Verifies that parameters are read from the UI and passed to the backend correctly.
3131
"""
3232
# --- Setup ---
33-
# Configure the mock for subplots to return two mock axes
33+
# The mock for subplots is now configured directly in the decorator,
34+
# ensuring it's ready before the GUI is instantiated.
3435
# Instantiate the GUI. This also creates all the tk widgets.
3536
app = MeasurementAppGUI(self.root)
3637

0 commit comments

Comments
 (0)