Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hru-delin-dev
hru-delin
Commits
a775a323
Unverified
Commit
a775a323
authored
Apr 28, 2020
by
Julien Veyssier
Browse files
fix one limit case: when basin number is smaller than process number
Signed-off-by:
Julien Veyssier
<
eneiluj@posteo.net
>
parent
32d35dd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/hrudelin_parms_J2000.py
View file @
a775a323
...
...
@@ -357,8 +357,8 @@ def main(parms_file, nbProc, generator=False):
print
(
'%s, %s, %s ... %s, %s, %s '
%
(
basin_ids
[
0
].
rstrip
(
'
\n
'
),
basin_ids
[
1
].
rstrip
(
'
\n
'
),
basin_ids
[
2
].
rstrip
(
'
\n
'
),
basin_ids
[
-
3
].
rstrip
(
'
\n
'
),
basin_ids
[
2
].
rstrip
(
'
\n
'
)
if
len
(
basin_ids
)
>
2
else
'???'
,
basin_ids
[
-
3
].
rstrip
(
'
\n
'
)
if
len
(
basin_ids
)
>
2
else
'???'
,
basin_ids
[
-
2
].
rstrip
(
'
\n
'
),
basin_ids
[
-
1
].
rstrip
(
'
\n
'
)
))
...
...
@@ -415,15 +415,19 @@ def main(parms_file, nbProc, generator=False):
tbflFrames
=
[]
for
i
in
range
(
nbProc
):
n
=
i
+
1
df
=
pd
.
read_table
(
os
.
path
.
join
(
tmpPath
,
'topologie_to_hru.par_tmp_proc%s'
%
n
),
names
=
(
'a'
,
'b'
,
'c'
,
'd'
))
df
.
dropna
(
inplace
=
True
)
df
=
df
.
astype
({
'a'
:
int
,
'b'
:
int
,
'c'
:
int
,
'd'
:
str
})
tthFrames
.
append
(
df
)
df
=
pd
.
read_table
(
os
.
path
.
join
(
tmpPath
,
'topologie_bfl.par_tmp_proc%s'
%
n
),
names
=
(
'a'
,
'b'
,
'c'
))
df
.
dropna
(
inplace
=
True
)
df
=
df
.
astype
({
'a'
:
int
,
'b'
:
int
,
'c'
:
str
})
tbflFrames
.
append
(
df
)
tthNPath
=
os
.
path
.
join
(
tmpPath
,
'topologie_to_hru.par_tmp_proc%s'
%
n
)
tbflNPath
=
os
.
path
.
join
(
tmpPath
,
'topologie_bfl.par_tmp_proc%s'
%
n
)
# they might not exist if subbasin number is less than number of process...
if
os
.
path
.
exists
(
tthNPath
)
and
os
.
path
.
exists
(
tbflNPath
):
df
=
pd
.
read_table
(
tthNPath
,
names
=
(
'a'
,
'b'
,
'c'
,
'd'
))
df
.
dropna
(
inplace
=
True
)
df
=
df
.
astype
({
'a'
:
int
,
'b'
:
int
,
'c'
:
int
,
'd'
:
str
})
tthFrames
.
append
(
df
)
df
=
pd
.
read_table
(
tbflNPath
,
names
=
(
'a'
,
'b'
,
'c'
))
df
.
dropna
(
inplace
=
True
)
df
=
df
.
astype
({
'a'
:
int
,
'b'
:
int
,
'c'
:
str
})
tbflFrames
.
append
(
df
)
strTime
=
time
.
strftime
(
'%a, %d %b %Y, %H:%M:%S'
,
time
.
localtime
())
dfTth
=
pd
.
concat
(
tthFrames
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment