refactor: rename names in legacy according to the change in kernel
This commit is contained in:
@@ -15,7 +15,7 @@ class DatasetItem:
|
|||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
value = self.value
|
value = self.value
|
||||||
if value <= 0:
|
if value <= 0:
|
||||||
raise ValueError(f"Invalid value {value} in dataset")
|
raise ValueError(f"Invalid value {value} in dataset item")
|
||||||
str_value = self.str_value
|
str_value = self.str_value
|
||||||
if len(str_value) == 0:
|
if len(str_value) == 0:
|
||||||
raise ValueError(f"Unexpected empty string in dataset item")
|
raise ValueError(f"Unexpected empty string in dataset item")
|
||||||
@@ -286,7 +286,7 @@ class DatasetCollection:
|
|||||||
self.__inductor.save_file(inductor)
|
self.__inductor.save_file(inductor)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def resistor_values(self) -> Dataset:
|
def resistor_dataset(self) -> Dataset:
|
||||||
"""
|
"""
|
||||||
Get the available standard values for resistor
|
Get the available standard values for resistor
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ class DatasetCollection:
|
|||||||
return self.__resistor
|
return self.__resistor
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def capacitor_values(self) -> Dataset:
|
def capacitor_dataset(self) -> Dataset:
|
||||||
"""
|
"""
|
||||||
Get the available standard values for capacitor
|
Get the available standard values for capacitor
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ class DatasetCollection:
|
|||||||
return self.__capacitor
|
return self.__capacitor
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def inductor_values(self) -> Dataset:
|
def inductor_dataset(self) -> Dataset:
|
||||||
"""
|
"""
|
||||||
Get the available standard values for inductor
|
Get the available standard values for inductor
|
||||||
|
|
||||||
|
|||||||
@@ -239,11 +239,11 @@ class BfsResolver(Resolver):
|
|||||||
dataset: Dataset
|
dataset: Dataset
|
||||||
match request.device_kind:
|
match request.device_kind:
|
||||||
case DeviceKind.RESISTOR:
|
case DeviceKind.RESISTOR:
|
||||||
dataset = self.__datasets.resistor_values
|
dataset = self.__datasets.resistor_dataset
|
||||||
case DeviceKind.CAPACITOR:
|
case DeviceKind.CAPACITOR:
|
||||||
dataset = self.__datasets.capacitor_values
|
dataset = self.__datasets.capacitor_dataset
|
||||||
case DeviceKind.INDUCTOR:
|
case DeviceKind.INDUCTOR:
|
||||||
dataset = self.__datasets.inductor_values
|
dataset = self.__datasets.inductor_dataset
|
||||||
|
|
||||||
# Iterate circuit item one by one
|
# Iterate circuit item one by one
|
||||||
bucket = ResultBucket(request.count_limit)
|
bucket = ResultBucket(request.count_limit)
|
||||||
|
|||||||
@@ -44,13 +44,13 @@ class LutResolver(Resolver):
|
|||||||
|
|
||||||
def __init__(self, datasets: DatasetCollection):
|
def __init__(self, datasets: DatasetCollection):
|
||||||
self.__resistor_lut = LutResolver.__build_lut(
|
self.__resistor_lut = LutResolver.__build_lut(
|
||||||
datasets.resistor_values, DeviceKind.RESISTOR
|
datasets.resistor_dataset, DeviceKind.RESISTOR
|
||||||
)
|
)
|
||||||
self.__capacitor_lut = LutResolver.__build_lut(
|
self.__capacitor_lut = LutResolver.__build_lut(
|
||||||
datasets.capacitor_values, DeviceKind.CAPACITOR
|
datasets.capacitor_dataset, DeviceKind.CAPACITOR
|
||||||
)
|
)
|
||||||
self.__inductor_lut = LutResolver.__build_lut(
|
self.__inductor_lut = LutResolver.__build_lut(
|
||||||
datasets.inductor_values, DeviceKind.INDUCTOR
|
datasets.inductor_dataset, DeviceKind.INDUCTOR
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user