ml-dash 0.6.13__py3-none-any.whl → 0.6.14__py3-none-any.whl

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.
ml_dash/__init__.py CHANGED
@@ -43,11 +43,11 @@ from .params import ParametersBuilder
43
43
  from .run import RUN
44
44
  from .storage import LocalStorage
45
45
 
46
- __version__ = "0.6.13"
46
+ __version__ = "0.6.14"
47
47
 
48
48
  # Required version - MUST match exactly (blocks all older versions)
49
49
  # Update this with EVERY release to force users to upgrade
50
- REQUIRED_VERSION = "0.6.13"
50
+ REQUIRED_VERSION = "0.6.14"
51
51
 
52
52
 
53
53
  def _check_version_compatibility():
ml_dash/buffer.py CHANGED
@@ -458,12 +458,10 @@ class BackgroundBufferManager:
458
458
  logs=batch,
459
459
  )
460
460
  except Exception as e:
461
- warnings.warn(
462
- f"Failed to flush {len(batch)} logs to remote server: {e}. "
463
- f"Training will continue.",
464
- RuntimeWarning,
465
- stacklevel=3,
466
- )
461
+ raise RuntimeError(
462
+ f"Failed to flush {len(batch)} logs to remote server: {e}\n"
463
+ f"Data loss occurred. Check your network connection and server status."
464
+ ) from e
467
465
 
468
466
  if self._experiment.run._storage:
469
467
  # Local storage writes one at a time (no batch API)
@@ -479,11 +477,10 @@ class BackgroundBufferManager:
479
477
  timestamp=log_entry["timestamp"],
480
478
  )
481
479
  except Exception as e:
482
- warnings.warn(
483
- f"Failed to write log to local storage: {e}",
484
- RuntimeWarning,
485
- stacklevel=3,
486
- )
480
+ raise RuntimeError(
481
+ f"Failed to write log to local storage: {e}\n"
482
+ f"Check disk space and file permissions."
483
+ ) from e
487
484
 
488
485
  self._last_log_flush = time.time()
489
486
 
@@ -535,12 +532,10 @@ class BackgroundBufferManager:
535
532
  )
536
533
  except Exception as e:
537
534
  metric_display = f"'{metric_name}'" if metric_name else "unnamed metric"
538
- warnings.warn(
539
- f"Failed to flush {len(batch)} points to {metric_display} on remote server: {e}. "
540
- f"Training will continue.",
541
- RuntimeWarning,
542
- stacklevel=3,
543
- )
535
+ raise RuntimeError(
536
+ f"Failed to flush {len(batch)} points to {metric_display} on remote server: {e}\n"
537
+ f"Data loss occurred. Check your network connection and server status."
538
+ ) from e
544
539
 
545
540
  if self._experiment.run._storage:
546
541
  try:
@@ -556,11 +551,10 @@ class BackgroundBufferManager:
556
551
  )
557
552
  except Exception as e:
558
553
  metric_display = f"'{metric_name}'" if metric_name else "unnamed metric"
559
- warnings.warn(
560
- f"Failed to flush {len(batch)} points to {metric_display} in local storage: {e}",
561
- RuntimeWarning,
562
- stacklevel=3,
563
- )
554
+ raise RuntimeError(
555
+ f"Failed to flush {len(batch)} points to {metric_display} in local storage: {e}\n"
556
+ f"Check disk space and file permissions."
557
+ ) from e
564
558
 
565
559
  self._last_metric_flush[metric_name] = time.time()
566
560
 
@@ -597,12 +591,10 @@ class BackgroundBufferManager:
597
591
  entries=batch,
598
592
  )
599
593
  except Exception as e:
600
- warnings.warn(
601
- f"Failed to flush {len(batch)} entries to track '{topic}' on remote server: {e}. "
602
- f"Training will continue.",
603
- RuntimeWarning,
604
- stacklevel=3,
605
- )
594
+ raise RuntimeError(
595
+ f"Failed to flush {len(batch)} entries to track '{topic}' on remote server: {e}\n"
596
+ f"Data loss occurred. Check your network connection and server status."
597
+ ) from e
606
598
 
607
599
  # Write to local storage
608
600
  if self._experiment.run._storage:
@@ -615,11 +607,10 @@ class BackgroundBufferManager:
615
607
  entries=batch,
616
608
  )
617
609
  except Exception as e:
618
- warnings.warn(
619
- f"Failed to flush {len(batch)} entries to track '{topic}' in local storage: {e}",
620
- RuntimeWarning,
621
- stacklevel=3,
622
- )
610
+ raise RuntimeError(
611
+ f"Failed to flush {len(batch)} entries to track '{topic}' in local storage: {e}\n"
612
+ f"Check disk space and file permissions."
613
+ ) from e
623
614
 
