diff --git a/pdm.lock b/pdm.lock index 7bfafcf..3540b92 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "lint", "nb", "tests"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:750f84cb8e60872ca2b3dc7adf60a9c678e9928a0d6d836d054e2f7b0f0aa902" +content_hash = "sha256:b76828b29a1da485f743d5dca2c4233b4ce9dfc613ec0a0c97b3e6cc367ae57d" [[metadata.targets]] requires_python = ">=3.11" @@ -579,7 +579,7 @@ files = [ [[package]] name = "dopt-basics" -version = "0.1.0" +version = "0.1.1" requires_python = ">=3.11" summary = "basic cross-project tools for Python-based d-opt projects" groups = ["default"] @@ -587,8 +587,8 @@ dependencies = [ "tzdata>=2025.1", ] files = [ - {file = "dopt_basics-0.1.0-py3-none-any.whl", hash = "sha256:edf1105aa2db6ab854f31fc652996f1ee2f61a4dfb196aa61318a70678601c22"}, - {file = "dopt_basics-0.1.0.tar.gz", hash = "sha256:8bb885109fe3b16d7c6a2264ac361eca0e31ab73f2edbae28a29d81a0cec510f"}, + {file = "dopt_basics-0.1.1-py3-none-any.whl", hash = "sha256:1b868e09e9eae3c33f0f871d492ae165b9104eff34f7689f924b30e8b589a6d6"}, + {file = "dopt_basics-0.1.1.tar.gz", hash = "sha256:df5e6acc2085d3ed5fb31629f8cdf44df8ef2f5342df899be1325f1e9f5dec24"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index efa4397..6426d81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "prognosis module" authors = [ {name = "Florian Förster", email = "f.foerster@d-opt.com"}, ] -dependencies = ["scikit-learn>=1.6.1", "pandas>=2.2.3", "xgboost>=2.1.4", "joblib>=1.4.2", "typing-extensions>=4.12.2", "requests>=2.32.3", "pydantic>=2.10.6", "dopt-basics>=0.1.0"] +dependencies = ["scikit-learn>=1.6.1", "pandas>=2.2.3", "xgboost>=2.1.4", "joblib>=1.4.2", "typing-extensions>=4.12.2", "requests>=2.32.3", "pydantic>=2.10.6", "dopt-basics>=0.1.1"] requires-python = ">=3.11" readme = "README.md" license = {text = "LicenseRef-Proprietary"} diff --git a/src/delta_barth/api/common.py b/src/delta_barth/api/common.py index 8cea9bc..88bff59 100644 --- a/src/delta_barth/api/common.py +++ b/src/delta_barth/api/common.py @@ -1,9 +1,9 @@ from __future__ import annotations -import re from typing import TYPE_CHECKING, Final import requests +from dopt_basics.io import combine_route from pydantic import BaseModel from requests import Response @@ -195,16 +195,6 @@ def validate_credentials( ) -def _strip_url_components(string: str) -> str: - return re.sub(r"^[ /]+|[ /]+$", "", string) - - -def combine_route(base_url: str, route: str) -> str: - base_url = _strip_url_components(base_url) - route = _strip_url_components(route) - return "/".join((base_url, route)) - - def ping( base_url: str, method: HttpRequestTypes, diff --git a/src/delta_barth/api/requests.py b/src/delta_barth/api/requests.py index fdad891..21803fd 100644 --- a/src/delta_barth/api/requests.py +++ b/src/delta_barth/api/requests.py @@ -4,9 +4,9 @@ from datetime import datetime as Datetime from typing import TYPE_CHECKING, Final import requests +from dopt_basics.io import combine_route from pydantic import BaseModel, PositiveInt, SkipValidation -from delta_barth.api.common import combine_route from delta_barth.errors import STATUS_HANDLER from delta_barth.types import DelBarApiError, ExportResponse, ResponseType, Status