wizata-dsapi 2.0.0.dev28__tar.gz → 2.0.0.dev29__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. {wizata_dsapi-2.0.0.dev28/wizata_dsapi.egg-info → wizata_dsapi-2.0.0.dev29}/PKG-INFO +1 -1
  2. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/plots/common.py +80 -13
  3. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/plots/theme.py +10 -0
  4. wizata_dsapi-2.0.0.dev29/wizata_dsapi/version.py +1 -0
  5. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29/wizata_dsapi.egg-info}/PKG-INFO +1 -1
  6. wizata_dsapi-2.0.0.dev28/wizata_dsapi/version.py +0 -1
  7. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/LICENSE.txt +0 -0
  8. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/README.rst +0 -0
  9. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/setup.cfg +0 -0
  10. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/setup.py +0 -0
  11. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/__init__.py +0 -0
  12. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/api_config.py +0 -0
  13. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/api_dto.py +0 -0
  14. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/api_interface.py +0 -0
  15. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/bucket.py +0 -0
  16. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/business_label.py +0 -0
  17. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/context.py +0 -0
  18. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/dashboard.py +0 -0
  19. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/dataframe_toolkit.py +0 -0
  20. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/datapoint.py +0 -0
  21. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/datastore.py +0 -0
  22. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/ds_dataframe.py +0 -0
  23. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/dsapi_json_encoder.py +0 -0
  24. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/edge_config.py +0 -0
  25. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/edge_device.py +0 -0
  26. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/edge_module.py +0 -0
  27. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/evaluation.py +0 -0
  28. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/execution.py +0 -0
  29. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/execution_log.py +0 -0
  30. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/experiment.py +0 -0
  31. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/graylog_log.py +0 -0
  32. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/group_system.py +0 -0
  33. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/ilogger.py +0 -0
  34. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/insight.py +0 -0
  35. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/mlmodel.py +0 -0
  36. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/mobile_asset.py +0 -0
  37. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/model_toolkit.py +0 -0
  38. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/models/__init__.py +0 -0
  39. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/models/common.py +0 -0
  40. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/notification.py +0 -0
  41. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/paged_query_result.py +0 -0
  42. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/pipeline.py +0 -0
  43. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/pipeline_image.py +0 -0
  44. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/plot.py +0 -0
  45. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/plots/__init__.py +0 -0
  46. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/request.py +0 -0
  47. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/script.py +0 -0
  48. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/scripts/__init__.py +0 -0
  49. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/scripts/common.py +0 -0
  50. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/search.py +0 -0
  51. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/solution_component.py +0 -0
  52. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/streamlit_utils.py +0 -0
  53. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/template.py +0 -0
  54. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/template_config.py +0 -0
  55. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/trigger.py +0 -0
  56. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/twin.py +0 -0
  57. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/twinregistration.py +0 -0
  58. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/user.py +0 -0
  59. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/wizard_function.py +0 -0
  60. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/wizard_request.py +0 -0
  61. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/wizata_dsapi_client.py +0 -0
  62. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi/words.py +0 -0
  63. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
  64. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
  65. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi.egg-info/requires.txt +0 -0
  66. {wizata_dsapi-2.0.0.dev28 → wizata_dsapi-2.0.0.dev29}/wizata_dsapi.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizata_dsapi
3
- Version: 2.0.0.dev28
3
+ Version: 2.0.0.dev29
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -13,9 +13,53 @@ from .theme import (
13
13
  TEXT_MUTED, WHITE,
14
14
  TABLE_HEADER_BG, TABLE_HEADER_TEXT, TABLE_CELL_BG, TABLE_CELL_TEXT,
15
15
  TABLE_LINE_COLOR, FONT_FAMILY, FONT_SIZE,
16
+ COLUMN_TYPE_TELEMETRY, COLUMN_TYPE_SETPOINT, COLUMN_TYPE_RECOMMENDATION,
17
+ COLUMN_TYPE_TARGET, COLUMN_TYPE_CALCULATED, COLUMN_TYPES_ORDER,
16
18
  )
17
19
 
18
20
 
21
+ def _classify_columns(df, context):
22
+ """Classify each dataframe column by its role in the pipeline.
23
+
24
+ Returns a dict of {col_name: {"type": str, "tag": str, "label": str, "color": str}}.
25
+ Type ordering: telemetry < setpoint < recommendation < calculated < target.
26
+ """
27
+ datapoints = context.datapoints or {}
28
+ target = context.properties.get("target_feat") if context.properties else None
29
+
30
+ # Also check models for target_feat if not in properties
31
+ if target is None and hasattr(context, "models") and context.models:
32
+ for model in context.models.values():
33
+ if hasattr(model, "has_target_feat") and model.has_target_feat:
34
+ target_candidates = getattr(model, "target_feat", None)
35
+ if target_candidates:
36
+ target = target_candidates if isinstance(target_candidates, str) else target_candidates[0]
37
+ break
38
+
39
+ classification = {}
40
+ for col in df.select_dtypes(include="number").columns:
41
+ if col == target:
42
+ classification[col] = {**COLUMN_TYPE_TARGET, "type": "target"}
43
+ elif isinstance(col, str) and col.endswith("_recommended"):
44
+ classification[col] = {**COLUMN_TYPE_RECOMMENDATION, "type": "recommendation"}
45
+ elif col in datapoints:
46
+ dp = datapoints[col]
47
+ if dp.business_type == wizata_dsapi.BusinessType.SET_POINTS:
48
+ classification[col] = {**COLUMN_TYPE_SETPOINT, "type": "setpoint"}
49
+ else:
50
+ classification[col] = {**COLUMN_TYPE_TELEMETRY, "type": "telemetry"}
51
+ else:
52
+ classification[col] = {**COLUMN_TYPE_CALCULATED, "type": "calculated"}
53
+
54
+ return classification
55
+
56
+
57
+ def _sort_columns_by_type(columns, classification):
58
+ """Sort columns following COLUMN_TYPES_ORDER: telemetry, setpoint, recommendation, calculated, target."""
59
+ order_map = {t: i for i, t in enumerate(COLUMN_TYPES_ORDER)}
60
+ return sorted(columns, key=lambda c: order_map.get(classification.get(c, {}).get("type", "calculated"), 3))
61
+
62
+
19
63
  def check_single_column_and_target_feat(context: wizata_dsapi.Context):
20
64
  """
21
65
  check_single_column_and_target_feat
@@ -226,10 +270,10 @@ def parallel_coordinates(context: wizata_dsapi.Context):
226
270
  def setpoint_recommendation(context: wizata_dsapi.Context):
227
271
  """Compare current vs recommended setpoint values as a grouped bar chart with a summary table.
228
272
 