624
615
  self._last_track_flush[topic] = time.time()
625
616
 
@@ -663,12 +654,10 @@ class BackgroundBufferManager:
663
654
  if total_files > 1:
664
655
  print(f"[ML-Dash] [{completed}/{total_files}] Uploaded {file_entry['filename']}", flush=True)
665
656
  except Exception as e:
666
- completed += 1
667
- warnings.warn(
668
- f"Failed to upload file {file_entry['filename']}: {e}",
669
- RuntimeWarning,
670
- stacklevel=3,
671
- )
657
+ raise RuntimeError(
658
+ f"Failed to upload file {file_entry['filename']}: {e}\n"
659
+ f"File upload failed. Check network connection and file permissions."
660
+ ) from e
672
661
 
673
662
  def _upload_single_file(self, file_entry: Dict[str, Any]) -> None:
674
663
  """
@@ -306,7 +306,8 @@ def discover_experiments(
306
306
  with open(exp_json, "r") as f:
307
307
  metadata = json.load(f)
308
308
  prefix = metadata.get("prefix")
309
- except:
309
+ except (FileNotFoundError, json.JSONDecodeError, KeyError) as e:
310
+ # Metadata file missing or invalid - will use path-based prefix
310
311
  pass
311
312
 
312
313
  # Extract project and experiment names from PREFIX (not path)
ml_dash/client.py CHANGED
@@ -226,8 +226,13 @@ class RemoteClient:
226
226
  result = self.graphql_query(query)
227
227
  username = result.get("me", {}).get("username")
228
228
  return username
229
- except Exception:
230
- return None
229
+ except Exception as e:
230
+ # Re-raise authentication errors
231
+ from .auth.exceptions import AuthenticationError
232
+ if isinstance(e, AuthenticationError):
233
+ raise
234
+ # For other errors, raise a clear exception
235
+ raise RuntimeError(f"Failed to fetch namespace from server: {e}") from e
231
236
 
232
237
  def get_current_user(self) -> Optional[Dict[str, Any]]:
233
238
  """
