-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWMM .inp File loses information by writing, running and reading in a for loop #64
Comments
@fcfunke Thanks for spotting this. I somehow can reproduce the issue with the SWMM examples shipped with the swmmr package. However, I am currently on paternity leave and thus it may take a while. |
issue potentially here: Lines 224 to 233 in 3e373e6
|
@fcfunke: |
@dleutnant When reading the input file for the first time, input$outfalls$Elevation is of type "dbl" and just contains the Elevation values:
A tibble: 20 x 6Name Elevation Type After the first write, run and read process input$outfalls$Elevation is of type "chr" and contains both Elevation and Type values:
A tibble: 20 x 6Name Elevation Type with best regards |
Thanks for your report. Would you be able to file a reproducible example using one of SWMM's model examples shipped with the package? |
Hi everyone!
I am struggling with a problem reading, writing and running the same SWMM .inp File in a for-loop several times.
The problem appears in the $outfalls part of the SWMM .inp File, affecting the "Tide Gate" and "Route To" parameters.
The data is switching columns in the tibble and losing information, resulting in a SWMM error.
I reproduced the problem by reading and writing the same .inp file 3 times without changing anything. (see below)
Interestingly if I run the .inp file without the "Route To" Parameter (SG31) it still works.
`> input_test <- swmmr::read_inp(x = "D://Uni_Innsbruck/Dauerstufen_Jaehrlichkeiten_Analyse/SWMM_Modell_Berlin/inp_test/Mulde5_0.inp")
Warnmeldungen:
1: Expected 6 pieces. Additional pieces discarded in 14 rows [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].
2: Expected 9 pieces. Additional pieces discarded in 14 rows [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].
A tibble: 3 x 6
Name Elevation Type
Stage Data
GatedRoute To
1 Out5 46.7 FREE NA O ""
2 Out2 47.6 FREE NA NO "SG31"
3 Out1 0 FREE NA NO ""
A tibble: 3 x 6
Name Elevation Type
Stage Data
GatedRoute To
1 Out5 46.7 FREE "O" NA NA NA
2 Out2 47.6 FREE "NO SG31" NA NA NA
3 Out1 0 FREE NO "" NA NA NA
A tibble: 3 x 6
Name Elevation Type
Stage Data
GatedRoute To
1 Out5 46.7 FREE "" NA NA NA
2 Out2 47.6 FREE "O SG31" NA NA NA
3 Out1 0 FREE NO "" NA NA NA `
Thanks for any help!
with best regards
Fabian
The text was updated successfully, but these errors were encountered: