En raison du déménagement des baies serveurs, les services gitlab.irstea.fr et mattermost.irstea.fr seront interrompus le samedi 2 octobre 2021 au matin. Ils devraient revenir à la normale dans la journée.

Unverified Commit a775a323 authored by Julien Veyssier's avatar Julien Veyssier
Browse files

fix one limit case: when basin number is smaller than process number


Signed-off-by: default avatarJulien Veyssier <eneiluj@posteo.net>
parent 32d35dd2
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment