scistackplotdb 0.1.37__tar.gz → 0.1.39__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.37
3
+ Version: 0.1.39
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.37
21
- Requires-Dist: scistack-db==0.1.37
22
- Requires-Dist: scistacklog==0.1.37
23
- Requires-Dist: scistackplot==0.1.37
20
+ Requires-Dist: sciduckdb==0.1.39
21
+ Requires-Dist: scistack-db==0.1.39
22
+ Requires-Dist: scistacklog==0.1.39
23
+ Requires-Dist: scistackplot==0.1.39
24
24
  Provides-Extra: dev
25
25
  Requires-Dist: matplotlib>=3.6; extra == 'dev'
26
26
  Requires-Dist: pytest-cov>=4.0; extra == 'dev'
@@ -154,8 +154,8 @@ def row_expression(input_variable: str, variant_set, table=None) -> str:
154
154
 
155
155
  from scistackplot.variants import export_selection
156
156
 
157
- # The TABLE's default, exactly what the preview applied: a stacked
158
- # multi-variable table has none, so its rows export as written.
157
+ # The TABLE's default, exactly what the preview applied: a table with
158
+ # none (nothing superseded) exports its rows as written.
159
159
  selection = export_selection(
160
160
  variant_set,
161
161
  latest_column=(table.latest_column if table is not None else None) or LATEST_COLUMN,
@@ -1135,6 +1135,36 @@ class ScidbSource(BaseSource):
1135
1135
  named = self._named_frame(frame, primary)
1136
1136
  named[VARIABLE_COLUMN] = frame.name
1137
1137
  stacked.append(named)
1138
+ # One latest flag for the stacked frame, so the source default
1139
+ # (current code) applies to multi-variable plots too — variants are
1140
+ # never pooled by default (user, 2026-10-15). Each variable's flag is
1141
+ # its OWN per-location `is_latest`, so it means the same thing on
1142
+ # every row: "this record is current for its variable here". A
1143
+ # variable that attached no flag has nothing superseded
1144
+ # (`load.attach_variants`), so every one of its rows is current —
1145
+ # True, never the NaN a bare concat leaves, which `variant_set_mask`
1146
+ # would read as False and drop the whole variable.
1147
+ flagged = any(frame.latest_column for frame in frames)
1148
+ if flagged:
1149
+ for frame, named in zip(frames, stacked, strict=True):
1150
+ own_flag = frame.latest_column
1151
+ if own_flag and own_flag in named.columns:
1152
+ named[LATEST_COLUMN] = named[own_flag].fillna(True).astype(bool)
1153
+ if own_flag != LATEST_COLUMN:
1154
+ named.drop(columns=[own_flag], inplace=True)
1155
+ else:
1156
+ named[LATEST_COLUMN] = True
1157
+ Log.info(
1158
+ "stacked %s: one %s flag (%s), so rows naming no code draw "
1159
+ "current code",
1160
+ measures,
1161
+ LATEST_COLUMN,
1162
+ {
1163
+ frame.name: frame.latest_column or "no flag: all current"
1164
+ for frame in frames
1165
+ },
1166
+ layer=LAYER,
1167
+ )
1138
1168
  combined = pd.concat(stacked, ignore_index=True, sort=False)
1139
1169
  combined, group_depths = self._attach_groupings(
1140
1170
  combined, levels, list(factor_variables or []), own
@@ -1174,9 +1204,14 @@ class ScidbSource(BaseSource):
1174
1204
  # and that must hold whether one dict variable is plotted or two.
1175
1205
  field_factors=field_columns,
1176
1206
  name=primary,
1177
- # No latest pin: the flag means different things per variable, and
1178
- # the rows the user named are what selects here.
1179
- default_pin=None,
1207
+ # The same default as a single variable: a row naming no code
1208
+ # draws each variable's current records. Until 2026-10-15 this was
1209
+ # None ("the flag means different things per variable"), which let
1210
+ # a multi-variable plot pool every version by default. A row can
1211
+ # still pin its own variable to a specific version — naming a
1212
+ # `Code:` axis makes its selection "stated" and the default does
1213
+ # not apply (variants.effective_selection).
1214
+ default_pin={latest_column: True} if latest_column else None,
1180
1215
  latest_column=latest_column,
1181
1216
  factor_origins={axis["column"]: axis for axis in variant_axes},
1182
1217
  factor_depths=group_depths,