Skip to content

ETEngine fails to make scenarios from Excel due to floating point drift #197

Description

@KoenvanB

Context

I am creating a scenario from the MAIN tab of an existing Excel file. Here I have explicitly summed every share sum to 100.0

Upon pyetm run ETEngine throws a 422 share group error because multiple share groups sum to 100,0000000001. The likely culprit (according to Claude) seems to be floating point drift (rounding errors) because of the conversion from Excel.

Steps to reproduce

Create a new scenario (here: for RES Drechtsteden) on production with the following parameters:
agriculture_bio_kerosene_in_crude_oil_share 0.0
agriculture_biodiesel_in_crude_oil_share 53.5
agriculture_diesel_in_crude_oil_share 43.0
agriculture_kerosene_in_crude_oil_share 0.0
agriculture_lpg_in_crude_oil_sharea 3.5
agriculture_other_bio_oil_in_crude_oil_share 0.0
agriculture_other_oil_in_crude_oil_sharea 0.0

Version (e.g. production/2025-01): production

Proposed solution

Perhaps some sort of share group validation step can be incorporated into pyetm run that catches these errors?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions