diff --git a/CHANGELOG b/CHANGELOG index 81ff9542506469619bc3a6375abbc03a25003d1e..682c708038190d2cf5f6953f1e826d06b9a4fc0f 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +1.0.6 + 2021/XX/XX + + - Avoid to create static R-LINE files if the file already exist + 1.0.5 2020/12/09 diff --git a/environment.yml b/environment.yml index 584e815d9fbd3e5843f104f8f1f0bbab6c8866e2..a32aac5fd301c024bf78134856ba1a520a84c12d 100755 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ channels: - anaconda dependencies: - - python = 2 + - python = 3 - numpy - netcdf4 >= 1.3.1 - python-cdo >= 1.3.6 diff --git a/hermesv3_bu/sectors/traffic_sector.py b/hermesv3_bu/sectors/traffic_sector.py index 35e1e3015a240673397b673901880a2721add382..306e1459f56582c14a7baf59117dd3b1dec827ee 100755 --- a/hermesv3_bu/sectors/traffic_sector.py +++ b/hermesv3_bu/sectors/traffic_sector.py @@ -1557,7 +1557,8 @@ class TrafficSector(Sector): df_in = df_in.to_crs({u'units': u'm', u'no_defs': True, u'ellps': u'intl', u'proj': u'utm', u'zone': 31}) if rline_shp: - df_in.to_file(os.path.join(self.output_dir, 'roads.shp')) + if not os.path.exists(os.path.join(self.output_dir, 'roads.shp')): + df_in.to_file(os.path.join(self.output_dir, 'roads.shp')) count = 0 for i, line in df_in.iterrows(): @@ -1604,7 +1605,8 @@ class TrafficSector(Sector): df_out.set_index('Link_ID', inplace=True) df_out.sort_index(inplace=True) - df_out.to_csv(os.path.join(self.output_dir, 'roads.txt'), index=False, sep=' ') + if not os.path.exists(os.path.join(self.output_dir, 'roads.txt')): + df_out.to_csv(os.path.join(self.output_dir, 'roads.txt'), index=False, sep=' ') self.comm.Barrier() self.logger.write_log('\t\tTraffic emissions calculated', message_level=2) self.logger.write_time_log('TrafficSector', 'write_rline_roadlinks', timeit.default_timer() - spent_time)