Skip to content

Latest commit

 

History

History
167 lines (131 loc) · 4 KB

File metadata and controls

167 lines (131 loc) · 4 KB

Browser Facet Update Summary

Date: 2026-02-20 Issue: Capitalization inconsistencies and "imported" category in browser facets Resolution: All enum values normalized to lowercase, browser data regenerated

Changes Made

1. Browser Export Updated (src/culturemech/export/browser_export.py)

Modified behavior:

  • All enum values converted to lowercase for facet display
  • category field: Convert to lowercase and skip "imported" values
  • medium_type field: Convert to lowercase
  • physical_state field: Convert to lowercase

Code changes:

item = {
    "category": category.lower() if category else "unknown",
    "medium_type": (recipe.get("medium_type", "") or "").lower(),
    "physical_state": (recipe.get("physical_state", "") or "").lower(),
}

2. Browser Schema Updated (app/schema.js)

Color scheme updated:

  • Changed from uppercase keys (COMPLEX, LIQUID) to lowercase (complex, liquid)
  • Added missing categories: algae, specialized
  • Added all medium types: enrichment, differential
  • Added all physical states: semisolid, biphasic

Before:

"colors": {
    "bacterial": "#3b82f6",
    "DEFINED": "#059669",
    "COMPLEX": "#dc2626",
    "LIQUID": "#06b6d4",
    "SOLID_AGAR": "#84cc16"
}

After:

"colors": {
    "bacterial": "#3b82f6",
    "fungal": "#8b5cf6",
    "archaea": "#f59e0b",
    "algae": "#10b981",
    "specialized": "#6366f1",
    "defined": "#059669",
    "complex": "#dc2626",
    "liquid": "#06b6d4",
    "solid_agar": "#84cc16",
    // ... and more
}

3. Browser Data Regenerated (app/data.js)

Command used:

PYTHONPATH=src python -m culturemech.export.browser_export \
    -i data/normalized_yaml \
    -o app/data.js

Result: 10,657 recipes exported with lowercase enum values

Verification Results

Before (Old Browser Data)

Category:
  imported: 10,353  ❌
  ALGAE: 242        ❌

Medium Type:
  COMPLEX: 8,203    ❌
  DEFINED: 2,150    ❌
  complex: 242      ❌

Physical State:
  LIQUID: 10,351    ❌
  liquid: 242       ❌
  SOLID_AGAR: 2     ❌

After (New Browser Data)

Categories:
  bacterial: 10,134  ✅
  algae: 242         ✅
  fungal: 119        ✅
  specialized: 99    ✅
  archaea: 63        ✅

Medium Types:
  complex: 8,492     ✅
  defined: 2,165     ✅

Physical States:
  liquid: 10,619     ✅
  solid_agar: 38     ✅

Key Improvements

No more "imported" category - All recipes properly categorized ✅ No more "ALGAE" - Now lowercase "algae" ✅ Consistent capitalization - All enum values lowercase ✅ Accurate counts - Bacterial increased from 10,072 to 10,134 (absorbed imported) ✅ Complete color scheme - All categories and types have defined colors

Impact on GitHub Pages

When you deploy the updated files, users will see:

Category Facet:

  • bacterial (10,134)
  • algae (242)
  • fungal (119)
  • specialized (99)
  • archaea (63)

Medium Type Facet:

  • complex (8,492)
  • defined (2,165)

Physical State Facet:

  • liquid (10,619)
  • solid_agar (38)

All values will display with proper colors as defined in the schema.

Files Modified

  1. src/culturemech/export/browser_export.py - Convert enums to lowercase
  2. app/schema.js - Update color scheme to lowercase keys
  3. app/data.js - Regenerated with 10,657 recipes (lowercase values)

Deployment

To see these changes on GitHub Pages:

  1. Commit the updated files:

    git add app/data.js app/schema.js src/culturemech/export/browser_export.py
    git commit -m "Fix browser facet capitalization and remove 'imported' category"
  2. Push to GitHub:

    git push origin main
  3. GitHub Pages will automatically rebuild with the new data

Summary

  • ✅ 10,657 recipes with consistent lowercase enum values
  • ✅ No more "imported" or capitalization inconsistencies
  • ✅ All 5 organism categories properly displayed
  • ✅ Complete color scheme for all enum values
  • ✅ Ready for deployment to GitHub Pages