Skip to content

Errors in the workflow/scripts/create_modelrun.py  #9

@Timon-R

Description

@Timon-R

When running the workflow, I encountered a VALUE ERROR in line 190 in the workflow/scripts/create_modelrun.py
It suggested that the indexed column wouldn't exist even though it did.
I solved by replacing

model_params[name].loc[tuple(index + [first_year]):tuple(index + [end_year])] = interpolated_values

with

interp_values = iter(interpolated_values.flatten().astype(float))
for year in range(first_year, end_year + 1):
     model_params[name].loc[tuple(index) + (year,)] = next(interp_values) 

I also had to modify the function get_types_from_tuple(). My datatype was int64 which wasn't included in the function and raised an error! Currently, only str, int and float are included.

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