quintel / mechanical_turk

Automatic tester for etengine
1 stars 0 forks source link

Adding MT-tests for sankey download #178

Open kaskranenburgQ opened 4 months ago

kaskranenburgQ commented 4 months ago

This PR adds mechanical-turk tests for the sankey-download. The logic behind the tests is that for each carrier in the Sankey download, the following must be:

Conversion Output + Primary Demand Output = Conversion Input + Final demand Input + Losses*

*The losses that are taken into account are conversion losses to the same carrier, i.e. electricity to electricity conversion losses.

Within the queries that are tested this is tested as : Conversion Output + Primary Demand Output - Conversion Input - Final demand Input - Losses* = 0

To test this, 2 new mt-functions that check the outcome of a query have been added, sankey_equal and sankey_softly_equal. sankey_equal checks whether the outcome of a query is in a range of [-10,10]. sankey_softly_equal checks whether the outcome of a query is in a range of [-1*10*-10,110**-10].

Finally 2 new scenario_colection has been added to run these tests with.

  1. The ii3050v2 scenario's
  2. The ip2024 scenario's.

For now only the natural gas spec is active, since the other carriers are failing due to known issues.

Goes together with: PR 3062 from ETSource