Skip to content

Timeseries download writes "undefined" for publishers without a short name #985

Open

Description

@jacobvjk

Problem

The publication schema (src/schema/common/publication.v1.json) allows a publisher with only a full name. Eleven files use this, among them all four TransitionZero pathways and their timeseries files, and the three PH DOE pathways.

scripts/build-timeseries-files.ts always reads publication.publisher.short when it builds the CSV download (lines ~366 and ~381 on epic/v2 at 4e02916):

const source = `${pub.publisher.short}, ${pub.year}, ${pub.title.full}${optionalBlock}`;
...
publisher: parsed.publication.publisher.short,

For these pathways that gives:

  • publisher: empty. The value is undefined, so the empty-field filter drops it.
  • source: a value that starts with the literal text "undefined", for example undefined, 2024, From Vision to Voltage (License: CC BY 4.0, Report: …).

This affects all 1,860 rows of the four TransitionZero timeseries downloads. PH DOE has no timeseries yet, but would be affected the same way.

Fix

Fall back to the full name when there's no short one, in both places:

const publisherName = pub.publisher.short ?? pub.publisher.full;

Add a test in scripts/timeseries-csv.test.ts, or next to the row builder, with a publication that has only publisher.full. It should check that publisher and source use the full name and that neither contains "undefined".

Context

Found while checking the benchmark prep repo's review workbook against this download (RMI/tpr_benchmark_data_preparation#18). That workbook already uses this fallback; with the fix, the two match exactly.

Activity

  1. jacobvjk commented on Oct 13, 2026

    @jacobvjk
    CollaboratorAuthor

    closed by #987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions