diff --git a/main.py b/main.py index 0f57563..a5d252f 100755 --- a/main.py +++ b/main.py @@ -1,5 +1,16 @@ #!/usr/bin/env python +""" +Author: Kristiāns Francis Cagulis, kc22015 +Date: 25.12.2023. +Github: https://github.com/kristoferssolo/LU-Data-Visualisation +Dependencies: matplotlib, numpy, pandas, loguru, openpyxl + +This script generates two plots from Excel files and saves them to a PDF file. +Excel files can be stored in the same directory as this script or in a subdirectory called "data". +""" + + import platform import subprocess from pathlib import Path @@ -11,14 +22,6 @@ from loguru import logger from matplotlib.backends.backend_pdf import PdfPages -logger.add( - Path("logs", "data.log"), - format="{time} | {level} | {message}", - level="INFO", - rotation="1 MB", - compression="zip", -) - BASE_PATH = Path(__file__).parent WIND_GUSTS_FILENAME = "vejaAtrumsBrazmas.xlsx" WIND_SPEED_FILENAME = "vejaAtrumsFaktiskais.xlsx" @@ -29,6 +32,15 @@ BLUE = "#1f77b4" ORANGE = "#ff7f0e" BLACK = "#000000" +# Setup logger +logger.add( + BASE_PATH.joinpath("logs", "data.log"), + format="{time} | {level} | {message}", + level="INFO", + rotation="1 MB", + compression="zip", +) + def read_data(filename: str) -> pd.DataFrame: """ diff --git a/plots.pdf b/plots.pdf index 7af32c9..713703f 100644 Binary files a/plots.pdf and b/plots.pdf differ diff --git a/pyproject.toml b/pyproject.toml index b8dfbc2..c23f186 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,11 @@ readme = "README.md" requires-python = ">=3.11" license = { text = "MIT" } dependencies = [ - "openpyxl==3.1.2", - "loguru==0.7.2", - "matplotlib==3.8.2", - "pandas==2.1.4", + "openpyxl==3.1.2", + "loguru==0.7.2", + "numpy==1.26.2", + "matplotlib==3.8.2", + "pandas==2.1.4", ] [tool.mypy] diff --git a/requirements.txt b/requirements.txt index 0009c58..5f52693 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -attrs>=23.1.0 loguru>=0.7.2 matplotlib>=3.8.2 +numpy>=1.26.2 openpyxl>=3.1.2 pandas>=2.1.4