Simulation drivers#254
Conversation
There was a problem hiding this comment.
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.
| 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}." | ||
| ) |
There was a problem hiding this comment.
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().
| 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}." | |
| ) |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Move type conversions of input parameters from initialize() to configure() to avoid TypeErrors when get_GUIparameters() is called without initialize()