People-Places-Solutions / floodmodeller-api

The Flood Modeller Python API is a free and open-source python package which provides a bridge between Flood Modeller and the python programming language to extend the capabilities of Flood Modeller in automated workflows
https://api.floodmodeller.com/api/
Other
38 stars 15 forks source link

sections.py's .data setter non-functional #130

Closed jacob-toller closed 1 month ago

jacob-toller commented 1 month ago

When setting the dataframe of a river section using the .data setter, returns a ValueError.

with new_df.columns != self._required_columns,

new_df.columns is an Index object and self._required_columns is a list, so pandas tries to check whether each element of the index is equal to the whole required columns list.

This should be fixable by using list(new_df.columns), and implementing tests for the setters.

joe-pierce commented 1 month ago

Thanks @jacob-toller - I have created the branch 130-section-data-setter-fix for this