Skip to content

Simulation drivers#254

Open
FelixDollinger-SweepMe wants to merge 3 commits into
mainfrom
simulation-drivers
Open

Simulation drivers#254
FelixDollinger-SweepMe wants to merge 3 commits into
mainfrom
simulation-drivers

Conversation

@FelixDollinger-SweepMe

Copy link
Copy Markdown
Contributor

Move type conversions of input parameters from initialize() to configure() to avoid TypeErrors when get_GUIparameters() is called without initialize()

@FelixDollinger-SweepMe FelixDollinger-SweepMe requested a review from a team as a code owner June 30, 2026 09:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the simulation drivers by replacing the initialize method with a configure method in both SMU-Simulation_Driver and Scope-Simulation_Driver. This change ensures that GUI parameter type conversions and validations are executed on every reconfiguration rather than only once at startup. The review feedback recommends adding validation checks to ensure that compliance, ideality factor, and temperature parameters are strictly greater than zero to prevent division-by-zero errors and physically invalid simulation behaviors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +151 to 156
self.protection = float(self.protection)
max_compliance = 1.0
if float(self.protection) > max_compliance:
if self.protection > max_compliance:
self.stop_Measurement(
f"Compliance {self.protection} is higher than the maximum compliance of {max_compliance}."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The compliance (self.protection) should be validated to ensure it is greater than 0. A zero or negative compliance value is physically invalid for an SMU and will cause incorrect clipping behavior in simulate_current().

Suggested change
self.protection = float(self.protection)
max_compliance = 1.0
if float(self.protection) > max_compliance:
if self.protection > max_compliance:
self.stop_Measurement(
f"Compliance {self.protection} is higher than the maximum compliance of {max_compliance}."
)
self.protection = float(self.protection)
if self.protection <= 0:
self.stop_Measurement("Compliance must be greater than 0.")
max_compliance = 1.0
if self.protection > max_compliance:
self.stop_Measurement(
f"Compliance {self.protection} is higher than the maximum compliance of {max_compliance}."
)

Comment thread src/SMU-Simulation_Driver/main.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants