Checks if the step variable is defined correctly. Called by **instruction.checkStep()** and by **setStepVar( )**.
(self)
| 760 | return |
| 761 | |
| 762 | def checkStepVar(self): |
| 763 | """ |
| 764 | Checks if the step variable is defined correctly. |
| 765 | |
| 766 | Called by **instruction.checkStep()** and by **setStepVar(<stepVar>)**. |
| 767 | """ |
| 768 | if self.stepVar == None: |
| 769 | self.errors += 1 |
| 770 | print("Error: missing step variable.") |
| 771 | elif isinstance(self.stepVar, sp.Basic): |
| 772 | pass |
| 773 | elif type(self.stepVar) == str: |
| 774 | self.stepVar = sp.Symbol(self.stepVar) |
| 775 | else: |
| 776 | self.errors += 1 |
| 777 | print("Error: argument type must be 'str' or 'sympy.Symbol'.") |
| 778 | if self.stepVar not in list(self.circuit.parDefs.keys()) and self.stepVar not in self.circuit.params: |
| 779 | print("Warning: unknown step parameter '{0}'.".format(self.stepVar)) |
| 780 | return |
| 781 | |
| 782 | def setStepVars(self, stepVars): |
| 783 | """ |
no test coverage detected