masster 0.4.14__py3-none-any.whl → 0.4.17__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.

Potentially problematic release.


This version of masster might be problematic. Click here for more details.

masster/study/plot.py CHANGED
@@ -310,8 +310,22 @@ def plot_alignment(
310
310
  max_inty = sample_data.select(pl.col("inty").max()).item() or 1
311
311
 
312
312
  # Get sample information
313
- sample_name = str(sample)
314
313
  sample_uid = sample if sample_col == "sample_uid" else sample_data.select(pl.col("sample_uid")).item() if "sample_uid" in sample_data.columns else sample
314
+
315
+ # Try to get actual sample name from samples_df if available
316
+ sample_name = str(sample) # fallback
317
+ if hasattr(self, "samples_df") and self.samples_df is not None and sample_uid is not None:
318
+ try:
319
+ sample_name_result = (
320
+ self.samples_df.filter(pl.col("sample_uid") == sample_uid)
321
+ .select("sample_name")
322
+ .to_series()
323
+ )
324
+ if len(sample_name_result) > 0 and sample_name_result[0] is not None:
325
+ sample_name = str(sample_name_result[0])
326
+ except Exception:
327
+ # Keep the fallback value
328
+ pass
315
329
 
316
330
  # Select columns to process
317
331
  cols_to_select = ["rt", "mz", "inty"]