Skip to content

Commit

Permalink
Modified some docstrings | Removed global variables used only once in…
Browse files Browse the repository at this point in the history
… config.py
  • Loading branch information
paul-florentin-charles committed Sep 25, 2023
1 parent 87f9864 commit 04ccbc9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from yaml import safe_load

CONFIG_FNAME: str = 'config.yaml'
UTF_8: str = 'utf-8'
MODE: str = 'rt'


class Config:
Expand All @@ -19,7 +17,7 @@ class Config:

def __init__(self, path: Optional[str] = CONFIG_FNAME):
self.path: str = path
with open(self.path, mode=MODE, encoding=UTF_8) as stream:
with open(self.path, mode='rt', encoding='utf-8') as stream:
self.yaml_config: dict = safe_load(stream)

def get_dataset_url(self) -> str:
Expand Down
6 changes: 3 additions & 3 deletions src/core/models/all_rainfall.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Provides a costly to instantiate all-in-one class
to manipulate rainfall data for every timeframes.
Provides an all-in-one class to manipulate rainfall data for every timeframe.
At a yearly, monthly and seasonal level.
"""

from typing import Optional
Expand All @@ -22,7 +22,7 @@ class AllRainfall:
- MonthlyRainfall data for all months
- SeasonalRainfall data for all seasons
Costly to instantiate but contains all necessary data.
A bit costly to instantiate but contains all necessary data.
"""

def __init__(self,
Expand Down
2 changes: 1 addition & 1 deletion src/core/models/yearly_rainfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def load_rainfall(self,
start_month: int,
end_month: Optional[int] = None) -> pd.DataFrame:
"""
Generic function to load Yearly Rainfall data into pandas DataFrame.
Generic function to load Yearly Rainfall data from raw data stored in pandas DataFrame.
:param start_month: An integer representing the month
to start getting our rainfall values (compulsory)
Expand Down

0 comments on commit 04ccbc9

Please sign in to comment.