fix: carry institutional→formal rename through analysis rename maps

Nathan renamed the Design gradient 'institutional' → 'formal' (v1.4.0).
The analysis scripts carry historical rename maps that route old data
(elite/institutional) into the current bicorder.json gradient names, and
those maps still stopped at 'institutional' — so old readings would have
silently misaligned against the v1.4.0 structure.

- bicorder_classifier.py / export_model_for_js.py: add
  institutional_vs_vernacular → formal_vs_vernacular, keep elite→formal
- json_to_csv.py TERM_RENAMES: same two-step route
- convert_csv_to_json.py GRADIENT_MAPPINGS: elite_vs_vernacular now maps
  to 'formal'
- bicorder_classifier.py demo ratings: use the current dimension name
- analysis/README.md: example run name 1.3.0 → 1.4.0
This commit is contained in:
Protocolbot committed 2026-09-23 14:27:51 -06:00
1 parent 6ae77a4f9b
commit 161ba3b136
5 files changed
+12 -9

No files matched your search

+2 -2
View File
@@ -18,11 +18,11 @@ Runs:
### Adding a new run (e.g. re-running on edited gradients) ### Adding a new run (e.g. re-running on edited gradients)
1. Make a new run directory keyed by bicorder version, e.g. `data/synthetic_1.3.0/`. 1. Make a new run directory keyed by bicorder version, e.g. `data/synthetic_1.4.0/`.
2. Point `bicorder_batch.py` at the shared input and the new output: 2. Point `bicorder_batch.py` at the shared input and the new output:
```bash ```bash
python3 scripts/bicorder_batch.py data/protocols_edited.csv \ python3 scripts/bicorder_batch.py data/protocols_edited.csv \
-o data/synthetic_1.3.0/readings.csv \ -o data/synthetic_1.4.0/readings.csv \
-b bicorder.json \ -b bicorder.json \
-m <model> -a "<analyst>" -s "<standpoint>" -m <model> -a "<analyst>" -s "<standpoint>"
``` ```
+5 -4
View File
@@ -36,7 +36,8 @@ _BICORDER_JSON = Path(__file__).parent.parent.parent / 'bicorder.json'
# Historical column renames: maps old CSV column names → current bicorder.json names. # Historical column renames: maps old CSV column names → current bicorder.json names.
# Add an entry here whenever gradient terms are renamed in bicorder.json. # Add an entry here whenever gradient terms are renamed in bicorder.json.
_COLUMN_RENAMES = { _COLUMN_RENAMES = {
'Design_elite_vs_vernacular': 'Design_institutional_vs_vernacular', 'Design_elite_vs_vernacular': 'Design_formal_vs_vernacular',
'Design_institutional_vs_vernacular': 'Design_formal_vs_vernacular',
'Entanglement_exclusive_vs_non-exclusive': 'Entanglement_monopolistic_vs_pluralistic', 'Entanglement_exclusive_vs_non-exclusive': 'Entanglement_monopolistic_vs_pluralistic',
'Experience_sufficient_vs_insufficient': 'Experience_sufficient_vs_limited', 'Experience_sufficient_vs_insufficient': 'Experience_sufficient_vs_limited',
'Experience_Kafka_vs_Whitehead': 'Experience_restraining_vs_liberating', 'Experience_Kafka_vs_Whitehead': 'Experience_restraining_vs_liberating',
@@ -313,7 +314,7 @@ def main():
print("\nExample 1: Community-Based Protocol") print("\nExample 1: Community-Based Protocol")
print("-" * 80) print("-" * 80)
ratings_relational = { ratings_relational = {
'Design_elite_vs_vernacular': 9, # Very vernacular 'Design_formal_vs_vernacular': 9, # Very vernacular
'Design_explicit_vs_implicit': 8, # More implicit 'Design_explicit_vs_implicit': 8, # More implicit
'Entanglement_flocking_vs_swarming': 9, # Swarming 'Entanglement_flocking_vs_swarming': 9, # Swarming
'Entanglement_obligatory_vs_voluntary': 9, # Voluntary 'Entanglement_obligatory_vs_voluntary': 9, # Voluntary
@@ -328,7 +329,7 @@ def main():
print("Example 2: Institutional Protocol") print("Example 2: Institutional Protocol")
print("-" * 80) print("-" * 80)
ratings_institutional = { ratings_institutional = {
'Design_elite_vs_vernacular': 1, # Elite 'Design_formal_vs_vernacular': 1, # Formal
'Design_explicit_vs_implicit': 1, # Very explicit 'Design_explicit_vs_implicit': 1, # Very explicit
'Entanglement_flocking_vs_swarming': 1, # Flocking 'Entanglement_flocking_vs_swarming': 1, # Flocking
'Entanglement_obligatory_vs_voluntary': 1, # Obligatory 'Entanglement_obligatory_vs_voluntary': 1, # Obligatory
@@ -344,7 +345,7 @@ def main():
print("Example 3: Boundary Protocol (mixed characteristics)") print("Example 3: Boundary Protocol (mixed characteristics)")
print("-" * 80) print("-" * 80)
ratings_boundary = { ratings_boundary = {
'Design_elite_vs_vernacular': 5, # Middle 'Design_formal_vs_vernacular': 5, # Middle
'Design_explicit_vs_implicit': 4, # Slightly implicit 'Design_explicit_vs_implicit': 4, # Slightly implicit
'Entanglement_flocking_vs_swarming': 5, # Middle 'Entanglement_flocking_vs_swarming': 5, # Middle
'Entanglement_obligatory_vs_voluntary': 6, # Slightly voluntary 'Entanglement_obligatory_vs_voluntary': 6, # Slightly voluntary
+1 -1
View File
@@ -19,7 +19,7 @@ GRADIENT_MAPPINGS = [
# Design set # Design set
("explicit_vs_implicit", "Design", "explicit", "implicit"), ("explicit_vs_implicit", "Design", "explicit", "implicit"),
("precise_vs_interpretive", "Design", "precise", "interpretive"), ("precise_vs_interpretive", "Design", "precise", "interpretive"),
("elite_vs_vernacular", "Design", "institutional", "vernacular"), # Changed: elite → institutional ("elite_vs_vernacular", "Design", "formal", "vernacular"), # Changed: elite → institutional → formal
("documenting_vs_enabling", "Design", "documenting", "enabling"), ("documenting_vs_enabling", "Design", "documenting", "enabling"),
("static_vs_malleable", "Design", "static", "malleable"), ("static_vs_malleable", "Design", "static", "malleable"),
("technical_vs_social", "Design", "technical", "social"), ("technical_vs_social", "Design", "technical", "social"),
+2 -1
View File
@@ -28,7 +28,8 @@ BICORDER_JSON = Path(__file__).parent.parent.parent / 'bicorder.json'
# Historical column renames: maps old CSV column names → current bicorder.json names. # Historical column renames: maps old CSV column names → current bicorder.json names.
# Add an entry here whenever gradient terms are renamed in bicorder.json. # Add an entry here whenever gradient terms are renamed in bicorder.json.
COLUMN_RENAMES = { COLUMN_RENAMES = {
'Design_elite_vs_vernacular': 'Design_institutional_vs_vernacular', 'Design_elite_vs_vernacular': 'Design_formal_vs_vernacular',
'Design_institutional_vs_vernacular': 'Design_formal_vs_vernacular',
'Entanglement_exclusive_vs_non-exclusive': 'Entanglement_monopolistic_vs_pluralistic', 'Entanglement_exclusive_vs_non-exclusive': 'Entanglement_monopolistic_vs_pluralistic',
'Experience_sufficient_vs_insufficient': 'Experience_sufficient_vs_limited', 'Experience_sufficient_vs_insufficient': 'Experience_sufficient_vs_limited',
'Experience_Kafka_vs_Whitehead': 'Experience_restraining_vs_liberating', 'Experience_Kafka_vs_Whitehead': 'Experience_restraining_vs_liberating',
+2 -1
View File
@@ -24,7 +24,8 @@ from pathlib import Path
# Map old term pairs to current column names (matches COLUMN_RENAMES in other scripts). # Map old term pairs to current column names (matches COLUMN_RENAMES in other scripts).
# Keys are (term_left, term_right) as found in older JSON files. # Keys are (term_left, term_right) as found in older JSON files.
TERM_RENAMES = { TERM_RENAMES = {
('elite', 'vernacular'): ('institutional', 'vernacular'), ('elite', 'vernacular'): ('formal', 'vernacular'),
('institutional', 'vernacular'): ('formal', 'vernacular'),
('exclusive', 'non-exclusive'): ('monopolistic', 'pluralistic'), ('exclusive', 'non-exclusive'): ('monopolistic', 'pluralistic'),
('insufficient', 'sufficient'): ('sufficient', 'limited'), # note: order swapped in old versions ('insufficient', 'sufficient'): ('sufficient', 'limited'), # note: order swapped in old versions
('Kafka', 'Whitehead'): ('restraining', 'liberating'), ('Kafka', 'Whitehead'): ('restraining', 'liberating'),