Skip to content

Type annotations use slice syntax dict[str : pd.DataFrame] instead of dict[str, pd.DataFrame] #95

@nick-gorman

Description

@nick-gorman

Several function signatures use dict[str : pd.DataFrame] (a colon — slice
syntax) where dict[str, pd.DataFrame] (a comma — generic parameters) is
intended. Python doesn't validate generic parameters at runtime, so this is
silent: the runtime behaviour is unaffected, but type checkers see a slice
object as the parameter and any caller passing a properly-typed dict gets
flagged as a mismatch.

Affected locations:

  • src/ispypsa/templater/manual_tables.py:8
  • src/ispypsa/templater/dynamic_generator_properties.py:250, 294, 335, 430
  • src/ispypsa/pypsa_build/build.py:22
  • src/ispypsa/results/extract.py:79
  • src/ispypsa/data_fetch/csv_read_write.py:6, 35

Fix is mechanical: replace the colon with a comma in each annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions