Skip to content

include_IAK is of type str, however, it is being checked as a boolean #38

@kasra-keshavarz

Description

@kasra-keshavarz

Problem Statement

The include_IAK variable is of type str after being read from the control file. While creating NetCDF file of the network topology, however, it is being checked as a boolean value:

...          
    create_and_fill_nc_var(ncid, 'manning', 'f8', 'n', False, \
                           shp_river['manning'].values.astype(float), \
                           'manning', '-')
    if include_IAK:
        create_and_fill_nc_var(ncid, 'IAK', 'int', 'n', False, \
                            shp_river[river_order].values.astype(int), \
                            'River Order', '-')
...

Proposed solution(s)

Either the dtype of include_IAK must be corrected, or, the if statement should be changed to the following:

...
    if include_IAK == 'True':
        create_and_fill_nc_var(ncid, 'IAK', 'int', 'n', False, \
                            shp_river[river_order].values.astype(int), \
                            'River Order', '-')
...

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