Codacy correction

This commit is contained in:
FilippoOlivo
2024-10-31 09:50:19 +01:00
committed by Nicola Demo
parent ea3d1924e7
commit dd43c8304c
23 changed files with 246 additions and 214 deletions

View File

@@ -19,15 +19,17 @@ class SamplePointDataset(BaseDataset):
data_dict.pop('equation')
super().add_points(data_dict, condition_idx)
def _init_from_problem(self, collector_dict, batching_dim=0):
def _init_from_problem(self, collector_dict):
for name, data in collector_dict.items():
keys = list(data.keys())
if set(self.__slots__) == set(keys):
data = deepcopy(data)
data.pop('equation')
self._populate_init_list(data)
idx = [key for key, val in
self.problem.collector.conditions_name.items() if
val == name]
idx = [
key for key, val in
self.problem.collector.conditions_name.items()
if val == name
]
self.conditions_idx.append(idx)
self.initialize()