diff redelacxlsx2csv.py @ 2:3dfb066dcdab draft default tip

"planemo upload for repository https://forgemia.inra.fr/redelac/redelac-toolbox/-/tree/e8749ba309ff18daeaea5c4a9e7ee4b7448bd58d/tools/REDELACxlsx2csv commit e8749ba309ff18daeaea5c4a9e7ee4b7448bd58d-dirty"
author siwaa
date Fri, 05 Dec 2025 16:12:55 +0000
parents b91beff0963c
children
line wrap: on
line diff
--- a/redelacxlsx2csv.py	Thu Jul 06 10:16:26 2023 +0000
+++ b/redelacxlsx2csv.py	Fri Dec 05 16:12:55 2025 +0000
@@ -7,6 +7,7 @@
 redelacIniOutputFile = sys.argv[4]
 redelacStationOutputFile = sys.argv[5]
 redelacListe_plantesOutputFile = sys.argv[6]
+redelacSuccessionsOutputFile = sys.argv[7]
 
 # loading
 
@@ -15,6 +16,7 @@
 IniPdf = pd.read_excel(redelacXlsxInputFile, engine = 'openpyxl', sheet_name='Ini')
 StationPdf = pd.read_excel(redelacXlsxInputFile, engine = 'openpyxl', sheet_name='Station')
 Liste_plantesPdf = pd.read_excel(redelacXlsxInputFile, engine = 'openpyxl', sheet_name='Liste_plantes')
+Successions = pd.read_excel(redelacXlsxInputFile, engine = 'openpyxl', sheet_name='liste_USMs') 
 
 # sanityzing
 
@@ -22,8 +24,10 @@
 
 TecPdf[julCol] = TecPdf[julCol].astype('Int64')
 
-USMsPdf['fclim1'] = USMsPdf['fclim1'].astype('string')
-USMsPdf['fclim2'] = USMsPdf['fclim1'].astype('string')
+
+
+USMsPdf['fclim1'] = USMsPdf['fclim1'].apply(lambda x: format(x, ".4f")).astype('string')
+USMsPdf['fclim2'] = USMsPdf['fclim2'].apply(lambda x: format(x, ".4f")).astype('string')
 USMsPdf['rcp'] = USMsPdf['rcp'].astype('string')
 
 USMsPdf['Début'] = pd.to_datetime(USMsPdf['Début'], dayfirst = True)
@@ -38,3 +42,4 @@
 IniPdf.to_csv(redelacIniOutputFile, sep=';', date_format='%d/%m/%Y', decimal = ',', index=False)
 StationPdf.to_csv(redelacStationOutputFile, sep=';', date_format='%d/%m/%Y', decimal = ',', index=False)
 Liste_plantesPdf.to_csv(redelacListe_plantesOutputFile, sep=';', date_format='%d/%m/%Y', decimal = ',', index=False)
+Successions.to_csv(redelacSuccessionsOutputFile, sep=';', index=False)