Skip to content

a parameter cannot declare a default, so a bound that data prep fills no longer tells a where: which rows the modeller gave #773

Description

@FBumann

Prompt: "Let’s add one parent issue for caliope and file focused issues for individual topics or link existing ones."

Note

The following content was generated by AI.

What can be improved?

A bounds: entry refuses a missing row, so data prep fills Calliope's defaults (0, .inf). Every row then exists, and a bare-name where: can no longer see which rows were given. The proposal: default: on a parameter.

Case, the two rules that collide, proposal, alternatives

Case. In Calliope v0.7.0, a parameter's default: has two readings at once. It is the value that arithmetic and bounds read, and a where: treats the parameter as "not given". Calliope's area_use has the bounds area_use_min (default 0) and area_use_max (default .inf). It is built where either of them, or some other parameter, is given.

Two rules on main collide.

  1. absence.md: "A missing parameter row … reads as the value that contributes nothing". A bounds: entry is one of the four positions where no such value exists, so a missing row there is refused.
  2. expressions.md: a bare numeric parameter in a where: is true where it "has a row and [is] finite".

Rule 2 already states "given at all". But rule 1 makes data prep fill every bound, and a filled column has a row everywhere. The port in #770 therefore builds area_use where area_use_min > 0. That is a different mask: an explicit 0 no longer builds the variable. distance_only_for_transmission checks the filled values, not the values the modeller wrote. Each Calliope parameter that is both a bound and a mask has the same problem.

Proposal. default: on a parameter declaration.

parameters:
  area_use_max: { dims: [nodes, techs], default: .inf }
  • Arithmetic, bounds and every other position that reads a value read default where the table has no row.
  • A bare name in a where: still means "the table has a row here".
  • A parameter with no default: keeps today's rule.

Alternatives.

Triage against limits.md: is a default something "the spec cannot state" (data prep), or something the language can state? Calliope says the second, because its defaults are in its math files. Open questions:

Version

main at 5fce82b. Found by the Calliope port, #770 (gap 2 in its description).

Activity

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

    area: data contractWhat a file guarantees about the data it bindsdesign: openIn scope; the spelling is undecided

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions