@@ -94,39 +94,37 @@ catalog.rename("JER__tf", "JER_tidal_filtered") # chainable, raises KeyError /
9494
9595` rename() ` does ** not** affect ` _source_index ` — the source (file path) is unchanged.
9696
97- ### ` name ` vs display label in mixed catalogs
97+ ### Design decision: ` name ` is both the catalog key and the user-visible display
9898
99- ` name ` serves two roles that can conflict:
99+ ** ` name ` is the single source of truth** — it is the catalog lookup key, the
100+ expression token, and the display identity shown in the UI table. Do not add a
101+ separate ` label ` column as an alias for ` name ` .
100102
101- | Role | Raw DSS example | Transform ref example |
102- | ------| -----------------| ----------------------|
103- | Catalog lookup key | ` "study.dss::/A/JER/EC//15MIN/F/" ` | ` "JER__tf" ` |
104- | User-visible display | * ugly — should be hidden* | * clean — should be shown* |
103+ Rationale:
105104
106- ** General rule** (handled automatically by ` get_table_column_width_map() ` ):
105+ - A ` label ` column that mirrors ` name ` for derived refs and is blank for raw refs
106+ adds complexity (two concepts for one value) with no functional gain.
107+ - Users can rename any ref — raw or math — via ` catalog.rename(old, new) ` , which
108+ atomically updates both the dict key and ` ref.name ` . After renaming, the new
109+ name works immediately in expressions and in the table.
110+ - Persistence of custom names can be solved independently (e.g. by including a
111+ ` name ` column in a downloaded catalog CSV; on reload, if a ` name ` column is
112+ present it overrides the auto-derived name instead of re-deriving it).
107113
108- When math refs are present the table automatically gains a ` name ` column so users
109- can see what their transform refs are called. For managers whose raw-ref names
110- are human-readable (e.g. ` "RSAC075_flow" ` ) this is sufficient.
114+ ** What managers with ugly auto-derived names should do instead:**
111115
112- ** For managers with ugly raw-ref names** (e.g. ` DSSDataUIManager ` where the raw-ref
113- key is ` "filename::pathname" ` ), override ` get_data_catalog() ` to inject a ` label `
114- column:
116+ Give raw refs clean auto-names when building the catalog. For ` DSSDataUIManager `
117+ the raw-ref key is currently ` "filename::pathname" ` — the right fix is to
118+ auto-derive names from the DSS path parts (B/C/F) so they are already
119+ human-readable, not to paper over ugly names with a ` label ` column.
115120
116- ``` python
117- def get_data_catalog (self ):
118- df = self ._dvue_catalog.to_dataframe().reset_index()
119- # blank for raw refs (identified by domain columns); catalog key for derived refs
120- df[" label" ] = df.apply(
121- lambda r : r[" name" ] if r.get(" ref_type" , " raw" ) != " raw" else " " ,
122- axis = 1 ,
123- )
124- return df
125- ```
121+ ** Framework behaviour (handled automatically by ` get_table_column_width_map() ` ):**
126122
127- Add ` "label" ` to ` _get_table_column_width_map() ` so it appears first in the table.
128- When a ` label ` column is present the framework suppresses the generic ` name `
129- injection, so the two columns never double-up.
123+ When math refs are present the table automatically gains a ` name ` column so users
124+ can see what their transform/math refs are called. The ` name ` column is only
125+ injected when not already declared in the subclass column map, so subclasses that
126+ explicitly include ` "name" ` in ` _get_table_column_width_map() ` retain full
127+ control over placement and width.
130128
131129### ` get_data_reference ` — always use ` row["name"] `
132130
0 commit comments