Skip to content

Coordinate alignment and xarray dimensionality error during full NEM regional merging #86

@Mo-collab160

Description

@Mo-collab160

Description:
When scaling the model from a single region to the full NEM, I encountered a coordinate alignment issue during the network merging phase. This resulted in a fatal assertion error within the linopy and xarray layers just before the optimisation solver was called.

It appears to stem from a dimension mismatch when mapping and merging the existing generator and storage unit tables with the new entrant data across multiple regions. This strictness in dimension naming seems closely related to the linopy versioning problems discussed in issue 73, and it highlights the need for the data validation steps mentioned in issue 64.

Steps to reproduce:
Run a standard workflow attempting to map and connect all regional nodes for the 2050 investment period. The process fails at the network optimisation phase when linopy attempts to parse the unnamed or misaligned coordinates.

Current workaround:
To bypass the crash and allow the solver to proceed, I implemented a temporary manual fix in my python script. I forced a consistent coordinate structure across the generators and storage units objects immediately before initiating the solver.

Suggested fix:
It would be highly beneficial to introduce a native coordinate alignment or data validation step during the regional mapping and merging process. This would prevent minor data shape mismatches from propagating into the linopy interface and crashing the model for users attempting full regions run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions