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