Checks the completeness and consistancy of the instruction data. Will be called by **instruction.execute()**. :Example: >>> # create an instance of the instruction object >>> my_instr = instruction() >>> # check a netlist file and use the circuit fr
(self)
| 1743 | return |
| 1744 | |
| 1745 | def check(self): |
| 1746 | """ |
| 1747 | Checks the completeness and consistancy of the instruction data. |
| 1748 | Will be called by **instruction.execute()**. |
| 1749 | |
| 1750 | :Example: |
| 1751 | |
| 1752 | >>> # create an instance of the instruction object |
| 1753 | >>> my_instr = instruction() |
| 1754 | >>> # check a netlist file and use the circuit from this file for this |
| 1755 | >>> # instruction: |
| 1756 | >>> my_instr.setCircuit('my_circuit.cir') |
| 1757 | """ |
| 1758 | self.errors = 0 |
| 1759 | self.checkCircuit() |
| 1760 | if self.dataType != "matrix": |
| 1761 | if self.convType not in [None, "dd", "cc"]: |
| 1762 | self.errors += 1 |
| 1763 | print("Error: conversion type '%s' can only be combined with doMatrix() (or instruction.dataType='matrix')."%(self.convType)) |
| 1764 | if self.dataType == 'noise': |
| 1765 | # Noise sources of resistors add k and T to the circuit parameters |
| 1766 | # These sources should be added before executing the instruction. |
| 1767 | _delResNoiseSources(self) |
| 1768 | self.circuit = _updateCirData(self.circuit) |
| 1769 | self = _addResNoiseSources(self) |
| 1770 | self.circuit = _updateCirData(self.circuit) |
| 1771 | if self.dataType != 'params': |
| 1772 | self._checkGainType() |
| 1773 | self.checkDataType() |
| 1774 | if self.errors == 0: |
| 1775 | if self.gainType == 'vi': |
| 1776 | if self.dataType == 'laplace': |
| 1777 | # need detector |
| 1778 | self.checkDetector() |
| 1779 | elif self.dataType == 'noise': |
| 1780 | # need detector |
| 1781 | self.checkDetector() |
| 1782 | # only needs a source for input noise analysis |
| 1783 | self.checkSource(need = False) |
| 1784 | elif self.dataType == 'matrix': |
| 1785 | # need nothing |
| 1786 | pass |
| 1787 | elif self.dataType == 'solve': |
| 1788 | # need nothing |
| 1789 | pass |
| 1790 | elif self.dataType == 'time': |
| 1791 | # need detector |
| 1792 | self.checkDetector() |
| 1793 | elif self.dataType == 'dc': |
| 1794 | # need detector |
| 1795 | self.checkDetector() |
| 1796 | elif self.dataType == 'dcvar': |
| 1797 | # need detector |
| 1798 | self.checkDetector() |
| 1799 | self.checkSource(need = False) |
| 1800 | elif self.dataType == 'dcsolve': |
| 1801 | # need nothing |
| 1802 | pass |
no test coverage detected