Skip to content

bug/run damages with shapefile without providing file_ID #773

@MatthiasHauthDeltares

Description

@MatthiasHauthDeltares

Ra2ce version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version of Ra2ce in master here.

Reproducible example

network_section = NetworkSection(
    network_type=NetworkTypeEnum.DRIVE,
    source=SourceEnum.SHAPEFILE,
    primary_file=network_path.joinpath("network.shp"),
    # file_id="ID",
    save_gpkg=True,
    reuse_network_output=True,
    road_types=[
        RoadTypeEnum.SECONDARY,
        RoadTypeEnum.SECONDARY_LINK,
        RoadTypeEnum.PRIMARY,
        RoadTypeEnum.PRIMARY_LINK,
        RoadTypeEnum.TRUNK,
        RoadTypeEnum.MOTORWAY,
        RoadTypeEnum.MOTORWAY_LINK,
    ],
)

Current behaviour

file_ID is by default an empty string '', which breaks things further down the line because the graph (and gdf) now contains an empty attribute with an empty string '' as name.

File "C:\Users\hauth\repositories\ra2ce\ra2ce\analysis\damages\damages.py", line 241, in
if (col[0].isupper() and col[1] == "_")
~~~^^^
IndexError: string index out of range

Desired behaviour

if file_id = '', dont add the attribute to the graph/gdfs

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage requiredIssues without priority assessment or milestone.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions