Skip to content

Commit

Permalink
Fix date format detection in analyser_merge_power_plant_FR
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Aug 7, 2023
1 parent 05782e0 commit 5e302b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion analysers/analyser_merge_power_plant_FR.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, config, logger = None):
"plant:source": lambda fields: self.filiere[fields["filiere"]][fields["combustible"]],
"plant:output:electricity": lambda fields: None if not fields["puisMaxRac"] else str(float(fields["puisMaxRac"]) / 1000).rstrip(".0") + " MW"},
mapping2 = {
"start_date": lambda fields: None if not fields["dateMiseEnService"] else fields["dateMiseEnService"][0:4] if fields["dateMiseEnService"].endswith('-01-01') or fields["dateMiseEnService"].endswith('-12-31') else '-'.join(fields["dateMiseEnService"].split('/')[::-1]) },
"start_date": lambda fields: None if not fields["dateMiseEnService"] else fields["dateMiseEnService"][0:4] if fields["dateMiseEnService"].endswith('/01/01') or fields["dateMiseEnService"].endswith('/12/31') else '-'.join(fields["dateMiseEnService"].split('/')[::-1]) },
text = lambda tags, fields: T_("Power plant {0}", ', '.join(filter(lambda res: res and res != 'None', [fields["nomInstallation"] if fields["nomInstallation"] != 'Confidentiel' else None, fields["commune"]]))) )))

filiere = {
Expand Down

0 comments on commit 5e302b8

Please sign in to comment.