Skip to content

fix: repair CITATION.cff and clarify BAM contig-map comment#73

Merged
nextgenusfs merged 2 commits into
mainfrom
fix-citation-and-bam-comment
Jun 10, 2026
Merged

fix: repair CITATION.cff and clarify BAM contig-map comment#73
nextgenusfs merged 2 commits into
mainfrom
fix-citation-and-bam-comment

Conversation

@nextgenusfs

Copy link
Copy Markdown
Owner

Summary

Two small fixes surfaced during a pre-tag code review:

  1. CITATION.cff is malformed. Both cff-version and version were
    set to the literal string version = "26.5.22" (looks like a sed
    substitution that grabbed too much). The file does not validate as
    CFF, so GitHub's "Cite this repository" widget, cffconvert, and any
    DOI/Zenodo integration would reject it.

    Fixed to:

    • cff-version: 1.2.0 (CFF schema version)
    • version: 26.5.22 (matches pyproject.toml)

    Verified with cffconvert --validate (schema 1.2.0) and a sample
    BibTeX render.

  2. Misleading comment on inv_contig_map in predict.py. The inline
    comment claimed it "maps simplified names back to original", but the
    dict comprehension inverts {simplified: original} into
    {original: simplified} — the opposite direction.

    The runtime usage is correct (it matches annorefine.bam2hints'
    contig_map contract: keys are input/BAM contig names, values are
    output/hint contig names), but the comment misled anyone tracing the
    BAM hint path. Replaced with an accurate description of why the
    inversion is needed.

No behavior change in either commit.

Why now

These were flagged as the two blocking items in a pre-tag review of
v2025.11.1..main. With these in, the codebase looks ready for a new
tag.

Test plan

  • pixi run pytest tests/unit — 152 passed, 35 skipped.
  • cffconvert --validate -i CITATION.cff → "Citation metadata are
    valid according to schema version 1.2.0."
  • cffconvert -i CITATION.cff -f bibtex renders without errors.

Jon Palmer added 2 commits June 9, 2026 16:50
Both cff-version and version were left as `version = "26.5.22"` (looks
like a sed substitution that grabbed too much), making the file invalid
CFF — GitHub's "Cite this repository" widget, cffconvert, and any
DOI/Zenodo integration would all reject it.

Set them to their intended values:
- cff-version: 1.2.0 (the CFF schema version)
- version: 26.5.22 (the project version, matches pyproject.toml)

Verified with `cffconvert --validate` against schema 1.2.0 and a
sample BibTeX render.
The inline comment claimed inv_contig_map "maps simplified names back
to original", but the dict comprehension inverts contig_name_map
({simplified: original}) into {original: simplified} — i.e. the
opposite direction. The runtime usage is correct (it matches
annorefine.bam2hints' contig_map contract: keys are input/BAM contig
names, values are output/hint contig names), but the comment misleads
anyone tracing the BAM hint path.

Replace with an accurate description of why the inversion is needed:
the BAM file references the user's original contig names while
everything downstream uses the simplified names produced by
simplify_headers_drop.

No behavior change.
@nextgenusfs nextgenusfs merged commit bf8b50d into main Jun 10, 2026
5 checks passed
nextgenusfs pushed a commit that referenced this pull request Jun 10, 2026
The pre-commit hook auto-updates CITATION.cff whenever pyproject.toml
changes, but two bugs caused it to silently corrupt the file on
macOS/BSD:

1. The version-extraction regex used \s (GNU-only) in grep -E / sed -E.
   On BSD this matches a literal 's', so the capture fails and VERSION
   falls back to the entire matched line ('version = "X.Y.Z"').
2. The CITATION.cff substitution `s/version: .*/.../` was unanchored,
   so it also rewrote the `cff-version:` line.

Together these turned `cff-version: 1.2.0` and `version: X.Y.Z` into
`cff-version: version = "X.Y.Z"` and `version: version = "X.Y.Z"`,
which is invalid CFF (this is what PR #73 had to repair).

Fix both by using POSIX [[:space:]] and anchoring the substitutions
with ^.
nextgenusfs pushed a commit that referenced this pull request Jun 10, 2026
Release cut after #73. Switches to CalVer (YYYY.M.D) matching the
prior v2025.11.1 tag rather than the intermediate YY.M.DD form used
in 26.5.22.

- pyproject.toml: 26.5.22 -> 2026.6.9
- CITATION.cff: version + date-released for today's tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant