Skip to content

model_file_name() produces inconsistent slugs for names with parentheses #40

Description

@talkasab

Problem

When a finding model name contains parentheses — e.g., composite metrics (hippocampal occupancy score) — the model_file_name() function produces different slugs depending on context. The index.md generator links to composite_metrics__hippocampal_occupancy_score_.fm.json (double underscore, trailing underscore) but the actual def file is composite_metrics_hippocampal_occupancy_score.fm.json.

This causes broken links in the auto-generated index.

Reproduction

from findingmodel.common import model_file_name
print(model_file_name("composite metrics (hippocampal occupancy score)"))

Expected behavior

model_file_name() should produce a single canonical slug, and the index generator should use the same function to build links.

Found via Copilot review on openimagingdata/findingmodels#48.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions