diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eeab6d0da1ca657ee271f322b238dc0aacc41e92..fee7ff79e851dcce3b6c60a1f68263d733270c97 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ prepare: test_python2: stage: test script: - - conda env update -f environment.yml -n hermesv3_gr python=2.7 + - conda env update -f environment.yml -n hermesv3_gr python=3.6 - source activate hermesv3_gr - python run_test.py # - pip install codacy-coverage --upgrade diff --git a/hermesv3_bu/hermes.py b/hermesv3_bu/hermes.py index 2dd8557b27e3cfdf0812ab00c7d267ded91e8c81..b8841bd3d4f181a3eb6b4112e941f6a4ed21ac10 100755 --- a/hermesv3_bu/hermes.py +++ b/hermesv3_bu/hermes.py @@ -30,8 +30,10 @@ class Hermes(object): self.grid) self.date_array = [self.arguments.start_date + timedelta(hours=hour) for hour in range(self.arguments.output_timestep_num)] - self.logger.write_log('Dates to simulate: {0}'.format( - [aux_date.strftime("\n\t%Y/%m/%d, %H:%M:%S") for aux_date in self.date_array]), message_level=3) + + self.logger.write_log('Dates to simulate:', message_level=3) + for aux_date in self.date_array: + self.logger.write_log('\t{0}'.format(aux_date.strftime("%Y/%m/%d, %H:%M:%S")), message_level=3) self.sector_manager = SectorManager( self.comm, self.logger, self.grid, self.clip, self.date_array, self.arguments) diff --git a/hermesv3_bu/sectors/traffic_area_sector.py b/hermesv3_bu/sectors/traffic_area_sector.py index a7cad42f39884f5a23b8c90b2c2f34c6e30685b2..64db3da48fc68439b24dd8e020acd93192e5e2ea 100755 --- a/hermesv3_bu/sectors/traffic_area_sector.py +++ b/hermesv3_bu/sectors/traffic_area_sector.py @@ -59,14 +59,14 @@ class TrafficAreaSector(Sector): if not os.path.exists(os.path.join(self.auxiliary_dir, 'traffic_area', 'vehicle_by_cell.shp')): self.logger.write_log('\t\tCreating population shapefile.', message_level=3) pop = self.get_clipped_population( - global_path, os.path.join(self.auxiliary_dir, 'traffic_area', 'population.shp'), write_file=True) + global_path, os.path.join(self.auxiliary_dir, 'traffic_area', 'population.shp'), write_file=False) self.logger.write_log('\t\tCreating population shapefile by NUT.', message_level=3) pop = self.make_population_by_nuts( pop, provinces_shapefile, os.path.join(self.auxiliary_dir, 'traffic_area', 'pop_NUT.shp'), - write_file=True) + write_file=False) self.logger.write_log('\t\tCreating population shapefile by NUT and cell.', message_level=3) pop = self.make_population_by_nuts_cell( - pop, os.path.join(self.auxiliary_dir, 'traffic_area', 'pop_NUT_cell.shp'), write_file=True) + pop, os.path.join(self.auxiliary_dir, 'traffic_area', 'pop_NUT_cell.shp'), write_file=False) self.logger.write_log('\t\tCreating vehicle shapefile by cell.', message_level=3) veh_cell = self.make_vehicles_by_cell( pop, gasoline_path, pd.read_csv(total_pop_by_prov), @@ -89,11 +89,11 @@ class TrafficAreaSector(Sector): if not os.path.exists(os.path.join(self.auxiliary_dir, 'traffic_area', 'pop_SMALL_cell.shp')): self.logger.write_log('\t\tCreating population shapefile.', message_level=3) pop = self.get_clipped_population( - global_path, os.path.join(self.auxiliary_dir, 'traffic_area', 'population.shp'), write_file=True) + global_path, os.path.join(self.auxiliary_dir, 'traffic_area', 'population.shp'), write_file=False) self.logger.write_log('\t\tCreating population small cities shapefile.', message_level=3) pop = self.make_population_by_nuts( pop, small_cities_shapefile, os.path.join(self.auxiliary_dir, 'traffic_area', 'pop_SMALL.shp'), - write_file=True) + write_file=False) self.logger.write_log('\t\tCreating population small cities shapefile by cell.', message_level=3) pop = self.make_population_by_nuts_cell( pop, os.path.join(self.auxiliary_dir, 'traffic_area', 'pop_SMALL_cell.shp'), write_file=True)