@@ -96,51 +96,71 @@ def get_discretization(self) -> Discretization:
9696 if source [:2 ] == "<=" :
9797 l_bound = float ("-inf" )
9898 u_bound = float (source [2 :])
99- discretization_builder .add_discretization_item (sensor , l_bound ,
100- u_bound , True , True ,
101- target_casted )
99+ discretization_builder .add_discretization_item (sensor = sensor ,
100+ beg = l_bound ,
101+ to = u_bound ,
102+ beg_incl = True ,
103+ to_incl = True ,
104+ target_value = target_casted )
102105 elif source [:2 ] == ">=" :
103106 l_bound = float (source [2 :])
104107 u_bound = float ("inf" )
105- discretization_builder .add_discretization_item (sensor , l_bound , u_bound ,
106- True , True ,
107- target_casted )
108+ discretization_builder .add_discretization_item (sensor = sensor ,
109+ beg = l_bound ,
110+ to = u_bound ,
111+ beg_incl = True ,
112+ to_incl = True ,
113+ target_value = target_casted )
108114 elif source [0 ] == "<" :
109115 l_bound = float ("-inf" )
110116 u_bound = float (source [1 :])
111- discretization_builder .add_discretization_item (sensor , l_bound , u_bound ,
112- True , False ,
113- target_casted )
117+ discretization_builder .add_discretization_item (sensor = sensor ,
118+ beg = l_bound ,
119+ to = u_bound ,
120+ beg_incl = True ,
121+ to_incl = False ,
122+ target_value = target_casted )
114123 elif source [0 ] == ">" :
115124 l_bound = float (source [1 :])
116125 u_bound = float ("inf" )
117- discretization_builder .add_discretization_item (sensor , l_bound , u_bound ,
118- False , True ,
119- target_casted )
126+ discretization_builder .add_discretization_item (sensor = sensor ,
127+ beg = l_bound ,
128+ to = u_bound ,
129+ beg_incl = False ,
130+ to_incl = True ,
131+ target_value = target_casted )
120132 elif source [0 ] == "[" and source [- 1 ] == "]" :
121133 bounds = source [1 :- 1 ].split ("," )
122- discretization_builder .add_discretization_item (sensor , float (bounds [0 ]),
123- float (bounds [1 ]),
124- True ,
125- True , target_casted )
134+ discretization_builder .add_discretization_item (sensor = sensor ,
135+ beg = float (bounds [0 ]),
136+ to = float (bounds [1 ]),
137+ beg_incl = True ,
138+ to_incl = True ,
139+ target_value = target_casted )
126140 elif source [0 ] == "[" and source [- 1 ] == "[" :
127141 bounds = source [1 :- 1 ].split ("," )
128- discretization_builder .add_discretization_item (sensor , float (bounds [0 ]),
129- float (bounds [1 ]),
130- True ,
131- False , target_casted )
142+ discretization_builder .add_discretization_item (sensor = sensor ,
143+ beg = float (bounds [0 ]),
144+ to = float (bounds [1 ]),
145+ beg_incl = True ,
146+ to_incl = False ,
147+ target_value = target_casted )
132148 elif source [0 ] == "]" and source [- 1 ] == "]" :
133149 bounds = source [1 :- 1 ].split ("," )
134- discretization_builder .add_discretization_item (sensor , float (bounds [0 ]),
135- float (bounds [1 ]),
136- False ,
137- True , target_casted )
150+ discretization_builder .add_discretization_item (sensor = sensor ,
151+ beg = float (bounds [0 ]),
152+ to = float (bounds [1 ]),
153+ beg_incl = False ,
154+ to_incl = True ,
155+ target_value = target_casted )
138156 elif source [0 ] == "]" and source [- 1 ] == "[" :
139157 bounds = source [1 :- 1 ].split ("," )
140- discretization_builder .add_discretization_item (sensor , float (bounds [0 ]),
141- float (bounds [1 ]),
142- False ,
143- False , target_casted )
158+ discretization_builder .add_discretization_item (sensor = sensor ,
159+ beg = float (bounds [0 ]),
160+ to = float (bounds [1 ]),
161+ beg_incl = False ,
162+ to_incl = False ,
163+ target_value = target_casted )
144164 else :
145165 raise ValueError (f"Source { source } for sensor { sensor } is not valid." )
146166 # make sure that the whole range is covered
0 commit comments