-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from dsih-artpark/v3
V3 merge - merging PR and will create tag as well.
- Loading branch information
Showing
20 changed files
with
1,229 additions
and
1,078 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,4 +142,7 @@ dmypy.json | |
.DS_Store | ||
|
||
# All Data Files | ||
*.csv | ||
*.csv | ||
data/** | ||
testing.py | ||
_src/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
[tool.poetry] | ||
name = "epipipeline" | ||
version = "2.0.11" | ||
version = "3.0.0" | ||
description = "" | ||
authors = ["Sai Sneha <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
python = "^3.9.0" | ||
pandas = "^2.2.0" | ||
boto3 = "^1.34.40" | ||
requests = "^2.31.0" | ||
fuzzywuzzy = "^0.18.0" | ||
openpyxl = "^3.1.2" | ||
python-levenshtein = "^0.25.0" | ||
pyyaml = "^6.0.1" | ||
ipython = "^8.0.0" | ||
dataio = {git = "[email protected]:dsih-artpark/dataio.git"} | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.ruff.lint] | ||
select = ["E", "F", "W", "I", "FLY", "RUF", "B", "ICN"] | ||
|
||
[tool.ruff] | ||
line-length = 140 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
from importlib.metadata import version | ||
|
||
import pandas as pd | ||
|
||
from epipipeline.logging_config import setup_logging | ||
|
||
__version__ = version(__name__) | ||
setup_logging() | ||
|
||
|
||
def get_regionIDs(*, regionIDs_path="data/GS0015DS0034-LGD_Region_IDs_and_Names/regionids.csv"): | ||
|
||
regionIDs_df = pd.read_csv(regionIDs_path) | ||
|
||
regionIDs_dict = {} | ||
for _, row in regionIDs_df.iterrows(): | ||
regionIDs_dict[row["regionID"]] = {"regionName": row["regionName"], | ||
"parentID": row["parentID"] | ||
} | ||
return regionIDs_df, regionIDs_dict | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# epipipeline/logging_config.py | ||
import logging | ||
import logging.config | ||
|
||
def setup_logging(default_level='WARNING'): | ||
""" | ||
Set up logging configuration. | ||
Args: | ||
default_level (str): The default logging level ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'). | ||
""" | ||
default_level = default_level.upper() | ||
if default_level not in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']: | ||
raise ValueError(f"Invalid logging level: {default_level}") | ||
|
||
logging_config = { | ||
'version': 1, | ||
'disable_existing_loggers': False, | ||
'formatters': { | ||
'standard': { | ||
'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s', | ||
}, | ||
}, | ||
'handlers': { | ||
'console': { | ||
'class': 'logging.StreamHandler', | ||
'formatter': 'standard', | ||
}, | ||
'file': { | ||
'class': 'logging.FileHandler', | ||
'formatter': 'standard', | ||
'filename': 'epipipeline.log', | ||
}, | ||
}, | ||
'loggers': { | ||
'': { | ||
'handlers': ['console', 'file'], | ||
'level': default_level, | ||
'propagate': True, | ||
}, | ||
'epipipeline': { | ||
'handlers': ['console', 'file'], | ||
'level': default_level, | ||
'propagate': False, | ||
}, | ||
} | ||
} | ||
|
||
logging.config.dictConfig(logging_config) | ||
|
||
def set_logging_level(level): | ||
""" | ||
Set the logging level for the 'epipipeline' logger and all its handlers. | ||
Args: | ||
level (str): The logging level to set ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'). | ||
""" | ||
level = level.upper() | ||
if level not in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']: | ||
raise ValueError(f"Invalid logging level: {level}") | ||
|
||
logger = logging.getLogger('epipipeline') | ||
logger.setLevel(level) | ||
|
||
for handler in logger.handlers: | ||
handler.setLevel(level) |
Oops, something went wrong.