@@ -264,8 +269,13 @@ class RemoteClient:
264
269
  """
265
270
  result = self.graphql_query(query)
266
271
  return result.get("me")
267
- except Exception:
268
- return None
272
+ except Exception as e:
273
+ # Re-raise authentication errors
274
+ from .auth.exceptions import AuthenticationError
275
+ if isinstance(e, AuthenticationError):
276
+ raise
277
+ # For other errors, raise a clear exception
278
+ raise RuntimeError(f"Failed to fetch current user from server: {e}") from e
269
279
 
270
280
  def _ensure_authenticated(self):
271
281
  """Check if authenticated, raise error if not."""
ml_dash/experiment.py CHANGED
@@ -399,8 +399,11 @@ class Experiment:
399
399
  print(f"View results at: {experiment_url}")
400
400
 
401
401
  except Exception as e:
402
- # Log error but don't fail the close operation
403
- print(f"Warning: Failed to update experiment status: {e}")
402
+ # Raise on status update failure
403
+ raise RuntimeError(
404
+ f"Failed to update experiment status to COMPLETED: {e}\n"
405
+ f"Experiment may not be marked as completed on the server."
406
+ ) from e
404
407
 
405
408
  self._is_open = False
406
409
 
@@ -554,15 +557,10 @@ class Experiment:
554
557
  logs=[log_entry], # Single log in array
555
558
  )
556
559
  except Exception as e:
557
- # Log warning but don't crash training
558
- import warnings
559
-
560
- warnings.warn(
561
- f"Failed to write log to remote server: {e}. Training will continue.",
562
- RuntimeWarning,
563
- stacklevel=4,
564
- )
565
- # Fall through to local storage if available
560
+ raise RuntimeError(
561
+ f"Failed to write log to remote server: {e}\n"
562
+ f"Data loss occurred. Check your network connection and server status."
563
+ ) from e
566
564
 
567
565
  if self.run._storage:
568
566
  # Local mode: write to file immediately
@@ -577,11 +575,10 @@ class Experiment:
577
575
  timestamp=log_entry["timestamp"],
578
576
  )
579
577
  except Exception as e:
580
- import warnings
581
-
582
- warnings.warn(
583
- f"Failed to write log to local storage: {e}", RuntimeWarning, stacklevel=4
584
- )
578
+ raise RuntimeError(
579
+ f"Failed to write log to local storage: {e}\n"
580
+ f"Check disk space and file permissions."
581
+ ) from e
585
582
 
586
583
  def _print_log(
587
584
  self, message: str, level: str, metadata: Optional[Dict[str, Any]]
@@ -1072,17 +1069,11 @@ class Experiment:
1072
1069
  metadata=metadata,
1073
1070
  )
1074
1071
  except Exception as e:
1075
- # Log warning but don't crash training
1076
- import warnings
1077
-
1078
1072
  metric_display = f"'{name}'" if name else "unnamed metric"
1079
- warnings.warn(
1080
- f"Failed to log {metric_display} to remote server: {e}. "
1081
- f"Training will continue.",
1082
- RuntimeWarning,
1083
- stacklevel=3,
1084
- )
1085
- # Fall through to local storage if available
1073
+ raise RuntimeError(
1074
+ f"Failed to log {metric_display} to remote server: {e}\n"
1075
+ f"Data loss occurred. Check your network connection and server status."
1076
+ ) from e
1086
1077
 
1087
1078
  if self.run._storage:
1088
1079
  # Local mode: append to local storage
@@ -1098,14 +1089,11 @@ class Experiment:
1098
1089
  metadata=metadata,
1099
1090
  )
1100
1091
  except Exception as e:
1101
- import warnings
1102
-
1103
1092
  metric_display = f"'{name}'" if name else "unnamed metric"
1104
- warnings.warn(
1105
- f"Failed to log {metric_display} to local storage: {e}",
1106
- RuntimeWarning,
1107
- stacklevel=3,
1108
- )
1093
+ raise RuntimeError(
1094
+ f"Failed to log {metric_display} to local storage: {e}\n"
1095
+ f"Check disk space and file permissions."
1096
+ ) from e
1109
1097
 
1110
1098
  return result
1111
1099
 
@@ -1141,15 +1129,10 @@ class Experiment:
1141
1129
  entries=[{"timestamp": timestamp, **data}],
1142
1130
  )
1143
1131
  except Exception as e:
1144
- # Log warning but don't crash training
1145
- import warnings
1146
-
1147
- warnings.warn(
1148
- f"Failed to log track '{topic}' to remote server: {e}. "
1149
- f"Training will continue.",
1150
- RuntimeWarning,
1151
- stacklevel=3,
1152
- )
1132
+ raise RuntimeError(
1133
+ f"Failed to log track '{topic}' to remote server: {e}\n"
1134
+ f"Data loss occurred. Check your network connection and server status."
1135
+ ) from e
1153
1136
 
1154
1137
  if self.run._storage:
1155
1138
  # Local mode: append to local storage
@@ -1162,13 +1145,10 @@ class Experiment:
1162
1145
  entries=[{"timestamp": timestamp, **data}],
1163
1146
  )
1164
1147
  except Exception as e:
1165
- import warnings
1166
-
1167
- warnings.warn(
1168
- f"Failed to log track '{topic}' to local storage: {e}",
1169
- RuntimeWarning,
1170
- stacklevel=3,
1171
- )
1148
+ raise RuntimeError(
1149
+ f"Failed to log track '{topic}' to local storage: {e}\n"
1150
+ f"Check disk space and file permissions."
1151
+ ) from e
1172
1152
 
1173
1153
  def _append_batch_to_metric(
1174
1154
  self,
@@ -1205,17 +1185,11 @@ class Experiment:
1205
1185
  metadata=metadata,
1206
1186
  )
1207
1187
  except Exception as e:
1208
- # Log warning but don't crash training
1209
- import warnings
1210
-
1211
1188
  metric_display = f"'{name}'" if name else "unnamed metric"
1212
- warnings.warn(
1213
- f"Failed to log batch to {metric_display} on remote server: {e}. "
1214
- f"Training will continue.",
1215
- RuntimeWarning,
1216
- stacklevel=3,
1217
- )
1218
- # Fall through to local storage if available
1189
+ raise RuntimeError(
1190
+ f"Failed to log batch to {metric_display} on remote server: {e}\n"
1191
+ f"Data loss occurred. Check your network connection and server status."
1192
+ ) from e
1219
1193
 
1220
1194
  if self.run._storage:
1221
1195
  # Local mode: append batch to local storage
@@ -1231,14 +1205,11 @@ class Experiment:
1231
1205
  metadata=metadata,
1232
1206
  )
1233
1207
  except Exception as e:
1234
- import warnings
1235
-
1236
1208
  metric_display = f"'{name}'" if name else "unnamed metric"
1237
- warnings.warn(
1238
- f"Failed to log batch to {metric_display} in local storage: {e}",
1239
- RuntimeWarning,
1240
- stacklevel=3,
1241
- )
1209
+ raise RuntimeError(
1210
+ f"Failed to log batch to {metric_display} in local storage: {e}\n"
1211
+ f"Check disk space and file permissions."
1212
+ ) from e
1242
1213
 
1243
1214
  return result
1244
1215
 
ml_dash/metric.py CHANGED
@@ -69,9 +69,11 @@ class BufferManager:
69
69
  value = float('nan')
70
70
  try:
71
71
  self._buffers[prefix][key].append(float(value))
72
- except (TypeError, ValueError):
73
- # Skip non-numeric values silently
74
- continue
72
+ except (TypeError, ValueError) as e:
73
+ raise ValueError(
74
+ f"Cannot buffer non-numeric value for '{key}': {value!r} (type: {type(value).__name__})\n"
75
+ f"Metrics must be numeric (int, float). Use exp.log() for non-numeric values."
76
+ ) from e
75
77
 
76
78
  def _compute_stats(self, values: List[float], aggs: tuple) -> Dict[str, float]:
77
79
  """