229
- Auto-pairs columns: for every column ending in '_recommended', matches the same column name
230
- without the suffix and validates via context.datapoints BusinessType.SET_POINTS. Uses the last
231
- row of the dataframe (most recent state). The top half shows a horizontal grouped bar chart
232
- (Current vs Recommended), the bottom half a table with Setpoint | Current | Recommended | delta | delta (%).
273
+ Auto-pairs columns ending in '_recommended' with the matching setpoint column, validated via
274
+ context.datapoints BusinessType.SET_POINTS. Uses the last row (most recent state). The top half
275
+ shows a horizontal grouped bar chart (Current vs Recommended) with type-colored labels; the
276
+ bottom half is a summary table with Setpoint | Current | Recommended | delta | delta (%).
233
277
  """
234
278
  df = context.dataframe
235
279
  datapoints = context.datapoints or {}
@@ -402,10 +446,10 @@ def feature_importance(context: wizata_dsapi.Context):
402
446
 
403
447
 
404
448
  def process_variability(context: wizata_dsapi.Context):
405
- """Parallel coordinates plot showing configurations variability across process features, colored by
406
- a quality/outcome column. Each line is one row (time step) of the dataframe; each vertical axis
407
- is a numeric feature. The color gradient runs from red (poor quality) through yellow to green
408
- (good quality) based on the 'color_by' column.
449
+ """Parallel coordinates plot showing process configurations variability, colored by a quality
450
+ outcome. Columns are ordered by type: telemetry, setpoints, recommendations, calculated,
451
+ with the target/quality column last. Each axis label is prefixed with a type tag
452
+ ([T], [SP], [REC], [C], [Q]) for quick identification.
409
453
 
410
454
  Column selection:
411
455
  - color_by: property name of the quality column used for coloring (defaults to
@@ -422,12 +466,19 @@ def process_variability(context: wizata_dsapi.Context):
422
466
  if len(numeric_cols) < 2:
423
467
  raise ValueError("process_variability: need at least 2 numeric columns")
424
468
 
469
+ # Classify and order columns by type
470
+ classification = _classify_columns(df, context)
471
+ ordered_cols = _sort_columns_by_type(
472
+ [c for c in numeric_cols if c in classification],
473
+ classification
474
+ )
475
+
425
476
  # Resolve color column
426
477
  color_by = context.properties.get("color_by")
427
478
  if color_by is None:
428
479
  color_by = context.properties.get("target_feat")
429
480
  if color_by is None:
430
- color_by = numeric_cols[-1]
481
+ color_by = ordered_cols[-1] if ordered_cols else numeric_cols[-1]
431
482
  if color_by not in df.columns:
432
483
  raise ValueError(f"process_variability: color_by column '{color_by}' not found in dataframe")
433
484
 
@@ -435,14 +486,16 @@ def process_variability(context: wizata_dsapi.Context):
435
486
  if isinstance(color_reverse, str):
436
487
  color_reverse = color_reverse.lower() not in ("false", "0", "no")
437
488
 
438
- # Build dimensions for all numeric columns
489
+ # Build dimensions with type-tagged labels, in order
439
490
  dimensions = []
440
- for col in numeric_cols:
491
+ for col in ordered_cols:
441
492
  col_vals = df[col].dropna()
442
493
  if col_vals.empty:
443
494
  continue
495
+ info = classification[col]
496
+ tagged_label = f"[{info['tag']}] {col}"
444
497
  dimensions.append(dict(
445
- label=col,
498
+ label=tagged_label,
446
499
  values=df[col].values,
447
500
  range=[float(col_vals.min()), float(col_vals.max())],
448
501
  ))
@@ -463,7 +516,21 @@ def process_variability(context: wizata_dsapi.Context):
463
516
  dimensions=dimensions,
464
517
  ))
465
518
 
466
- fig.update_layout(title="Configurations Variability")
519
+ # Add a legend-like annotation for the type tags
520
+ type_legend = " ".join(
521
+ f"[{t['tag']}] {t['label']}"
522
+ for t in [COLUMN_TYPE_TELEMETRY, COLUMN_TYPE_SETPOINT, COLUMN_TYPE_RECOMMENDATION,
523
+ COLUMN_TYPE_CALCULATED, COLUMN_TYPE_TARGET]
524
+ )
525
+ fig.update_layout(
526
+ title=dict(text="Configurations Variability"),
527
+ annotations=[dict(
528
+ text=type_legend,
529
+ xref="paper", yref="paper", x=0, y=-0.08,
530
+ showarrow=False,
531
+ font=dict(size=10, color=TEXT_MUTED),
532
+ )],
533
+ )
467
534
  apply_theme(fig)
468
535
 
469
536
  context.set_plot(figure=fig, name="process_variability")
@@ -53,6 +53,16 @@ TABLE_CELL_BG = [TERTIARY, FOURTH]
53
53
  TABLE_CELL_TEXT = TEXT_MUTED
54
54
  TABLE_LINE_COLOR = "rgba(255,255,255,0.12)"
55
55
 
56
+ # -- Column type classification -----------------------------------------------
57
+ # Used by plots to visually distinguish column roles in the process pipeline.
58
+ COLUMN_TYPE_TELEMETRY = {"tag": "T", "label": "Telemetry", "color": "#4992FF"}
59
+ COLUMN_TYPE_SETPOINT = {"tag": "SP", "label": "Setpoint", "color": "#E64600"}
60
+ COLUMN_TYPE_RECOMMENDATION = {"tag": "REC", "label": "Recommendation", "color": "#7CFFB2"}
61
+ COLUMN_TYPE_TARGET = {"tag": "Q", "label": "Target / Quality", "color": "#FDDD60"}
62
+ COLUMN_TYPE_CALCULATED = {"tag": "C", "label": "Calculated", "color": "#9E7CFF"}
63
+
64
+ COLUMN_TYPES_ORDER = ["telemetry", "setpoint", "recommendation", "calculated", "target"]
65
+
56
66
  # -- Font ---------------------------------------------------------------------
57
67
  FONT_FAMILY = "Inter, -apple-system, BlinkMacSystemFont, sans-serif"
58
68
  FONT_SIZE = 12
@@ -0,0 +1 @@
1
+ __version__ = "2.0.0.dev29"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizata_dsapi
3
- Version: 2.0.0.dev28
3
+ Version: 2.0.0.dev29
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -1 +0,0 @@
1
- __version__ = "2.0.0.dev28"