diff --git a/.gitignore b/.gitignore index 164f969a9ef9cd8d8f6b20ac55672debe613951f..0c742b437177d0cff3c897c3ff274deea8c6e8c6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ GUI_Pinard.iml __pycache__/ src/Report/*.pdf src/Report/*.tex -config/config.json \ No newline at end of file +src/Report/*.zip +src/Report/figures/*.pdf +src/Report/figures/*.png +config/config.json diff --git a/file.txt b/file.txt deleted file mode 100644 index ba6ab5abdc4a80defa5315cf26001b8a106ab77c..0000000000000000000000000000000000000000 --- a/file.txt +++ /dev/null @@ -1 +0,0 @@ -Contenu du fichier file.txt \ No newline at end of file diff --git a/file_sub.txt b/file_sub.txt deleted file mode 100644 index bf8b4392b3084cbadffad91db0e0941c9bcc458c..0000000000000000000000000000000000000000 --- a/file_sub.txt +++ /dev/null @@ -1 +0,0 @@ -Contenu du fichier file_sub.txt \ No newline at end of file diff --git a/src/Modules.py b/src/Modules.py index db36ca7359f884380f56c44bd7bc554f7760965c..da66759402e8d06f881fcddb8fc7829c01be1102 100644 --- a/src/Modules.py +++ b/src/Modules.py @@ -6,7 +6,7 @@ from Class_Mod.Miscellaneous import prediction, download_results, plot_spectra, from style.header import add_header from Report import report css_file = Path("style/") - +from config.config import pdflatex_path local_css(css_file / "style.css") # path = os.path.dirname(os.path.abspath(__file__)).replace('\\','/') diff --git a/src/Packages.py b/src/Packages.py index b090edf0aac71ee112b4ecd5cde132717a6ffb67..7b80d48264ca5daab1f27235270c2d5766466382 100644 --- a/src/Packages.py +++ b/src/Packages.py @@ -10,7 +10,9 @@ import random import datetime import numpy as np import pandas as pd +import zipfile from matplotlib import colors +from matplotlib.colors import Normalize from abc import ABC,abstractmethod from typing import Optional, List from sklearn.preprocessing import StandardScaler, MinMaxScaler, LabelEncoder @@ -22,6 +24,10 @@ import kennard_stone as ks ### Exploratory data analysis-Dimensionality reduction from umap.umap_ import UMAP from sklearn.decomposition import PCA, NMF +from pandas.api.types import is_float_dtype +from plotly.subplots import make_subplots +from matplotlib.cm import ScalarMappable +import streamlit.components.v1 as components # Clustering from sklearn.cluster import KMeans, HDBSCAN,AffinityPropagation @@ -47,7 +53,7 @@ from PIL import Image import plotly.express as px import plotly.graph_objects as go import plotly.io as pio -import matplotlib.pyplot as plt +import matplotlib.pyplot as plt, mpld3 import seaborn as sns import matplotlib diff --git a/src/Report/archive_zipfile.zip b/src/Report/archive_zipfile.zip deleted file mode 100644 index 3554fcc587bbc3574727c1bb06c968fbdfd8914a..0000000000000000000000000000000000000000 Binary files a/src/Report/archive_zipfile.zip and /dev/null differ diff --git a/src/Report/figures/Allinone.png b/src/Report/figures/Allinone.png deleted file mode 100644 index a4dc8ada669da5f434a558eda4be40f72251c5fd..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/Allinone.png and /dev/null differ diff --git a/src/Report/figures/Elbow.png b/src/Report/figures/Elbow.png deleted file mode 100644 index 1f87b337338d6112eb22155d9d5a001101bbad40..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/Elbow.png and /dev/null differ diff --git a/src/Report/figures/Predictedvs.png b/src/Report/figures/Predictedvs.png deleted file mode 100644 index 6ae9531b889e093b98576926295722feca3d7398..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/Predictedvs.png and /dev/null differ diff --git a/src/Report/figures/Predictions_V.png b/src/Report/figures/Predictions_V.png deleted file mode 100644 index c9b894e6dc1ec658c3a217edbb5609909590ba28..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/Predictions_V.png and /dev/null differ diff --git a/src/Report/figures/Spectra_Plot.png b/src/Report/figures/Spectra_Plot.png deleted file mode 100644 index 36e193bd9ffb057c4a0e83dfd8671a79766560e4..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/Spectra_Plot.png and /dev/null differ diff --git a/src/Report/figures/Spectre_mod.png b/src/Report/figures/Spectre_mod.png deleted file mode 100644 index 5182eb0ac36af6a7ec4d20a9b4c2aa112ee647c9..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/Spectre_mod.png and /dev/null differ diff --git a/src/Report/figures/graphe_hotelling.png b/src/Report/figures/graphe_hotelling.png deleted file mode 100644 index bd1a4a0dca86fb238f48b7e6618413967f7daf9c..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/graphe_hotelling.png and /dev/null differ diff --git a/src/Report/figures/graphe_influence.png b/src/Report/figures/graphe_influence.png deleted file mode 100644 index 696bf6d2d7a5cd0299f901b18b13b29c83fc49c2..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/graphe_influence.png and /dev/null differ diff --git a/src/Report/figures/graphe_loadings.png b/src/Report/figures/graphe_loadings.png deleted file mode 100644 index e7dccdbbc1910b90dfeb2a15ec9b9d5bc612cbd9..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/graphe_loadings.png and /dev/null differ diff --git a/src/Report/figures/histo.png b/src/Report/figures/histo.png deleted file mode 100644 index 61433bc2f02669c5c87d03d505d5f98819ebaf3c..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/histo.png and /dev/null differ diff --git a/src/Report/figures/plot_axe1_axe2.png b/src/Report/figures/plot_axe1_axe2.png deleted file mode 100644 index f7c9e63ef6168b77726c640b549cebb10f795462..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/plot_axe1_axe2.png and /dev/null differ diff --git a/src/Report/figures/plot_axe1_axe3.png b/src/Report/figures/plot_axe1_axe3.png deleted file mode 100644 index 17ac0051ec0213c1dcd897b8e926318057dc4272..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/plot_axe1_axe3.png and /dev/null differ diff --git a/src/Report/figures/plot_axe2_axe3.png b/src/Report/figures/plot_axe2_axe3.png deleted file mode 100644 index b018fd5c6f66bac24913608b046689269db11ba5..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/plot_axe2_axe3.png and /dev/null differ diff --git a/src/Report/figures/residual_plot.png b/src/Report/figures/residual_plot.png deleted file mode 100644 index 42ebc2b61014d42afea774769f243ce87e082718..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/residual_plot.png and /dev/null differ diff --git a/src/Report/figures/test.png b/src/Report/figures/test.png deleted file mode 100644 index 0eb4afabee5140c00f578d2d3f1126b6a7efafb5..0000000000000000000000000000000000000000 Binary files a/src/Report/figures/test.png and /dev/null differ diff --git a/src/Report/report.aux b/src/Report/report.aux deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/Report/report.bbl b/src/Report/report.bbl deleted file mode 100644 index 9b431fad0d4079afd902592878894a32b623a159..0000000000000000000000000000000000000000 --- a/src/Report/report.bbl +++ /dev/null @@ -1,3 +0,0 @@ -\begin{thebibliography}{} - -\end{thebibliography} diff --git a/src/Report/report.blg b/src/Report/report.blg deleted file mode 100644 index 841ed34da7c437c511b16b462f6d379b1e6aa4d7..0000000000000000000000000000000000000000 --- a/src/Report/report.blg +++ /dev/null @@ -1,50 +0,0 @@ -This is BibTeX, Version 0.99d -Capacity: max_strings=200000, hash_size=200000, hash_prime=170003 -The top-level auxiliary file: report.aux -Reallocating 'name_of_file' (item size: 1) to 8 items. -The style file: apalike.bst -Reallocating 'name_of_file' (item size: 1) to 9 items. -I found no \citation commands---while reading file report.aux -Database file #1: refs.bib -You've used 0 entries, - 1935 wiz_defined-function locations, - 471 strings with 3672 characters, -and the built_in function-call counts, 17 in all, are: -= -- 0 -> -- 0 -< -- 0 -+ -- 0 -- -- 0 -* -- 0 -:= -- 7 -add.period$ -- 0 -call.type$ -- 0 -change.case$ -- 0 -chr.to.int$ -- 0 -cite$ -- 0 -duplicate$ -- 0 -empty$ -- 1 -format.name$ -- 0 -if$ -- 1 -int.to.chr$ -- 1 -int.to.str$ -- 0 -missing$ -- 0 -newline$ -- 3 -num.names$ -- 0 -pop$ -- 0 -preamble$ -- 1 -purify$ -- 0 -quote$ -- 0 -skip$ -- 1 -stack$ -- 0 -substring$ -- 0 -swap$ -- 0 -text.length$ -- 0 -text.prefix$ -- 0 -top$ -- 0 -type$ -- 0 -warning$ -- 0 -while$ -- 0 -width$ -- 0 -write$ -- 2 -(There was 1 error message) diff --git a/src/Report/report.log b/src/Report/report.log deleted file mode 100644 index 3c32b6e14335f78a98ec3dfde960f76a7d5c8f73..0000000000000000000000000000000000000000 --- a/src/Report/report.log +++ /dev/null @@ -1,320 +0,0 @@ -This is pdfTeX, Version 3.141592653-2.6-1.40.25 (MiKTeX 24.1) (preloaded format=pdflatex 2024.6.4) 4 JUN 2024 17:10 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**./report.tex -(report.tex -LaTeX2e <2023-11-01> patch level 1 -L3 programming layer <2024-01-04> -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls -Document Class: article 2023/05/17 v1.4n Standard LaTeX document class -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo -File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) -) -\c@part=\count187 -\c@section=\count188 -\c@subsection=\count189 -\c@subsubsection=\count190 -\c@paragraph=\count191 -\c@subparagraph=\count192 -\c@figure=\count193 -\c@table=\count194 -\abovecaptionskip=\skip48 -\belowcaptionskip=\skip49 -\bibindent=\dimen140 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/fancyhdr\fancyhdr.sty -Package: fancyhdr 2024/04/23 v4.2 Extensive control of page headers and footers - -\f@nch@headwidth=\skip50 -\f@nch@O@elh=\skip51 -\f@nch@O@erh=\skip52 -\f@nch@O@olh=\skip53 -\f@nch@O@orh=\skip54 -\f@nch@O@elf=\skip55 -\f@nch@O@erf=\skip56 -\f@nch@O@olf=\skip57 -\f@nch@O@orf=\skip58 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphicx.sty -Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty -Package: keyval 2022/05/29 v1.15 key=value parser (DPC) -\KV@toks@=\toks17 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphics.sty -Package: graphics 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics\trig.sty -Package: trig 2021/08/11 v1.11 sin cos tan (DPC) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\graphics.c -fg -File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration -) -Package graphics Info: Driver file: pdftex.def on input line 107. - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics-def\pdftex.def -File: pdftex.def 2022/09/22 v1.2b Graphics/color driver for pdftex -)) -\Gin@req@height=\dimen141 -\Gin@req@width=\dimen142 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/geometry\geometry.sty -Package: geometry 2020/01/02 v5.9 Page Geometry - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifvtex.sty -Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead. - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty -Package: iftex 2022/02/03 v1.0f TeX engine tests -)) -\Gm@cnth=\count195 -\Gm@cntv=\count196 -\c@Gm@tempcnt=\count197 -\Gm@bindingoffset=\dimen143 -\Gm@wd@mp=\dimen144 -\Gm@odd@mp=\dimen145 -\Gm@even@mp=\dimen146 -\Gm@layoutwidth=\dimen147 -\Gm@layoutheight=\dimen148 -\Gm@layouthoffset=\dimen149 -\Gm@layoutvoffset=\dimen150 -\Gm@dimlist=\toks18 - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/geometry\geometry.cfg)) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/caption\caption.sty -Package: caption 2023/08/05 v3.6o Customizing captions (AR) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/caption\caption3.sty -Package: caption3 2023/07/31 v2.4d caption3 kernel (AR) -\caption@tempdima=\dimen151 -\captionmargin=\dimen152 -\caption@leftmargin=\dimen153 -\caption@rightmargin=\dimen154 -\caption@width=\dimen155 -\caption@indent=\dimen156 -\caption@parindent=\dimen157 -\caption@hangindent=\dimen158 -Package caption Info: Standard document class detected. -) -\c@caption@flags=\count198 -\c@continuedfloat=\count199 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/caption\subcaption.sty -Package: subcaption 2023/07/28 v1.6b Sub-captions (AR) -Package caption Info: New subtype `subfigure' on input line 238. -\c@subfigure=\count266 -Package caption Info: New subtype `subtable' on input line 238. -\c@subtable=\count267 -) (C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hyperref\hyperref.sty -Package: hyperref 2023-11-26 v7.01g Hypertext links for LaTeX - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/infwarerr\infwarerr.s -ty -Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/kvsetkeys\kvsetkeys.sty -Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/kvdefinekeys\kvdefine -keys.sty -Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/pdfescape\pdfescape.s -ty -Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/ltxcmds\ltxcmds.sty -Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/pdftexcmds\pdftexcmds -.sty -Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO -) -Package pdftexcmds Info: \pdf@primitive is available. -Package pdftexcmds Info: \pdf@ifprimitive is available. -Package pdftexcmds Info: \pdfdraftmode found. -)) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hycolor\hycolor.sty -Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/letltxmacro\letltxmacro -.sty -Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/auxhook\auxhook.sty -Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hyperref\nameref.sty -Package: nameref 2023-11-26 v2.56 Cross-referencing by name of section - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/refcount\refcount.sty -Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO) -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/gettitlestring\gettit -lestring.sty -Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/kvoptions\kvoptions.sty -Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO) -)) -\c@section@level=\count268 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/etoolbox\etoolbox.sty -Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW) -\etb@tempcnta=\count269 -) -\@linkdim=\dimen159 -\Hy@linkcounter=\count270 -\Hy@pagecounter=\count271 - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hyperref\pd1enc.def -File: pd1enc.def 2023-11-26 v7.01g Hyperref: PDFDocEncoding definition (HO) -Now handling font encoding PD1 ... -... no UTF-8 mapping file for font encoding PD1 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/intcalc\intcalc.sty -Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO) -) -\Hy@SavedSpaceFactor=\count272 - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hyperref\puenc.def -File: puenc.def 2023-11-26 v7.01g Hyperref: PDF Unicode definition (HO) -Now handling font encoding PU ... -... no UTF-8 mapping file for font encoding PU -) -Package hyperref Info: Hyper figures OFF on input line 4181. -Package hyperref Info: Link nesting OFF on input line 4186. -Package hyperref Info: Hyper index ON on input line 4189. -Package hyperref Info: Plain pages OFF on input line 4196. -Package hyperref Info: Backreferencing OFF on input line 4201. -Package hyperref Info: Implicit mode ON; LaTeX internals redefined. -Package hyperref Info: Bookmarks ON on input line 4448. -\c@Hy@tempcnt=\count273 - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/url\url.sty -\Urlmuskip=\muskip16 -Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. -) -LaTeX Info: Redefining \url on input line 4786. -\XeTeXLinkMargin=\dimen160 - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/bitset\bitset.sty -Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/bigintcalc\bigintcalc -.sty -Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO -) -)) -\Fld@menulength=\count274 -\Field@Width=\dimen161 -\Fld@charsize=\dimen162 -Package hyperref Info: Hyper figures OFF on input line 6065. -Package hyperref Info: Link nesting OFF on input line 6070. -Package hyperref Info: Hyper index ON on input line 6073. -Package hyperref Info: backreferencing OFF on input line 6080. -Package hyperref Info: Link coloring OFF on input line 6085. -Package hyperref Info: Link coloring with OCG OFF on input line 6090. -Package hyperref Info: PDF/A mode OFF on input line 6095. - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/base\atbegshi-ltx.sty -Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi -package with kernel methods -) -\Hy@abspage=\count275 -\c@Item=\count276 -\c@Hfootnote=\count277 -) -Package hyperref Info: Driver (autodetected): hpdftex. -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hyperref\hpdftex.def -File: hpdftex.def 2023-11-26 v7.01g Hyperref driver for pdfTeX - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/base\atveryend-ltx.sty -Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atveryend pac -kage -with kernel methods -) -\Fld@listcount=\count278 -\c@bookmark@seq@number=\count279 - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/rerunfilecheck\rerunfil -echeck.sty -Package: rerunfilecheck 2022-07-10 v1.10 Rerun checks for auxiliary files (HO) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/generic/uniquecounter\uniquec -ounter.sty -Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO) -) -Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2 -85. -) -\Hy@SectionHShift=\skip59 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/hyphenat\hyphenat.sty -Package: hyphenat 2009/09/02 v2.3c hyphenation utilities -\langwohyphens=\language79 -LaTeX Info: Redefining \_ on input line 43. -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/booktabs\booktabs.sty -Package: booktabs 2020/01/12 v1.61803398 Publication quality tables -\heavyrulewidth=\dimen163 -\lightrulewidth=\dimen164 -\cmidrulewidth=\dimen165 -\belowrulesep=\dimen166 -\belowbottomsep=\dimen167 -\aboverulesep=\dimen168 -\abovetopsep=\dimen169 -\cmidrulesep=\dimen170 -\cmidrulekern=\dimen171 -\defaultaddspace=\dimen172 -\@cmidla=\count280 -\@cmidlb=\count281 -\@aboverulesep=\dimen173 -\@belowrulesep=\dimen174 -\@thisruleclass=\count282 -\@lastruleclass=\count283 -\@thisrulewidth=\dimen175 -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/xcolor\xcolor.sty -Package: xcolor 2023/11/15 v3.01 LaTeX color extensions (UK) - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\color.cfg -File: color.cfg 2016/01/02 v1.6 sample color configuration -) -Package xcolor Info: Driver file: pdftex.def on input line 274. -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/graphics\mathcolor.ltx) -Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1350. -Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1354. -Package xcolor Info: Model `RGB' extended on input line 1366. -Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1368. -Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1369. -Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1370. -Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1371. -Package xcolor Info: Model `Gray' substituted by `gray' on input line 1372. -Package xcolor Info: Model `wave' substituted by `hsb' on input line 1373. -) (C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/psnfss\times.sty -Package: times 2020/03/25 PSNFSS-v9.3 (SPQR) -) -LaTeX Font Info: Trying to load font information for OT1+ptm on input line 3 -2. - -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/psnfss\ot1ptm.fd -File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm. -) -(C:\Users\diane\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-pdf -tex.def -File: l3backend-pdftex.def 2024-01-04 L3 backend support: PDF output (pdfTeX) -\l__color_backend_stack_int=\count284 -\l__pdf_internal_box=\box51 -) (report.aux - -LaTeX Warning: Label `fig:frog' multiply defined. - - -LaTeX Warning: Label `fig:frog' multiply defined. - -) -\ \ No newline at end of file diff --git a/src/Report/report.out b/src/Report/report.out deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/Report/report.py b/src/Report/report.py index 4db6cc034e2bad26e835db89849cf735f52f6b63..5d58bf8c2ae8ff1cd258573861840ec195c19ce6 100644 --- a/src/Report/report.py +++ b/src/Report/report.py @@ -2,6 +2,8 @@ import subprocess from pathlib import Path import os import pandas as pd +from config.config import pdflatex_path +import zipfile def report(*args): to_report=[] @@ -423,35 +425,31 @@ def report(*args): # latex_report = report('sample', 'predict',) def compile_latex(): - # path to pdflatex - pdflatex_path = Path("C:/Users/diane/AppData/Local/Programs/MiKTeX/miktex/bin/x64/") - # pdflatex_path = Path("C:/Users/maimouni/AppData/Local/Programs/MiKTeX/miktex/bin/x64/") - from config.config import pdflatex_path + # path to pdflatex imported from config/config.py + filename_path = Path("Report/") filename = 'report.tex' # run pdflatex with bibtex compilation (2nd run) for i in range(4): - print(i) if i == 1: proc = subprocess.Popen([pdflatex_path / 'bibtex.exe', filename[:-4]], cwd = filename_path) proc.communicate() else: proc = subprocess.Popen([pdflatex_path / 'pdflatex.exe', filename], cwd = filename_path) proc.communicate() + os.rename(filename_path / 'report.pdf', filename_path / 'figures' / 'report.pdf') # remove pdflatex compilation files - extensions = ['.log', '.aux', '.bbl', '.blg', '.out'] - #for ext in extensions: - #os.unlink(str(filename_path / filename[:-4]) + ext) + extensions = ['.log', '.aux', '.bbl', '.blg', '.out', '.tex'] + for ext in extensions: + os.unlink(str(filename_path / filename[:-4]) + ext) # open the report - proc = subprocess.Popen([str(filename[:-4]) + '.pdf'], cwd = filename_path, shell=True) - proc.communicate() - import os - import zipfile + # proc = subprocess.Popen([str(filename[:-4]) + '.pdf'], cwd = filename_path / 'figures', shell=True) + # proc.communicate() - folder_path = 'D:/Mouhcine/nirs_workflow/src/Report/figures' - zip_path = 'D:/Mouhcine/nirs_workflow/src/Report/archive_zipfile.zip' + folder_path = Path('Report/figures') + zip_path = Path('Report/') - with zipfile.ZipFile(zip_path, 'w', compression=zipfile.ZIP_DEFLATED, compresslevel=9) as zf: + with zipfile.ZipFile(zip_path / 'archive_zipfile.zip', 'w', compression=zipfile.ZIP_DEFLATED, compresslevel=9) as zf: for root, dirs, files in os.walk(folder_path): for file in files: file_path = os.path.join(root, file) diff --git a/src/config/config.py b/src/config/config.py index 8edde93f469501a3b369b5b492e5fa16218027f6..4aaa13569b9389fee298accd511a8d07357d7e40 100644 --- a/src/config/config.py +++ b/src/config/config.py @@ -3,3 +3,4 @@ from pathlib import Path # pdflatex_path = Path("C:/Users/maimouni/AppData/Local/Programs/MiKTeX/miktex/bin/x64/") pdflatex_path = Path("C:/Donnees/Logiciels/Papps/PortableApps/Notepad++Portable/LaTEX/texmfs/install/miktex/bin/") +# pdflatex_path = Path("C:/Users/diane/AppData/Local/Programs/MiKTeX/miktex/bin/x64/") diff --git a/src/data/models/model__2024_06_03__created_on_Xcal_and_Ycal_data_.pkl b/src/data/models/model__2024_06_03__created_on_Xcal_and_Ycal_data_.pkl deleted file mode 100644 index 4de067e6ad6ed7e2af1344c9bbdd50020877ee0a..0000000000000000000000000000000000000000 Binary files a/src/data/models/model__2024_06_03__created_on_Xcal_and_Ycal_data_.pkl and /dev/null differ diff --git a/src/data/models/model_didi_2024_06_04__created_on_Xcal_and_Ycal_data_.pkl b/src/data/models/model_didi_2024_06_04__created_on_Xcal_and_Ycal_data_.pkl deleted file mode 100644 index bc65db0cacb1abb7f3c909b2355a5077cb7f1724..0000000000000000000000000000000000000000 Binary files a/src/data/models/model_didi_2024_06_04__created_on_Xcal_and_Ycal_data_.pkl and /dev/null differ diff --git a/src/data/params/Preprocessing.json b/src/data/params/Preprocessing.json deleted file mode 100644 index 0a854030b608d37b5178fb049bc60d88867b66a5..0000000000000000000000000000000000000000 --- a/src/data/params/Preprocessing.json +++ /dev/null @@ -1 +0,0 @@ -{"deriv": 0, "n_components": \ No newline at end of file diff --git a/src/pages/1-samples_selection.py b/src/pages/1-samples_selection.py index 1cd06b868fa7c769c57992d5426bc69789c36b9f..cc196e8096bc9ae1dbe250b8d94c96fa6055c361 100644 --- a/src/pages/1-samples_selection.py +++ b/src/pages/1-samples_selection.py @@ -1,8 +1,9 @@ from Packages import * st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide") from Modules import * -repertoire_a_vider = 'D:/Mouhcine/nirs_workflow/src/Report/figures' +# empty temp figures +repertoire_a_vider = 'D:/Mouhcine/nirs_workflow/src/Report/figures' if os.path.exists(repertoire_a_vider): for fichier in os.listdir(repertoire_a_vider): chemin_fichier = os.path.join(repertoire_a_vider, fichier) @@ -11,27 +12,40 @@ if os.path.exists(repertoire_a_vider): elif os.path.isdir(chemin_fichier): shutil.rmtree(chemin_fichier) # HTML pour le bandeau "CEFE - CNRS" -# bandeau_html = """ -# <div style="width: 100%; background-color: #4682B4; padding: 10px; margin-bottom: 10px;"> -# <h1 style="text-align: center; color: white;">CEFE - CNRS</h1> -# </div> -# """ -# # Injecter le code HTML du bandeau -# st.markdown(bandeau_html, unsafe_allow_html=True) add_header() +#load specific model page css +local_css(css_file / "style_model.css") + +#define some variables tcr=pd.DataFrame() sam=pd.DataFrame() sam1=pd.DataFrame() +dim_red_methods=['', 'PCA','UMAP', 'NMF'] # List of dimensionality reduction algos +cluster_methods = ['', 'Kmeans','HDBSCAN', 'AP'] # List of clustering algos +selec_strategy = ['center','random'] -# path = os.path.dirname(os.path.abspath(__file__)).replace('\\','/') -# css_file = path[:path.find('/pages')]+'/style' -# local_css(css_file +"/style_model.css") -local_css(css_file / "style_model.css") - +# check session state and define default values if simple interface to automate processing st.session_state["interface"] = st.session_state.get('interface') if st.session_state["interface"] == 'simple': + st.write(':red[Automated Simple Interface]') hide_pages("Predictions") - + if 37 not in st.session_state: + default_reduction_option = 1 + else: + default_reduction_option = dim_red_methods.index(st.session_state.get(37)) + if 38 not in st.session_state: + default_clustering_option = 1 + else: + default_clustering_option = cluster_methods.index(st.session_state.get(38)) + if 102 not in st.session_state: + default_sample_selection_option = 1 + else: + default_sample_selection_option = selec_strategy.index(st.session_state.get(102)) + +if st.session_state["interface"] == 'advanced': + default_reduction_option = 0 + default_clustering_option = 0 + default_sample_selection_option = 0 ################################### I - Data Loading and Visualization ######################################## st.header("I - Spectral Data Visualization", divider='blue') @@ -111,9 +125,6 @@ scores, loadings, pc = st.columns([2, 3, 0.5]) influence, hotelling, qexp = st.columns([2, 2, 1]) st.header('III - Selected samples for chemical analysis', divider='blue') -dim_red_methods=['', 'PCA','UMAP', 'NMF'] # List of dimensionality reduction algos -cluster_methods = ['', 'Kmeans','HDBSCAN', 'AP'] # List of clustering algos - dr_model = None # dimensionality reduction model cl_model = None # clustering model @@ -122,8 +133,8 @@ t = pd.DataFrame # scores p = pd.DataFrame # loadings labels = [] if not spectra.empty: - dim_red_method = pc.selectbox("Dimensionality reduction techniques: ", options = dim_red_methods, key = 37) - clus_method = pc.selectbox("Clustering techniques: ", options = cluster_methods, key = 38) + dim_red_method = pc.selectbox("Dimensionality reduction techniques: ", options = dim_red_methods, index = default_reduction_option, key = 37) + clus_method = pc.selectbox("Clustering techniques: ", options = cluster_methods, index = default_clustering_option, key = 38) xc = standardize(spectra, center=True, scale=False) @@ -196,7 +207,6 @@ if not t.empty: #################################################### III - Samples selection using the reduced data preentation ###### -selec_strategy = ['center','random'] samples_df_chem = pd.DataFrame selected_samples = [] selected_samples_idx = [] @@ -205,7 +215,7 @@ selected_samples_idx = [] if labels: if clus_method: selection = scores.radio('Select samples selection strategy:', - options = selec_strategy) + options = selec_strategy, index = default_sample_selection_option, key=102) # Strategy 0 if selection == selec_strategy[0]: # list samples at clusters centers - Use sklearn.metrics.pairwise_distances_argmin if you want more than 1 sample per cluster diff --git a/src/pages/2-model_creation.py b/src/pages/2-model_creation.py index 8e3082ae221ddd33363a41ed21187db9e7a18e87..ddddd422e0d2879be1dbc0e651a1f826bc9e150a 100644 --- a/src/pages/2-model_creation.py +++ b/src/pages/2-model_creation.py @@ -1,36 +1,21 @@ -import streamlit +# import streamlit from Packages import * st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide") from Modules import * from Class_Mod.DATA_HANDLING import * -from pandas.api.types import is_float_dtype from Class_Mod.Miscellaneous import desc_stats -from plotly.subplots import make_subplots -import plotly.graph_objects as go -from matplotlib.cm import ScalarMappable add_header() -import matplotlib.pyplot as plt, mpld3 -import streamlit.components.v1 as components - -repertoire_a_vider = 'D:/Mouhcine/nirs_workflow/src/Report/figures' -import shutil +repertoire_a_vider = Path('Report/figures') if os.path.exists(repertoire_a_vider): for fichier in os.listdir(repertoire_a_vider): - chemin_fichier = os.path.join(repertoire_a_vider, fichier) + chemin_fichier = repertoire_a_vider / fichier if os.path.isfile(chemin_fichier) or os.path.islink(chemin_fichier): os.unlink(chemin_fichier) elif os.path.isdir(chemin_fichier): - shutil.rmtree(chemin_fichier) -# HTML pour le bandeau "CEFE - CNRS" - -json_sp=pd.DataFrame() - - - - - + os.rmdir(chemin_fichier) +json_sp = pd.DataFrame() st.session_state["interface"] = st.session_state.get('interface') if st.session_state["interface"] == 'simple':