@@ -248,9 +250,11 @@ class SummaryCache:
248
250
  value = float('nan')
249
251
  try:
250
252
  self._buffer[key].append(float(value))
251
- except (TypeError, ValueError):
252
- # Skip non-numeric values silently
253
- continue
253
+ except (TypeError, ValueError) as e:
254
+ raise ValueError(
255
+ f"Cannot store non-numeric value for '{key}': {value!r} (type: {type(value).__name__})\n"
256
+ f"SummaryCache only accepts numeric values. Use exp.log() for non-numeric data."
257
+ ) from e
254
258
 
255
259
  def set(self, **kwargs) -> None:
256
260
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ml-dash
3
- Version: 0.6.13
3
+ Version: 0.6.14
4
4
  Summary: ML experiment tracking and data storage
5
5
  Keywords: machine-learning,experiment-tracking,mlops,data-storage
6
6
  Author: Ge Yang, Tom Tao
@@ -1,4 +1,4 @@
1
- ml_dash/__init__.py,sha256=S-Q1EK0mKvV0WAOB-QjQF7NjLvYntB3_LIAbzKA45LA,3060
1
+ ml_dash/__init__.py,sha256=0N78Rs6EH_pFB-OoRXx42ZXm1ghbvp2xd54it41CPXM,3060
2
2
  ml_dash/auth/__init__.py,sha256=3lwM-Y8UBHPU1gFW2JNpmXlPVTnkGudWLKNFFKulQfo,1200
3
3
  ml_dash/auth/constants.py,sha256=ku4QzQUMNjvyJwjy7AUdywMAZd59jXSxNHZxDiagUWU,280
4
4
  ml_dash/auth/device_flow.py,sha256=DQOdPNlZCuU1umZOA_A6WXdRM3zWphnyo9IntToBl_A,7921
@@ -6,7 +6,7 @@ ml_dash/auth/device_secret.py,sha256=qUsz6M9S1GEIukvmz57eJEp57srSx74O4MU9mZEeDlE
6
6
  ml_dash/auth/exceptions.py,sha256=IeBwUzoaTyFtPwd4quFOIel49inIzuabe_ChEeEXEWI,725
7
7
  ml_dash/auth/token_storage.py,sha256=9YQXGrn41UVyc1wUvZYbTYLzxSt5NGOyNFNjeX28bjA,7976
8
8
  ml_dash/auto_start.py,sha256=mYNjLGI2kyylIfOX5wGOR74gb9UlXg1n5OUQu7aw5SE,2412
9
- ml_dash/buffer.py,sha256=R3QaD55s1an3tJvzyXfrEuBxeJsN4o4QNdE__BoIr9w,26437
9
+ ml_dash/buffer.py,sha256=vZwBRnnuiuvLHuWISTi2QYWadrJ6maVVa6oZSshByeM,26400
10
10
  ml_dash/cli.py,sha256=Vd0taM5MQrhvxqL2KQhklZ00wxZLdWl6Qw1IPkjPNuw,2897
11
11
  ml_dash/cli_commands/__init__.py,sha256=bjAmV7MsW-bhtW_4SnLJ0Cfkt9h82vMDC8ebW1Ke8KE,38
12
12
  ml_dash/cli_commands/api.py,sha256=NekZEJGWNpIfB6YrsrOw7kw7rZKjVudwgJWPZIy6ANQ,4535
