scistackplotdb 0.1.63__tar.gz → 0.1.65__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scistackplotdb
3
- Version: 0.1.63
3
+ Version: 0.1.65
4
4
  Summary: scidb-backed plotting: load variables into long tables and plot them with scistackplot
5
5
  Author: SciStack Contributors
6
6
  License-Expression: MIT
@@ -17,10 +17,10 @@ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Scientific/Engineering :: Visualization
18
18
  Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.10
20
- Requires-Dist: sciduckdb==0.1.63
21
- Requires-Dist: scistack-db==0.1.63
22
- Requires-Dist: scistacklog==0.1.63
23
- Requires-Dist: scistackplot==0.1.63
20
+ Requires-Dist: sciduckdb==0.1.65
21
+ Requires-Dist: scistack-db==0.1.65
22
+ Requires-Dist: scistacklog==0.1.65
23
+ Requires-Dist: scistackplot==0.1.65
24
24
  Provides-Extra: dev
25
25
  Requires-Dist: matplotlib>=3.6; extra == 'dev'
26
26
  Requires-Dist: pytest-cov>=4.0; extra == 'dev'
@@ -447,6 +447,25 @@ def _key_text(value: Any) -> "str | None":
447
447
  return str(value)
448
448
 
449
449
 
450
+ def _log_row_list_columns(db, variable: str, columns) -> None:
451
+ """Say which columns are row lists (sciduckdb.row_lists: rows combined by
452
+ ``on_duplicate="combine"``). This reader selects the stored cells as they
453
+ are, so EVERY cell of such a column is a 1-D array (``[7]``, ``[5, 12]``)
454
+ and the column is plotted as a 1-D measure (the collapse kinds take its
455
+ mean/median per location) - a decision recorded in
456
+ .claude/plan-combine-duplicate-locations.md §6, not an accident."""
457
+ from sciduckdb import is_row_list_meta
458
+
459
+ stored = (db.get_dtype_meta(variable) or {}).get("columns", {})
460
+ row_lists = [c for c in columns if is_row_list_meta(stored.get(c))]
461
+ if row_lists:
462
+ Log.debug(
463
+ "variable %r: row-list column(s) %s (combined rows) are read as "
464
+ "1-D arrays, one element per source row",
465
+ variable, row_lists, layer=LAYER,
466
+ )
467
+
468
+
450
469
  def load_variable(
451
470
  db, variable: str, *, with_variants: bool = True, include_data: bool = True
452
471
  ) -> VariableFrame:
@@ -471,6 +490,7 @@ def load_variable(
471
490
  keys = schema_keys(db)
472
491
  column_types = data_column_types_for(db, variable)
473
492
  columns = list(column_types)
493
+ _log_row_list_columns(db, variable, columns)
474
494
  if not columns:
475
495
  Log.warn("variable %r has no data columns", variable, layer=LAYER)
476
496
  return VariableFrame(name=variable, frame=pd.DataFrame())