File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -170,12 +170,19 @@ def unset_time_ordering(self):
170170
171171 return self
172172
173+ def has_time_ordering (self ):
174+ """
175+ :return: whether the splitting uses time ordering
176+ :rtype: bool
177+ """
178+ return 'time' in self .mltask_settings and self .mltask_settings ['time' ]['enabled' ]
179+
173180 def get_time_ordering_variable (self ):
174181 """
175182 :return: the name of the variable
176183 :rtype: str
177184 """
178- if 'time' in self .mltask_settings and self . mltask_settings [ 'time' ][ 'enabled' ] :
185+ if self .has_time_ordering () :
179186 return self .mltask_settings ['time' ]['timeVariable' ]
180187 else :
181188 warnings .warn ("Time-based ordering is disabled in the current MLTask" )
@@ -185,7 +192,7 @@ def is_time_ordering_ascending(self):
185192 :return: True if the ordering is set to be ascending with respect to the time-ordering variable
186193 :rtype: bool
187194 """
188- if 'time' in self .mltask_settings and self . mltask_settings [ 'time' ][ 'enabled' ] :
195+ if self .has_time_ordering () :
189196 return self .mltask_settings ['time' ]['ascending' ]
190197 else :
191198 warnings .warn ("Time-based ordering is disabled in the current MLTask" )
You can’t perform that action at this time.
0 commit comments