Touchstone: added type hints

pull/100/head
Holger Mueller 2019-11-19 11:34:15 +01:00
rodzic f02524c4de
commit c21ebba3fb
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -52,16 +52,16 @@ class Options:
self.resistance = resistance
@property
def factor(self):
def factor(self) -> int:
return Options.UNIT_TO_FACTOR[self.unit]
def __str__(self):
def __str__(self) -> str:
return (
f"# {self.unit} {self.parameter}"
f" {self.format} r {self.resistance}"
).upper()
def parse(self, line):
def parse(self, line: str):
if not line.startswith("#"):
raise TypeError("Not an option line: " + line)
pfact = pparam = pformat = presist = False
@ -174,5 +174,5 @@ class Touchstone:
self._append_line_data(freq, data)
def setFilename(self, filename):
def setFilename(self, filename: str):
self.filename = filename