11"""
22# TODO
33"""
4+
45from .graph import Graph
56from .utils import check_consistency
67
@@ -14,14 +15,12 @@ def __init__(self, problem):
1415 # those variables are used for the dataloading
1516 self ._data_collections = {name : {} for name in self .problem .conditions }
1617 self .conditions_name = {
17- i : name
18- for i , name in enumerate (self .problem .conditions )
18+ i : name for i , name in enumerate (self .problem .conditions )
1919 }
2020
2121 # variables used to check that all conditions are sampled
2222 self ._is_conditions_ready = {
23- name : False
24- for name in self .problem .conditions
23+ name : False for name in self .problem .conditions
2524 }
2625 self .full = False
2726
@@ -51,13 +50,16 @@ def store_fixed_data(self):
5150 for condition_name , condition in self .problem .conditions .items ():
5251 # if the condition is not ready and domain is not attribute
5352 # of condition, we get and store the data
54- if (not self ._is_conditions_ready [condition_name ]) and (not hasattr (
55- condition , "domain" )):
53+ if (not self ._is_conditions_ready [condition_name ]) and (
54+ not hasattr (condition , "domain" )
55+ ):
5656 # get data
5757 keys = condition .__slots__
5858 values = [getattr (condition , name ) for name in keys ]
59- values = [value .data if isinstance (
60- value , Graph ) else value for value in values ]
59+ values = [
60+ value .data if isinstance (value , Graph ) else value
61+ for value in values
62+ ]
6163 self .data_collections [condition_name ] = dict (zip (keys , values ))
6264 # condition now is ready
6365 self ._is_conditions_ready [condition_name ] = True
@@ -74,6 +76,6 @@ def store_sample_domains(self):
7476 samples = self .problem .discretised_domains [condition .domain ]
7577
7678 self .data_collections [condition_name ] = {
77- ' input_points' : samples ,
78- ' equation' : condition .equation
79+ " input_points" : samples ,
80+ " equation" : condition .equation ,
7981 }
0 commit comments