From 6d364b68b7d4f32d5f62f0e9564a6b6c8970ce4a Mon Sep 17 00:00:00 2001 From: MeenBna Date: Mon, 30 Sep 2024 12:49:58 +0200 Subject: [PATCH] Implement PR feedback. --- README.md | 7 +++++++ notebooks/Example_Data_Downloading.ipynb | 2 +- notebooks/Exploring_API_Functions.ipynb | 2 +- notebooks/Exploring_API_Functions_Authentication.ipynb | 4 ++-- src/pyprediktormapclient/analytics_helper.py | 5 +++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a217647..b5be2f9 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,13 @@ Run `isort` manually to sort the imports in the project using the command: ``` isort . ``` + +However, applying these changes could lead to conflicts. To verify the import order without making any modifications, use the following command: + +``` +isort . --check-only +``` + The `isort` configuration is managed in the `pyproject.toml` file to ensure it integrates well with black and other tools. diff --git a/notebooks/Example_Data_Downloading.ipynb b/notebooks/Example_Data_Downloading.ipynb index 63a9178..0448470 100644 --- a/notebooks/Example_Data_Downloading.ipynb +++ b/notebooks/Example_Data_Downloading.ipynb @@ -238,7 +238,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.11.0" }, "orig_nbformat": 4, "vscode": { diff --git a/notebooks/Exploring_API_Functions.ipynb b/notebooks/Exploring_API_Functions.ipynb index 4cd3ca7..a3fbdc1 100644 --- a/notebooks/Exploring_API_Functions.ipynb +++ b/notebooks/Exploring_API_Functions.ipynb @@ -278,7 +278,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.11.0" }, "orig_nbformat": 4, "vscode": { diff --git a/notebooks/Exploring_API_Functions_Authentication.ipynb b/notebooks/Exploring_API_Functions_Authentication.ipynb index f100683..d12525b 100644 --- a/notebooks/Exploring_API_Functions_Authentication.ipynb +++ b/notebooks/Exploring_API_Functions_Authentication.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.11.0" } }, "nbformat": 4, diff --git a/src/pyprediktormapclient/analytics_helper.py b/src/pyprediktormapclient/analytics_helper.py index f848594..24e1431 100644 --- a/src/pyprediktormapclient/analytics_helper.py +++ b/src/pyprediktormapclient/analytics_helper.py @@ -40,6 +40,8 @@ class AnalyticsHelper: * Input checks for nodeIds in variables that requires format int:int:string """ + ID_PATTERN = r"^\d+:\d+:\S+$" + @validate_call def __init__(self, input: List): self.dataframe = pd.DataFrame( @@ -124,8 +126,7 @@ def namespaces_as_list(self, list_of_dicts: List) -> List: @validate_call def split_id(self, id: Any) -> dict: - pattern = r"^\d+:\d+:\S+$" - if not re.match(pattern, id): + if not re.match(self.ID_PATTERN, id): raise ValueError("Invalid id format") id_split = id.split(":")