@@ -17,13 +17,13 @@ ml_dash/cli_commands/login.py,sha256=zX-urtUrfzg2qOGtKNYQgj6UloN9kzj4zEO6h_xwuNs
17
17
  ml_dash/cli_commands/logout.py,sha256=lTUUNyRXqvo61qNkCd4KBrPUujDAHnNqsHkU6bHie0U,1332
18
18
  ml_dash/cli_commands/profile.py,sha256=PoRO1XA4bnOINptj4AO0SyNDBADeryPJBfgC74327e4,5997
19
19
  ml_dash/cli_commands/remove.py,sha256=AtDlUWkNeGcnZWN0Wbg6XoyYhFHkCFMPdxsGA33v38c,5325
20
- ml_dash/cli_commands/upload.py,sha256=o5D1be3V_wrzoVI3QHrKzyw2fG6ocD33MSZjzRsS60w,49659
21
- ml_dash/client.py,sha256=sQokhvofq56JxpmUBVUsfjjn5qKqyUXM9F3uxsUbUbA,66608
20
+ ml_dash/cli_commands/upload.py,sha256=oZVU8m9Ey8N151KmUiQD_qQLEBBN4oqu5NcqUNOUJWY,49786
21
+ ml_dash/client.py,sha256=ZWO1uzV-GLz-3R2ML90XPCV200e_ch7L-4iG07jkC84,67213
22
22
  ml_dash/config.py,sha256=oz2xvoBh2X_xUXWr92cPD5nFxXMT5LxVNypv5B5O0fA,3116
23
- ml_dash/experiment.py,sha256=JqNYsoAOsvqIRMVl6gHFodlZ79b0X2rUFGz6NRixKic,43726
23
+ ml_dash/experiment.py,sha256=eSzrh49jP5dPx6rlEZZHLDMn2CxoA9uE_PSG3CpQQfA,43366
24
24
  ml_dash/files.py,sha256=tGJCTxPfd9vmfvIEqstZjzLvqmHzMZffPXHz0jU9bYU,54441
25
25
  ml_dash/log.py,sha256=E-DLg0vejVLLEyShJ_r0LneDMI0XU7XTH5iKWYJe9jI,5298
26
- ml_dash/metric.py,sha256=ghD1jnuv6dbjV1Jlo7q0mx9UEzpdto2Y1-oDWrSfg04,25809
26
+ ml_dash/metric.py,sha256=hwdZIkHbt_wbJQPiO1LK3UJwusbAC7J-TR0gKeAnjHc,26206
27
27
  ml_dash/params.py,sha256=pPFvknJAJX5uhckzjO1r-HNnKbQFFKDISFmOXNET5eY,9046
28
28
  ml_dash/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  ml_dash/remote_auto_start.py,sha256=5fvQDHv1CWEKFb6WAa5_uyEInwV_SvotXjOO_6i6ZKE,1687
@@ -31,7 +31,7 @@ ml_dash/run.py,sha256=yAKZ9HtU4cidtbWMAY1IiDPVWwluVlicD5hsmVT89U0,11361
31
31
  ml_dash/snowflake.py,sha256=14rEpRU5YltsmmmZW0EMUy_hdv5S5ME9gWVtmdmwfiU,4917
32
32
  ml_dash/storage.py,sha256=x1W-dK6wQY36-LVOJ4kA8Dn07ObNQuIErQWJ3b0PoGY,44910
33
33
  ml_dash/track.py,sha256=Dfg1ZnmKZ_FlE5ZfG8Qld_wN4RIMs3nrOxrxwf3thiY,8164
34
- ml_dash-0.6.13.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
35
- ml_dash-0.6.13.dist-info/entry_points.txt,sha256=dYs2EHX1uRNO7AQGNnVaJJpgiy0Z9q7tiy4fHSyaf3Q,46
36
- ml_dash-0.6.13.dist-info/METADATA,sha256=bKRP7yW8ULvNc5kqdeO0USgqCOWhXuV3EuhViNKOZIU,9536
37
- ml_dash-0.6.13.dist-info/RECORD,,
34
+ ml_dash-0.6.14.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
35
+ ml_dash-0.6.14.dist-info/entry_points.txt,sha256=dYs2EHX1uRNO7AQGNnVaJJpgiy0Z9q7tiy4fHSyaf3Q,46
36
+ ml_dash-0.6.14.dist-info/METADATA,sha256=flWNnOAY6fm6xBPb4aqoaHebFkHjaEcWRBaU51ckUjQ,9536
37
+ ml_dash-0.6.14.dist-info/RECORD,,