diff --git a/PV-tool_TD.ipynb b/PV-tool_TD.ipynb index 294e1ac..84b7efa 100644 --- a/PV-tool_TD.ipynb +++ b/PV-tool_TD.ipynb @@ -136,13 +136,22 @@ "Requirement already satisfied: charset-normalizer in c:\\program files\\arcgis\\pro\\bin\\python\\envs\\arcgispro-py3\\lib\\site-packages (from reportlab->pv-tool==0.3.0) (3.3.2)\n", "pv-tool is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.\n" ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "[notice] A new release of pip is available: 25.3 -> 26.0.1\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n" + ] } ], "source": [ "# Importeren van benodigde package\n", "# Na het eerte keer installeren van de benodigde packages de kernel handmatig opnieuw optarten via het menu Kernel → Restart\n", "\n", - "path_to_wheel = r\"C:\\Users\\deenekat7271\\Documents\\GitHub\\pv-tool\\dist\\pv_tool-0.3.0-py3-none-any.whl\"\n", + "path_to_wheel = r\"C:\\Users\\deenekat7271\\Documents\\GitHub\\pv-tool\\dist\\pv_tool-0.3.1-py3-none-any.whl\"\n", "!pip install \"{path_to_wheel}\"" ] }, @@ -190,7 +199,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "c3a37b3490ff46229c88d164719334f6", + "model_id": "7d6fbafdccf441a09b9e4cd31b089b40", "version_major": 2, "version_minor": 0 }, @@ -204,7 +213,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "bca17979fd20436f8de2314f09a201a5", + "model_id": "385aeadadbf44cb2892730406fc50be5", "version_major": 2, "version_minor": 0 }, @@ -218,7 +227,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "b351473f65d746e38e566079dc0b09f8", + "model_id": "4e8ebebebfa84378b8f87eed76ef1c87", "version_major": 2, "version_minor": 0 }, @@ -291,10 +300,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "b57f023b-4ccc-4dd3-b280-04de0c09feb0", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Er is geen bestand geselecteerd. Selecteer een bestand voordat je verder gaat.\n" + ] + } + ], "source": [ "dbase = Dbase()\n", "handle_import_export(\n", @@ -316,10 +333,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "74326cfd-d35b-4c15-9924-84f8bce0a98f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Export gelijk aan import\n" + ] + } + ], "source": [ "# Export dbase-template\n", "if import_dropdown.value == \"Proevenverzamelingtool 5.0\":\n", @@ -428,7 +453,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "dbecda487d7b48b8a3ec58c40b7fa99c", + "model_id": "1dc3108b7c5e4c35a48d3ab1d4cf39e1", "version_major": 2, "version_minor": 0 }, @@ -454,7 +479,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "63ef8e7b146b484d8931c2e8bb454308", + "model_id": "afee32c5fb29406f8ec08bd65066c06d", "version_major": 2, "version_minor": 0 }, @@ -503,7 +528,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 6, "id": "a2a656ea-c578-4e03-8581-c62abcc881f1", "metadata": {}, "outputs": [ @@ -522,7 +547,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "df3e916c78734edf91cd21f549135c0f", + "model_id": "dd801a3f19934927929c8a465feae43d", "version_major": 2, "version_minor": 0 }, @@ -548,7 +573,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "9d840e4cadef4d6eb283a49fd571f099", + "model_id": "764f3bf2d9224797bdaca53d66d2b256", "version_major": 2, "version_minor": 0 }, @@ -574,7 +599,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "1c67be34cb4c477a9b87973a6007e0ab", + "model_id": "beffc7c56e2349918ab48dda9ff95b3d", "version_major": 2, "version_minor": 0 }, @@ -588,7 +613,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "a22d0e65f95d439ea70830079512b1e4", + "model_id": "2818745ad0614c48ac5959df2ec9570a", "version_major": 2, "version_minor": 0 }, @@ -614,7 +639,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "34ba822b364243eb9201e9c88620709f", + "model_id": "3efcd556d55a4d648deb1e25ac1c73e1", "version_major": 2, "version_minor": 0 }, @@ -634,7 +659,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 7, "id": "a072c003-04fb-4365-8055-0039cbb6d220", "metadata": {}, "outputs": [ @@ -642,7 +667,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "C:\\Users\\deenekat7271\\Documents\\GitHub\\pv-tool\\Template_PVtool5_0.xlsx\n" + "Data na filtering: 40 rijen gevonden\n" ] }, { @@ -737,7 +762,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ec97284f67cf47b5b0d5fdc70fd690ff", + "model_id": "08dee061534642be9e8bf8363be8cf3f", "version_major": 2, "version_minor": 0 }, @@ -771,7 +796,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 9, "id": "e1be909e-fdcd-4de2-8a75-a3d519bcb03e", "metadata": {}, "outputs": [ @@ -779,11 +804,14 @@ "name": "stdout", "output_type": "stream", "text": [ + "Data na filtering: 40 rijen gevonden\n", + "Data na filtering: 40 rijen gevonden\n", " tan phi [-] phi [graden] cohesie [kPa]\n", "Verwachtingswaarde 0.631335 32.265644 3.784375\n", "Karakteristieke waarde 0.625002 32.005455 0.011792\n", "Rekenwaarde 0.625002 32.005455 0.011792\n", "Standaarddeviatie D-stability [-] 0.158589 36.360538\n", + "Data na filtering: 40 rijen gevonden\n", "fysisch realiseerbare ondergrens gebaseerd op phi kar handmatig en cohesie kar handmatig\n", "gemiddelde gebaseerd op helling gecorrigeerd en cohesie gem handmatig\n" ] @@ -792,9 +820,9 @@ "data": { "text/html": [ "
\n", - "
\n", - "
\n", - "
\n", - "
\n", - "
\n", - "
\n", - "
+
+ + \ No newline at end of file diff --git a/import_files/SHANSEP_sv_su_TXT_klei_14_16.html b/import_files/SHANSEP_sv_su_TXT_klei_14_16.html new file mode 100644 index 0000000..afe390e --- /dev/null +++ b/import_files/SHANSEP_sv_su_TXT_klei_14_16.html @@ -0,0 +1,3888 @@ + + + +
+
+ + \ No newline at end of file diff --git a/import_files/SHANSEP_sv_su_nc_TXT_klei_14_16.html b/import_files/SHANSEP_sv_su_nc_TXT_klei_14_16.html new file mode 100644 index 0000000..933b6b9 --- /dev/null +++ b/import_files/SHANSEP_sv_su_nc_TXT_klei_14_16.html @@ -0,0 +1,3888 @@ + + + +
+
+ + \ No newline at end of file diff --git a/import_files/SU_ln_sv_ln_su_TXT_klei_14_16.html b/import_files/SU_ln_sv_ln_su_TXT_klei_14_16.html new file mode 100644 index 0000000..1f5dd1c --- /dev/null +++ b/import_files/SU_ln_sv_ln_su_TXT_klei_14_16.html @@ -0,0 +1,3888 @@ + + + +
+
+ + \ No newline at end of file diff --git a/import_files/SU_sv_su_TXT_klei_14_16.html b/import_files/SU_sv_su_TXT_klei_14_16.html new file mode 100644 index 0000000..a24e99b --- /dev/null +++ b/import_files/SU_sv_su_TXT_klei_14_16.html @@ -0,0 +1,3888 @@ + + + +
+
+ + \ No newline at end of file diff --git a/import_files/WSRL 2025 PVtool5_0_gevalideerd.xlsx b/import_files/WSRL 2025 PVtool5_0_gevalideerd.xlsx index 72aaa74..198936d 100644 Binary files a/import_files/WSRL 2025 PVtool5_0_gevalideerd.xlsx and b/import_files/WSRL 2025 PVtool5_0_gevalideerd.xlsx differ diff --git a/import_files/c-phi_analyse_TXT_klei_14_16.html b/import_files/c-phi_analyse_TXT_klei_14_16.html new file mode 100644 index 0000000..c9d89fc --- /dev/null +++ b/import_files/c-phi_analyse_TXT_klei_14_16.html @@ -0,0 +1,3888 @@ + + + +
+
+ + \ No newline at end of file diff --git a/import_files/c_phi_pdf_export_TXT_klei_14_16_TXT_CPhi_15procent_rek.pdf b/import_files/c_phi_pdf_export_TXT_klei_14_16_TXT_CPhi_15procent_rek.pdf new file mode 100644 index 0000000..d5b792a Binary files /dev/null and b/import_files/c_phi_pdf_export_TXT_klei_14_16_TXT_CPhi_15procent_rek.pdf differ diff --git a/import_files/shansep_pdf_export_TXT_klei_14_16_TXT_S_POP_eindsterkte.pdf b/import_files/shansep_pdf_export_TXT_klei_14_16_TXT_S_POP_eindsterkte.pdf new file mode 100644 index 0000000..b02a4be Binary files /dev/null and b/import_files/shansep_pdf_export_TXT_klei_14_16_TXT_S_POP_eindsterkte.pdf differ diff --git a/import_files/sutabel_pdf_export_TXT_klei_14_16_TXT_su_tabel_15procent_rek.pdf b/import_files/sutabel_pdf_export_TXT_klei_14_16_TXT_su_tabel_15procent_rek.pdf new file mode 100644 index 0000000..cb10217 Binary files /dev/null and b/import_files/sutabel_pdf_export_TXT_klei_14_16_TXT_su_tabel_15procent_rek.pdf differ diff --git a/import_files/temp_plot.png b/import_files/temp_plot.png new file mode 100644 index 0000000..f9e5e26 Binary files /dev/null and b/import_files/temp_plot.png differ diff --git a/import_files/temp_plot1.png b/import_files/temp_plot1.png new file mode 100644 index 0000000..df3147d Binary files /dev/null and b/import_files/temp_plot1.png differ diff --git a/import_files/temp_plot2.png b/import_files/temp_plot2.png new file mode 100644 index 0000000..ca7e1f2 Binary files /dev/null and b/import_files/temp_plot2.png differ diff --git a/import_files/temp_plot3.png b/import_files/temp_plot3.png new file mode 100644 index 0000000..8155ec4 Binary files /dev/null and b/import_files/temp_plot3.png differ diff --git a/import_files/temp_sutabel_plot1.png b/import_files/temp_sutabel_plot1.png new file mode 100644 index 0000000..465a8ff Binary files /dev/null and b/import_files/temp_sutabel_plot1.png differ diff --git a/import_files/temp_sutabel_plot2.png b/import_files/temp_sutabel_plot2.png new file mode 100644 index 0000000..0ecef77 Binary files /dev/null and b/import_files/temp_sutabel_plot2.png differ diff --git a/pv_tool/cphi_analysis/c_phi_analysis.py b/pv_tool/cphi_analysis/c_phi_analysis.py index dd83a11..ab904ef 100644 --- a/pv_tool/cphi_analysis/c_phi_analysis.py +++ b/pv_tool/cphi_analysis/c_phi_analysis.py @@ -1,8 +1,10 @@ from typing import Optional, List, Literal +from openpyxl import load_workbook, Workbook +from openpyxl.utils import get_column_letter from pathlib import Path from datetime import datetime -from pv_tool.utilities.utils import get_repo_root -from pandas import DataFrame, concat, read_excel, isna +from pv_tool.utilities.utils import get_repo_root, make_temp_folder +from pandas import DataFrame, ExcelWriter, concat, read_excel, isna from pv_tool.cphi_analysis.globals import (TEXTUAL_NAMES, ALL_TEXTUAL_NAMES, NEW_COLUMN_NAMES, TEXTUAL_NAMES_DSS, ALL_TEXTUAL_NAMES_DSS) from pv_tool.cphi_analysis.save_and_export import save_total_to_excel, save_to_pdf @@ -12,28 +14,25 @@ from pv_tool.cphi_analysis.expand_analysis_df import (calculate_tan_a, calculate_ln_tan_a, calculate_s_tt, calculate_s_ty, calculate_kappa_2, calculate_s, calculate_5pr_ondergrens, calculate_5pr_bovengrens, - calculate_s_tt_ondergrens, calculate_s_ty_ondergrens, - calculate_kappa_2_ondergrens, calculate_correctie_t, - kappa_2_2pr_cor, - calculate_5pr_ondergrens_correctie_c, - calculate_5pr_bovengrens_correctie_c, - calculate_s_ty_ondergrens_correctie_c, - calculate_kappa_2_ondergrens_correctie_c) + calculate_s_tt_ondergrens, calculate_s_ty_ondergrens, + calculate_kappa_2_ondergrens, calculate_correctie_t, kappa_2_2pr_cor, + calculate_5pr_ondergrens_correctie_c, + calculate_5pr_bovengrens_correctie_c, + calculate_s_ty_ondergrens_correctie_c, + calculate_kappa_2_ondergrens_correctie_c) from pv_tool.cphi_analysis.visualization import (add_proefresultaten, add_extra_proefresultaten, add_5pr_bovengrens, - add_5pr_ondergrens, add_fysische_realiseerbare_ondergrens, - add_gemiddelde, - set_layout, add_gemiddelde_sh, add_raaklijn_kar_boven, + add_5pr_ondergrens, add_fysische_realiseerbare_ondergrens, add_gemiddelde, + set_layout, add_gemiddelde_sh, add_raaklijn_kar_boven, add_raaklijn_kar_onder) from pv_tool.cphi_analysis.calc_parameters import (calc_watergehalte_gem, calc_watergehalte_sd, calc_vgwnat_gem, - calc_vgwnat_sd, calc_a2_phi_gem, calc_a2_kar, calc_phi_d, + calc_vgwnat_sd, calc_a2_phi_gem, calc_a2_kar, calc_phi_d, helling_gecorrigeerd, calc_a1_c_gem, calc_tan_phi_gem, calc_phi_kar, calc_a1_kar, calc_phi_gem, calc_c_gem, calc_tan_phi_kar, - calc_c_kar, calc_tan_phi_d, calc_c_d, calc_st_dev_phi, calc_st_dev_c, - calc_a2_phi_gem_sh, calc_a2_phi_kar_boven_sh, - calc_a2_phi_kar_onder_sh, + calc_c_kar, calc_tan_phi_d, calc_c_d, calc_st_dev_phi, calc_st_dev_c, + calc_a2_phi_gem_sh, calc_a2_phi_kar_boven_sh, calc_a2_phi_kar_onder_sh, calc_tan_phi_kar_sh) from openpyxl import load_workbook - +from pv_tool.imports.excel_utils import format_excel_sheet class CPhiAnalyse: """ @@ -46,8 +45,8 @@ class CPhiAnalyse: def __init__(self, dbase: Dbase, analysis_type: Literal['TXT_CPhi', 'TXT_SH', 'DSS_CPhi', 'DSS_SH'], investigation_groups: List, - effective_stress: Literal[ - '2% rek', '5% rek', '10% rek', '15% rek', '20% rek', 'pieksterkte', 'eindsterkte']): + effective_stress: Literal['2% rek', '5% rek', '10% rek', '15% rek', '20% rek', + 'pieksterkte', 'eindsterkte']): """ Initialiseert een nieuwe c-phi analyse. @@ -140,7 +139,7 @@ def get_cphi_data(self): if self.analysis_type in ['TXT_CPhi', 'TXT_SH']: self.cphi_analyses_data_df = self.dbase_df[self.dbase_df['ALG__TRIAXIAAL']] self.cphi_analyses_data_df = self.cphi_analyses_data_df[self.cphi_analyses_data_df['PV_NAAM'].isin( - self.investigation_groups)] + self.investigation_groups)] self.calc_watergehalte_gem = calc_watergehalte_gem(self) self.calc_watergehalte_sd = calc_watergehalte_sd(self) self.calc_vgwnat_gem = calc_vgwnat_gem(self) @@ -151,15 +150,14 @@ def get_cphi_data(self): # Valideer of er data overblijft na filtering if self.cphi_analyses_data_df.empty: raise ValueError(f"Geen data gevonden na filtering op investigation_groups {self.investigation_groups} " - f"en effective_stress '{self.effective_stress}' " - f"voor analyse type '{self.analysis_type}'") + f"en effective_stress '{self.effective_stress}' voor analyse type '{self.analysis_type}'") print(f"Data na filtering: {len(self.cphi_analyses_data_df)} rijen gevonden") elif self.analysis_type in ['DSS_CPhi', 'DSS_SH']: self.cphi_analyses_data_df = self.dbase_df[self.dbase_df['ALG__DSS']] self.cphi_analyses_data_df = self.cphi_analyses_data_df[self.cphi_analyses_data_df['PV_NAAM'].isin( - self.investigation_groups)] + self.investigation_groups)] self.calc_watergehalte_gem = calc_watergehalte_gem(self) self.calc_watergehalte_sd = calc_watergehalte_sd(self) self.calc_vgwnat_gem = calc_vgwnat_gem(self) @@ -170,8 +168,7 @@ def get_cphi_data(self): # Valideer of er data overblijft na filtering if self.cphi_analyses_data_df.empty: raise ValueError(f"Geen data gevonden na filtering op investigation_groups {self.investigation_groups} " - f"en effective_stress '{self.effective_stress}' " - f"voor analyse type '{self.analysis_type}'") + f"en effective_stress '{self.effective_stress}' voor analyse type '{self.analysis_type}'") print(f"Data na filtering: {len(self.cphi_analyses_data_df)} rijen gevonden") @@ -235,7 +232,7 @@ def plot_spanningspaden(self): wordt een apart spanningspad gemaakt met alle beschikbare spanningsstappen. Wordt aangeroepen binnen set_figure(). Het is aan de gebruiker om de spanningspaden wel of niet toe te voegen - aan de figuur + aan de figuur. """ if self.analysis_type in ['TXT_CPhi', 'TXT_SH']: relevant_df = self.dbase_df[self.dbase_df['ALG__TRIAXIAAL']] @@ -244,17 +241,15 @@ def plot_spanningspaden(self): elif self.analysis_type in ['DSS_CPhi', 'DSS_SH']: relevant_df = self.dbase_df[self.dbase_df['ALG__DSS']] relevant_df = relevant_df[relevant_df['PV_NAAM'].isin(self.investigation_groups)] - effective_stress_options = ['consolidatie', '2% rek', '5% rek', '10% rek', '15% rek', '20% rek', - 'pieksterkte', 'eindsterkte'] - relevant_df['DSS_T_CONSOLIDATIE'] = [0] * len(relevant_df) + effective_stress_options = ['consolidatie', '2% rek', '5% rek', '10% rek', '15% rek', '20% rek', 'pieksterkte', 'eindsterkte'] + relevant_df['DSS_T_CONSOLIDATIE'] = [0]*len(relevant_df) else: raise ValueError("Ongeldig analysetype. Gebruik 'TXT_CPhi', 'TXT_SH', 'DSS_CPhi' of 'DSS_SH'.") # Eerst verzamelen we alle data per spanningsstap all_data = {} for stress in effective_stress_options: - columns = ALL_TEXTUAL_NAMES.get(stress, []) \ - if self.analysis_type in ['TXT_CPhi', 'TXT_SH'] else ALL_TEXTUAL_NAMES_DSS.get(stress, []) + columns = ALL_TEXTUAL_NAMES.get(stress, []) if self.analysis_type in ['TXT_CPhi', 'TXT_SH'] else ALL_TEXTUAL_NAMES_DSS.get(stress, []) if len(columns) > 0: data = relevant_df[columns].copy() if not data.empty and not data.isna().all().all(): @@ -292,17 +287,15 @@ def plot_spanningspaden(self): stress_df = stress_df[stress_df['stress_state'] != 'pieksterkte'] if rek_bij_t_piek < 2: insert_index = 1 - elif rek_bij_t_piek < 5: + elif rek_bij_t_piek <5: insert_index = 2 - elif rek_bij_t_piek < 15: + elif rek_bij_t_piek <15: insert_index = 3 elif not isna(rek_bij_t_eind) and rek_bij_t_eind > rek_bij_t_piek: insert_index = 4 else: insert_index = len(stress_df) - stress_df = concat( - [stress_df.iloc[:insert_index], piek_row, stress_df.iloc[insert_index:]]).reset_index( - drop=True) + stress_df = concat([stress_df.iloc[:insert_index], piek_row, stress_df.iloc[insert_index:]]).reset_index(drop=True) elif self.analysis_type in ['DSS_CPhi', 'DSS_SH']: rek_bij_t_max = self.total_cphi_analyses_data_df.loc[sample_name, 'DSS_REK_BIJ_T_MAX'] rek_bij_t_eind = self.total_cphi_analyses_data_df.loc[sample_name, 'DSS_REK_BIJ_T_EIND'] @@ -312,24 +305,24 @@ def plot_spanningspaden(self): stress_df = stress_df[stress_df['stress_state'] != 'pieksterkte'] if rek_bij_t_max < 2: insert_index = 1 - elif rek_bij_t_max < 5: + elif rek_bij_t_max <5: insert_index = 2 - elif rek_bij_t_max < 10: + elif rek_bij_t_max <10: insert_index = 3 - elif rek_bij_t_max < 15: + elif rek_bij_t_max <15: insert_index = 4 - elif rek_bij_t_max < 20: + elif rek_bij_t_max <20: insert_index = 5 elif not isna(rek_bij_t_eind) and rek_bij_t_eind > rek_bij_t_max: insert_index = 6 else: insert_index = len(stress_df) - stress_df = concat( - [stress_df.iloc[:insert_index], piek_row, stress_df.iloc[insert_index:]]).reset_index( - drop=True) + stress_df = concat([stress_df.iloc[:insert_index], piek_row, stress_df.iloc[insert_index:]]).reset_index(drop=True) sample_stress_paths[sample_name] = stress_df + + # Plot de spanningspaden if sample_stress_paths: from pv_tool.cphi_analysis.visualization import add_stress_paths @@ -372,7 +365,7 @@ def get_previous_results(self, path: str, file_name: str): (results_df['PV_RESULTAAT_ID'].str.contains(self.investigation_groups[0])) & (results_df['PV_RESULTAAT_ID'].str.contains(self.effective_stress)) & (results_df['PV_RESULTAAT_ID'].str.contains(self.analysis_type)) - ] + ] if filtered_df.empty: print("Er zijn geen eerdere resultaten gevonden voor de opgegeven parameters.") @@ -598,7 +591,7 @@ def get_short_results(self): index = ['Verwachtingswaarde', 'Karakteristieke waarde', 'Rekenwaarde', 'Standaarddeviatie D-stability'] columns = ['tan phi [-]', 'phi [graden]'] analyse_output_df = DataFrame(index=index, columns=columns) - analyse_output_df['tan phi [-]'] = [self.tan_phi_gem, self.tan_phi_kar, self.tan_phi_d, '[-]'] + analyse_output_df['tan phi [-]'] = [self.tan_phi_gem, self.tan_phi_kar , self.tan_phi_d, '[-]'] analyse_output_df['phi [graden]'] = [self.phi_gem, self.phi_kar, self.phi_d, self.st_dev_phi] else: self._run() @@ -639,14 +632,10 @@ def add_results_to_template(self, path, export_name=None): 'PV_RESULTAAT_ID': f"{self.investigation_groups[0]}_{self.effective_stress}_" f"{self.analysis_type.split('_')[0]}_{self.analysis_type.split('_')[1]}", 'PV_TYPEVERZAMELING': self.alpha, - 'PV_A1_COH_GEM': round(self.gem_a1, 3) if self.gem_a1 is not None else None, - # TODO: gaat deze dan wel goed? - 'PV_A2_TAN_PHI_GEM': round(self.gem_a2, 3) if self.gem_a2 is not None else None, - # TODO: welke waarde? gem_a2 of tan_phi_gem - 'PV_A1_COH_KAR': round(self.kar_a1, 3) if self.kar_a1 is not None else None, - # TODO: gaat deze dan wel goed? - 'PV_A2_TAN_PHI_KAR': round(self.kar_a2, 3) if self.kar_a2 is not None else None, - # TODO: zelfde geld hier met kar_a2 of tan_phi_kar + 'PV_A1_COH_GEM': round(self.gem_a1, 3) if self.gem_a1 is not None else None, # TODO: gaat deze dan wel goed? + 'PV_A2_TAN_PHI_GEM': round(self.gem_a2, 3) if self.gem_a2 is not None else None, # TODO: welke waarde? gem_a2 of tan_phi_gem + 'PV_A1_COH_KAR': round(self.kar_a1, 3) if self.kar_a1 is not None else None, # TODO: gaat deze dan wel goed? + 'PV_A2_TAN_PHI_KAR': round(self.kar_a2, 3) if self.kar_a2 is not None else None, # TODO: zelfde geld hier met kar_a2 of tan_phi_kar 'PV_COH_GEM': ( round(self.c_gem, 3) if self.c_gem is not None and self.c_gem >= 0 diff --git a/pv_tool/cphi_analysis/visualization.py b/pv_tool/cphi_analysis/visualization.py index 2c0d9fa..6e6f608 100644 --- a/pv_tool/cphi_analysis/visualization.py +++ b/pv_tool/cphi_analysis/visualization.py @@ -360,8 +360,8 @@ def set_layout(self: CPhiAnalyse): yas_title = 't [kPa]' legend_title = 'Legenda' self.figure.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, diff --git a/pv_tool/shansep_analysis/shansep_analysis.py b/pv_tool/shansep_analysis/shansep_analysis.py index 0b3fc22..716f826 100644 --- a/pv_tool/shansep_analysis/shansep_analysis.py +++ b/pv_tool/shansep_analysis/shansep_analysis.py @@ -228,7 +228,7 @@ def get_previous_results(self, path: str, file_name: str): raise FileNotFoundError(f"Er is geen dbase aanwezig op de locatie {file_path}.") try: - results_df = read_excel(file_path, sheet_name='Resultaten SHANSEP', header=6) + results_df = read_excel(file_path, sheet_name='Resultaten SHANSEP', skiprows=6) except ValueError: print("Er is geen tabblad 'Resultaten' aanwezig in het Excel-bestand.") return None diff --git a/pv_tool/shansep_analysis/visualization_shansep.py b/pv_tool/shansep_analysis/visualization_shansep.py index 9313899..195ab30 100644 --- a/pv_tool/shansep_analysis/visualization_shansep.py +++ b/pv_tool/shansep_analysis/visualization_shansep.py @@ -528,8 +528,8 @@ def set_layout_sv_su(self: SHANSEP): legend_title = 'Legenda' self.figure_sv_su.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, @@ -551,8 +551,8 @@ def set_layout_ln_ocr_ln_s(self: SHANSEP): legend_title = 'Legenda' self.figure_ln_ocr_ln_s.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, @@ -574,8 +574,8 @@ def set_layout_sv_su_nc(self: SHANSEP): legend_title = 'Legenda' self.figure_sv_su_nc.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, diff --git a/pv_tool/sutabel_analysis/sutabel_analysis.py b/pv_tool/sutabel_analysis/sutabel_analysis.py index bc2e5ee..5900e3c 100644 --- a/pv_tool/sutabel_analysis/sutabel_analysis.py +++ b/pv_tool/sutabel_analysis/sutabel_analysis.py @@ -202,7 +202,7 @@ def get_previous_results(self, path: str, file_name: str): raise FileNotFoundError(f"Er is geen dbase aanwezig op de locatie {file_path}.") try: - results_df = read_excel(file_path, sheet_name='Resultaten SU-tabel-m', header=6) + results_df = read_excel(file_path, sheet_name='Resultaten SU-tabel-m', skiprows=6) except ValueError: print("Er is geen tabblad 'Resultaten' aanwezig in het Excel-bestand.") return None diff --git a/pv_tool/sutabel_analysis/visualization.py b/pv_tool/sutabel_analysis/visualization.py index c17681c..4731e76 100644 --- a/pv_tool/sutabel_analysis/visualization.py +++ b/pv_tool/sutabel_analysis/visualization.py @@ -150,8 +150,8 @@ def set_layout_ln_sv_ln_su_sutabel(self: "SUTABEL"): legend_title = 'Legenda' self.figure.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, diff --git a/pv_tool/sutabel_analysis/visualization_sutabel.py b/pv_tool/sutabel_analysis/visualization_sutabel.py index ca04774..1b957b8 100644 --- a/pv_tool/sutabel_analysis/visualization_sutabel.py +++ b/pv_tool/sutabel_analysis/visualization_sutabel.py @@ -207,8 +207,8 @@ def set_layout_ln_sv_ln_su_sutabel(self: "SUTABEL"): legend_title = 'Legenda' self.figure_ln_sv_ln_su.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, @@ -344,8 +344,8 @@ def set_layout_sv_su_sutabel(self: "SUTABEL"): legend_title = 'Legenda' self.figure_sv_su.update_layout( - width=1280, - height=720, + width=1152, + height=648, title=title if self.show_title else None, xaxis_title=xas_title, yaxis_title=yas_title, diff --git a/pv_tool/utilities/widget_functions_su.py b/pv_tool/utilities/widget_functions_su.py index dda56fe..00c626d 100644 --- a/pv_tool/utilities/widget_functions_su.py +++ b/pv_tool/utilities/widget_functions_su.py @@ -1,4 +1,5 @@ import ipywidgets as widgets +from ipywidgets import HTML from ipyfilechooser import FileChooser from IPython.display import display, Markdown, clear_output import importlib.util @@ -126,12 +127,12 @@ def create_param_grid(a2, a1, vc, handmatig_init=None): # Eerste rij: Titels grid[0, 0] = widgets.Label(f'Parameters', layout=widgets.Layout(width='200px')) - grid[0, 1] = widgets.Label(f'a2_kar', layout=widgets.Layout(width='200px')) - grid[0, 2] = widgets.Label(f'a1_kar', layout=widgets.Layout(width='200px')) - grid[0, 3] = widgets.Label(f'VC_fit', layout=widgets.Layout(width='200px')) + grid[0, 1] = HTML(value=f'a2kar helling ln(σ'v)/ln(su)', layout=widgets.Layout(width='200px')) + grid[0, 2] = HTML(value=f'a1kar snijpunt y-as ln(Su) [-]', layout=widgets.Layout(width='200px')) + grid[0, 3] = widgets.Label(f'Bepaal variatiecoëfficiënt [-]', layout=widgets.Layout(width='200px')) # Tweede rij: benaderingswaarden - grid[1, 0] = widgets.Label(f'Bepaling parameters uit triaxiaal- of DSS-proeven', layout=widgets.Layout(width='300px')) + grid[1, 0] = widgets.Label(f'Benadering', layout=widgets.Layout(width='300px')) grid[1, 1] = widgets.Label(f'{a2}', layout=widgets.Layout(width='200px')) grid[1, 2] = widgets.Label(f'{a1}', layout=widgets.Layout(width='200px')) grid[1, 3] = widgets.Label(f'{vc if vc is not None else "-"}', layout=widgets.Layout(width='200px')) @@ -147,6 +148,7 @@ def create_param_grid(a2, a1, vc, handmatig_init=None): vc_handmatig = widgets.FloatText(value=handmatig_init[2], step=0.01, layout=widgets.Layout(width='200px'), placeholder='-') + grid[2, 0] = widgets.Label(f'Handmatige invoer', layout=widgets.Layout(width='300px')) grid[2, 1] = a2_handmatig grid[2, 2] = a1_handmatig @@ -186,6 +188,7 @@ def run_su_analysis( # Grid aanmaken grid, handmatige_widgets = create_param_grid(a2_kar, a1_kar, cv) + display(Markdown("**Opgegeven karakteristieke waarden (fit):**")) display(grid) return analyse, handmatige_widgets diff --git a/setup.py b/setup.py index 46ba79b..049b9df 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setuptools.setup( name='PV-tool', - version='0.3.0', + version='0.3.1', author='Tjalda Deenekamp', author_email='leo.kwakman@arcadis.com', description='Functionalities concerning the PV-tool.',