calliope-project / calliope

A multi-scale energy systems modelling framework
https://www.callio.pe
Apache License 2.0
286 stars 93 forks source link

Document and log automatically derived distances #209

Closed timtroendle closed 8 months ago

timtroendle commented 5 years ago

Problem description

Calliope can automatically derive distances between two locations if both locations have coordinates. This mechanism is very practical, but not properly documented. Issues are:

In [1]: 0.99999995**100000 # 100 km high voltage ac transmission
Out[1]: 0.995012479065401 # noise starts in e-5

In [2]: 0.99999995**10000000 # 1000 km high voltage ac transmission
Out[2]: 0.9512294232839076 # noise starts in e-3

Calliope version

0.6.4.dev

brynpickering commented 5 years ago

I was about to say that "the distances are stored in model_data", but I see that they're not... Perhaps we could populate a variable with those values?

Units, agreed, should be better communicated. I have a preference for them being included as attributes in model_data, but that might not work where there are some variables in there with dimensions which have different units (costs, for instance).

km would probably be better, particularly at the distances you are considering. If you know the distances, you can set them yourself, as a technology-specific override within a link.

sjpfenninger commented 4 years ago

@timtroendle PRs are welcome!

brynpickering commented 8 months ago

distance is now in model data and only cartesian coordinates are allowed (x/y wasn't worth including for the maintenance burden it entails). If any distances are derived from coordinates, there is a log output at the DEBUG level to notify users. The actual numbers aren't provided, but that can be checked in the distance matrix in model.inputs.

Only thing that needs dealing with is distance units. We probably need a config.init parameter to set the unit. My concern is that a user might provide distances for some links in metres/km and then we derive distances in km/metres in the same matrix and mess things up. A config param will make it explicit.