Skip to content

Commit

Permalink
prepared next version for pip
Browse files Browse the repository at this point in the history
  • Loading branch information
majoma7 committed Feb 18, 2025
1 parent bbd0581 commit 2e4a603
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inventory_foundation_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3"
__version__ = "0.0.4"
1 change: 1 addition & 0 deletions inventory_foundation_sdk/db_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ def execute_multiple_queries(
queries = [queries] * len(params)

# Iterate over queries and fetch rows

for idx, query in enumerate(queries):
query_params = params[idx] if params else None
cur.execute(query, query_params)
Expand Down
5 changes: 5 additions & 0 deletions inventory_foundation_sdk/db_retrievers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,17 @@ def get_norm_param(
ValueError: If the normalization type is not recognized.
psycopg2.DatabaseError: If there is a database error during execution.
"""

try:
# Determine the columns to fetch based on normalization type
if normalization_type == "standardize":
value_columns = ["mean", "std"]
elif normalization_type == "scale":
value_columns = ["min", "max"]
elif normalization_type == ["standardize", "scale"]:
value_columns = ["mean", "std", "min", "max"]
elif normalization_type == ["scale", "standardize"]:
value_columns = ["min", "max", "mean", "std"]
else:
raise ValueError("Normalization type not recognized")

Expand Down
1 change: 1 addition & 0 deletions nbs/10_db_mgmt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@
" queries = [queries] * len(params)\n",
"\n",
" # Iterate over queries and fetch rows\n",
"\n",
" for idx, query in enumerate(queries):\n",
" query_params = params[idx] if params else None\n",
" cur.execute(query, query_params)\n",
Expand Down
6 changes: 6 additions & 0 deletions nbs/11_db_retrievers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
" credentials: str,\n",
" additional_columns: list = None,\n",
"):\n",
"\n",
" \"\"\"\n",
" Retrieves normalization parameters from a database table.\n",
"\n",
Expand All @@ -183,12 +184,17 @@
" ValueError: If the normalization type is not recognized.\n",
" psycopg2.DatabaseError: If there is a database error during execution.\n",
" \"\"\"\n",
" \n",
" try:\n",
" # Determine the columns to fetch based on normalization type\n",
" if normalization_type == \"standardize\":\n",
" value_columns = [\"mean\", \"std\"]\n",
" elif normalization_type == \"scale\":\n",
" value_columns = [\"min\", \"max\"]\n",
" elif normalization_type == [\"standardize\", \"scale\"]:\n",
" value_columns = [\"mean\", \"std\", \"min\", \"max\"]\n",
" elif normalization_type == [\"scale\", \"standardize\"]:\n",
" value_columns = [\"min\", \"max\", \"mean\", \"std\"]\n",
" else:\n",
" raise ValueError(\"Normalization type not recognized\")\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Python library ###
repo = inventory_foundation-sdk
lib_name = %(repo)s
version = 0.0.3
version = 0.0.4
min_python = 3.7
license = apache2
black_formatting = True
Expand Down

0 comments on commit 2e4a603

Please sign in to comment.