Skip to content

states

  • Name: cognitivefactory.interactive_clustering_gui.models.states
  • Description: Definition of states models required for application runs.
  • Author: Erwan Schild
  • Created: 25/04/2022
  • Licence: CeCILL-C License v1.0 (https://cecill.info/licences.fr.html)

ICGUIStates

Bases: str, Enum

The enumeration of available States for Interactive Clustering GUI.

Source code in src\cognitivefactory\interactive_clustering_gui\models\states.py
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class ICGUIStates(str, enum.Enum):  # noqa: WPS600 (subclassing str)
    """The enumeration of available States for Interactive Clustering GUI."""

    ###
    ### Case of project initialization.
    ###

    INITIALIZATION_WITHOUT_MODELIZATION: str = "INITIALIZATION_WITHOUT_MODELIZATION"
    INITIALIZATION_WITH_PENDING_MODELIZATION: str = "INITIALIZATION_WITH_PENDING_MODELIZATION"
    INITIALIZATION_WITH_WORKING_MODELIZATION: str = "INITIALIZATION_WITH_WORKING_MODELIZATION"
    INITIALIZATION_WITH_ERRORS: str = "INITIALIZATION_WITH_ERRORS"

    ###
    ### Case of constraints sampling.
    ###

    # Sampling tasks.
    SAMPLING_TODO: str = "SAMPLING_TODO"
    SAMPLING_PENDING: str = "SAMPLING_PENDING"
    SAMPLING_WORKING: str = "SAMPLING_WORKING"
    # Import on sampling step.
    IMPORT_AT_SAMPLING_STEP_WITHOUT_MODELIZATION: str = "IMPORT_AT_SAMPLING_STEP_WITHOUT_MODELIZATION"
    IMPORT_AT_SAMPLING_STEP_WITH_PENDING_MODELIZATION: str = "IMPORT_AT_SAMPLING_STEP_WITH_PENDING_MODELIZATION"
    IMPORT_AT_SAMPLING_STEP_WITH_WORKING_MODELIZATION: str = "IMPORT_AT_SAMPLING_STEP_WITH_WORKING_MODELIZATION"
    IMPORT_AT_SAMPLING_STEP_WITH_ERRORS: str = "IMPORT_AT_SAMPLING_STEP_WITH_ERRORS"

    ###
    ### Case of constraints annotation.
    ###

    # Modelization up to date.
    ANNOTATION_WITH_UPTODATE_MODELIZATION: str = "ANNOTATION_WITH_UPTODATE_MODELIZATION"
    # Modelization outdated, without conflicts.
    ANNOTATION_WITH_OUTDATED_MODELIZATION_WITHOUT_CONFLICTS: str = (
        "ANNOTATION_WITH_OUTDATED_MODELIZATION_WITHOUT_CONFLICTS"
    )
    ANNOTATION_WITH_PENDING_MODELIZATION_WITHOUT_CONFLICTS: str = (
        "ANNOTATION_WITH_PENDING_MODELIZATION_WITHOUT_CONFLICTS"
    )
    ANNOTATION_WITH_WORKING_MODELIZATION_WITHOUT_CONFLICTS: str = (
        "ANNOTATION_WITH_WORKING_MODELIZATION_WITHOUT_CONFLICTS"
    )
    # Modelization outdated, with conflicts.
    ANNOTATION_WITH_OUTDATED_MODELIZATION_WITH_CONFLICTS: str = "ANNOTATION_WITH_OUTDATED_MODELIZATION_WITH_CONFLICTS"
    ANNOTATION_WITH_PENDING_MODELIZATION_WITH_CONFLICTS: str = "ANNOTATION_WITH_PENDING_MODELIZATION_WITH_CONFLICTS"
    ANNOTATION_WITH_WORKING_MODELIZATION_WITH_CONFLICTS: str = "ANNOTATION_WITH_WORKING_MODELIZATION_WITH_CONFLICTS"
    # Import on annotation step.
    IMPORT_AT_ANNOTATION_STEP_WITHOUT_MODELIZATION: str = "IMPORT_AT_ANNOTATION_STEP_WITHOUT_MODELIZATION"
    IMPORT_AT_ANNOTATION_STEP_WITH_PENDING_MODELIZATION: str = "IMPORT_AT_ANNOTATION_STEP_WITH_PENDING_MODELIZATION"
    IMPORT_AT_ANNOTATION_STEP_WITH_WORKING_MODELIZATION: str = "IMPORT_AT_ANNOTATION_STEP_WITH_WORKING_MODELIZATION"
    IMPORT_AT_ANNOTATION_STEP_WITH_ERRORS: str = "IMPORT_AT_ANNOTATION_STEP_WITH_ERRORS"

    ###
    ### Case of constrained clustering.
    ###

    # Clustering tasks.
    CLUSTERING_TODO: str = "CLUSTERING_TODO"
    CLUSTERING_PENDING: str = "CLUSTERING_PENDING"
    CLUSTERING_WORKING: str = "CLUSTERING_WORKING"
    # Import on clustering step.
    IMPORT_AT_CLUSTERING_STEP_WITHOUT_MODELIZATION: str = "IMPORT_AT_CLUSTERING_STEP_WITHOUT_MODELIZATION"
    IMPORT_AT_CLUSTERING_STEP_WITH_PENDING_MODELIZATION: str = "IMPORT_AT_CLUSTERING_STEP_WITH_PENDING_MODELIZATION"
    IMPORT_AT_CLUSTERING_STEP_WITH_WORKING_MODELIZATION: str = "IMPORT_AT_CLUSTERING_STEP_WITH_WORKING_MODELIZATION"
    IMPORT_AT_CLUSTERING_STEP_WITH_ERRORS: str = "IMPORT_AT_CLUSTERING_STEP_WITH_ERRORS"

    ###
    ### Case of iteration end.
    ###

    # End of iteration.
    ITERATION_END: str = "ITERATION_END"
    # Import on iteration end.
    IMPORT_AT_ITERATION_END_WITHOUT_MODELIZATION: str = "IMPORT_AT_ITERATION_END_WITHOUT_MODELIZATION"
    IMPORT_AT_ITERATION_END_WITH_PENDING_MODELIZATION: str = "IMPORT_AT_ITERATION_END_WITH_PENDING_MODELIZATION"
    IMPORT_AT_ITERATION_END_WITH_WORKING_MODELIZATION: str = "IMPORT_AT_ITERATION_END_WITH_WORKING_MODELIZATION"
    IMPORT_AT_ITERATION_END_WITH_ERRORS: str = "IMPORT_AT_ITERATION_END_WITH_ERRORS"

    @classmethod
    def contains(cls, state: str) -> bool:
        """Test if state is in this enumeration.

        Args:
            state (str): A state.

        Returns:
            bool: `True` if the state is in the enumeration.
        """
        return state in cls._value2member_map_

contains(state) classmethod

Test if state is in this enumeration.

Parameters:

Name Type Description Default
state str

A state.

required

Returns:

Name Type Description
bool bool

True if the state is in the enumeration.

Source code in src\cognitivefactory\interactive_clustering_gui\models\states.py
101
102
103
104
105
106
107
108
109
110
111
@classmethod
def contains(cls, state: str) -> bool:
    """Test if state is in this enumeration.

    Args:
        state (str): A state.

    Returns:
        bool: `True` if the state is in the enumeration.
    """
    return state in cls._value2member_map_

get_ICGUIStates_details(state)

Get state details.

Parameters:

Name Type Description Default
state ICGUIStates

The state.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: The state details.

Source code in src\cognitivefactory\interactive_clustering_gui\models\states.py
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
def get_ICGUIStates_details(
    state: ICGUIStates,
) -> Dict[str, Any]:
    """
    Get state details.

    Args:
        state (ICGUIStates): The state.

    Returns:
        Dict[str, Any]: The state details.
    """

    map_of_ICGUIStates_details: Dict[ICGUIStates, Dict[str, Any]] = {
        ICGUIStates.INITIALIZATION_WITHOUT_MODELIZATION: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "TODO",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.INITIALIZATION_WITH_PENDING_MODELIZATION: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.INITIALIZATION_WITH_WORKING_MODELIZATION: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.INITIALIZATION_WITH_ERRORS: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "ERROR",
            "conflict_status": "UNKNOWN",
        },
        ###
        ### Case of constraints sampling.
        ###
        # Sampling tasks.
        ICGUIStates.SAMPLING_TODO: {
            "step": "SAMPLING",
            "step_status": "TODO",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        ICGUIStates.SAMPLING_PENDING: {
            "step": "SAMPLING",
            "step_status": "PENDING",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        ICGUIStates.SAMPLING_WORKING: {
            "step": "SAMPLING",
            "step_status": "WORKING",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        # Import on sampling step.
        ICGUIStates.IMPORT_AT_SAMPLING_STEP_WITHOUT_MODELIZATION: {
            "step": "SAMPLING",
            "step_status": "LOCKED",
            "modelization_status": "TODO",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_SAMPLING_STEP_WITH_PENDING_MODELIZATION: {
            "step": "SAMPLING",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_SAMPLING_STEP_WITH_WORKING_MODELIZATION: {
            "step": "SAMPLING",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_SAMPLING_STEP_WITH_ERRORS: {
            "step": "SAMPLING",
            "step_status": "LOCKED",
            "modelization_status": "ERROR",
            "conflict_status": "UNKNOWN",
        },
        ###
        ### Case of constraints annotation.
        ###
        # Modelization up to date.
        ICGUIStates.ANNOTATION_WITH_UPTODATE_MODELIZATION: {
            "step": "ANNOTATION",
            "step_status": "TODO",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        # Modelization outdated, without conflicts.
        ICGUIStates.ANNOTATION_WITH_OUTDATED_MODELIZATION_WITHOUT_CONFLICTS: {
            "step": "ANNOTATION",
            "step_status": "TODO",
            "modelization_status": "OUTDATED",
            "conflict_status": "FALSE",
        },
        ICGUIStates.ANNOTATION_WITH_PENDING_MODELIZATION_WITHOUT_CONFLICTS: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "FALSE",
        },
        ICGUIStates.ANNOTATION_WITH_WORKING_MODELIZATION_WITHOUT_CONFLICTS: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "FALSE",
        },
        # Modelization outdated, with conflicts.
        ICGUIStates.ANNOTATION_WITH_OUTDATED_MODELIZATION_WITH_CONFLICTS: {
            "step": "ANNOTATION",
            "step_status": "TODO",
            "modelization_status": "OUTDATED",
            "conflict_status": "TRUE",
        },
        ICGUIStates.ANNOTATION_WITH_PENDING_MODELIZATION_WITH_CONFLICTS: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "TRUE",
        },
        ICGUIStates.ANNOTATION_WITH_WORKING_MODELIZATION_WITH_CONFLICTS: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "TRUE",
        },
        # Import on annotation step.
        ICGUIStates.IMPORT_AT_ANNOTATION_STEP_WITHOUT_MODELIZATION: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "TODO",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_ANNOTATION_STEP_WITH_PENDING_MODELIZATION: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_ANNOTATION_STEP_WITH_WORKING_MODELIZATION: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_ANNOTATION_STEP_WITH_ERRORS: {
            "step": "ANNOTATION",
            "step_status": "LOCKED",
            "modelization_status": "ERROR",
            "conflict_status": "UNKNOWN",
        },
        ###
        ### Case of constrained clustering.
        ###
        # Clustering tasks.
        ICGUIStates.CLUSTERING_TODO: {
            "step": "CLUSTERING",
            "step_status": "TODO",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        ICGUIStates.CLUSTERING_PENDING: {
            "step": "CLUSTERING",
            "step_status": "PENDING",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        ICGUIStates.CLUSTERING_WORKING: {
            "step": "CLUSTERING",
            "step_status": "WORKING",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        # Import on clustering step.
        ICGUIStates.IMPORT_AT_CLUSTERING_STEP_WITHOUT_MODELIZATION: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "TODO",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_CLUSTERING_STEP_WITH_PENDING_MODELIZATION: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_CLUSTERING_STEP_WITH_WORKING_MODELIZATION: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_CLUSTERING_STEP_WITH_ERRORS: {
            "step": "CLUSTERING",
            "step_status": "LOCKED",
            "modelization_status": "ERROR",
            "conflict_status": "UNKNOWN",
        },
        ###
        ### Case of iteration end.
        ###
        # End of iteration.
        ICGUIStates.ITERATION_END: {
            "step": "ITERATION_END",
            "step_status": "TODO",
            "modelization_status": "UPTODATE",
            "conflict_status": "FALSE",
        },
        # Import on iteration end.
        ICGUIStates.IMPORT_AT_ITERATION_END_WITHOUT_MODELIZATION: {
            "step": "ITERATION_END",
            "step_status": "LOCKED",
            "modelization_status": "TODO",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_ITERATION_END_WITH_PENDING_MODELIZATION: {
            "step": "ITERATION_END",
            "step_status": "LOCKED",
            "modelization_status": "PENDING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_ITERATION_END_WITH_WORKING_MODELIZATION: {
            "step": "ITERATION_END",
            "step_status": "LOCKED",
            "modelization_status": "WORKING",
            "conflict_status": "UNKNOWN",
        },
        ICGUIStates.IMPORT_AT_ITERATION_END_WITH_ERRORS: {
            "step": "ITERATION_END",
            "step_status": "LOCKED",
            "modelization_status": "ERROR",
            "conflict_status": "UNKNOWN",
        },
    }

    return map_of_ICGUIStates_details[state]