modify_model#

swmmio.utils.modify_model.replace_inp_section(inp_path, modified_section_header, new_data)[source]#

modify an existing inp file by passing in new data (Pandas Dataframe) and the section header that should be modified. This function will overwrite all data in the old section with the passed data

Parameters:
  • inp_path – path to inp file to be changed

  • modified_section_header – section for which data should be change

  • new_data – pd.DataFrame of data to overwrite data in the modified section

Returns:

swmmio.Model instantiated with modified inp file