swmmio
swmmio copied to clipboard
Avoid writting DataFrame index into hotstart
Avoid writting the index of DataFrame into header "FILES:, which will cause the error of "ERROR 205: invalid keyword 0 (or 1)at line # of [FILE] section"
Don't know why checks failed yet, it works locally with Linux Python 27.
@algchyhao, thanks for this contribution! I think the reason the checks are failing is because the index (as it is currently used in most dataframe model sections) is important when changing INP sections with swmmio. The index of each dataframe in the typical sections (e.g. [CONDUITS])contains the model element ID. The problem is not all sections of INP file follow the same format (e.g. [FILES]).
Because of this, the changes you've proposed cause issues in the version_control module, in which a lot of INP manipulations occur. To resolve this, we'll need to develop specific logic to handle each of the unusual INP sections. Check out issue #57 - there we're tracking our progress on handling all of the INP sections. When we resovle this PR, I think we should be able to checkout off the [FILES] section from #57.
As next step, can you put together a unit test that checks that we properly handle the [FILES] section? From there, I expect we'll need to develop some conditional logic that checks if the section we're parsing/writing is of this unusual format.
This issue is being resolved in #165. Once that is merged, I think we can close out this PR ❤️