Skip to content

Commit

Permalink
Merge pull request #41 from equinor/bugfix/26485-revert-change-of-pac…
Browse files Browse the repository at this point in the history
…kage-name

Hotfix for breaking package name
  • Loading branch information
janny93 authored Nov 23, 2023
2 parents 1b6b16b + 6996f93 commit d9c47ee
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ the flow, execution will proceed.
#### With default credentials (azure cli, MSI and so on)

```python
from omnia_timeseries_api import TimeseriesEnvironment, TimeseriesAPI
from omnia_timeseries import TimeseriesEnvironment, TimeseriesAPI
from azure.identity import DefaultAzureCredential
cred = DefaultAzureCredential()
api = TimeseriesAPI(cred, TimeseriesEnvironment.Prod())
Expand All @@ -72,7 +72,7 @@ api.get_timeseries(limit=1)
### Getting latest datapoint for timeseries within the Test environment

```python
from omnia_timeseries_api import TimeseriesAPI, TimeseriesEnvironment
from omnia_timeseries import TimeseriesAPI, TimeseriesEnvironment
api = TimeseriesAPI(
azure_credential=credential,
environment=TimeseriesEnvironment.Test()
Expand Down
2 changes: 1 addition & 1 deletion examples/federation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"metadata": {},
"outputs": [],
"source": [
"from omnia_timeseries_api.api import TimeseriesAPI, TimeseriesEnvironment\n",
"from omnia_timeseries.api import TimeseriesAPI, TimeseriesEnvironment\n",
"from azure.identity import DeviceCodeCredential\n",
"import os"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/get_data_protobuf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"metadata": {},
"outputs": [],
"source": [
"from omnia_timeseries_api.api import TimeseriesAPI, TimeseriesEnvironment\n",
"from omnia_timeseries.api import TimeseriesAPI, TimeseriesEnvironment\n",
"from azure.identity import DeviceCodeCredential\n",
"import os"
]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "omnia_timeseries_api"
name = "omnia_timeseries"
version = "1.0.0"
authors = ["Equinor Omnia Industrial IoT Team <[email protected]>"]

Expand Down
1 change: 1 addition & 0 deletions src/omnia_timeseries/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from omnia_timeseries.api import TimeseriesAPI, TimeseriesEnvironment
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List, Literal, Optional
from azure.identity._internal.msal_credentials import MsalCredential
from omnia_timeseries_api.http_client import HttpClient, ContentType, RequestType
from omnia_timeseries_api.models import (
from omnia_timeseries.http_client import HttpClient, ContentType, RequestType
from omnia_timeseries.models import (
DatapointModel,
DatapointsItemsModel, DatapointsPostRequestModel,
FacilityDataModel, GetAggregatesResponseModel, GetDatapointsResponseModel, GetHistoryResponseModel, GetMultipleDatapointsRequestItem, GetTimeseriesResponseModel,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import wraps
from logging import debug
import time
from omnia_timeseries_api.models import TimeseriesRequestFailedException
from omnia_timeseries.models import TimeseriesRequestFailedException

# Reasonable status codes to retry, based on descriptions at https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
retry_status_codes = [408, 409, 425, 429, 502, 503, 504]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import requests
import logging

from omnia_timeseries_api.helpers import retry
from omnia_timeseries_api.models import TimeseriesRequestFailedException
from omnia_timeseries.helpers import retry
from omnia_timeseries.models import TimeseriesRequestFailedException
from importlib import metadata
from opentelemetry.instrumentation.requests import RequestsInstrumentor
import platform
Expand All @@ -15,7 +15,7 @@
RequestType = Literal['get', 'put', 'post', 'patch', 'delete']

logger = logging.getLogger(__name__)
version = metadata.version("omnia-timeseries-api")
version = metadata.version("omnia_timeseries")
system_version_string = f'({platform.system()}; Python {platform.version()})' if platform.system(
) else f'(Python {platform.version()})'

Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/omnia_timeseries_api/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from azure.identity._internal.msal_credentials import MsalCredential
from azure.core.credentials import AccessToken
from requests.models import Response
from omnia_timeseries_api import TimeseriesAPI, TimeseriesEnvironment
from omnia_timeseries_api.http_client import TimeseriesRequestFailedException
from omnia_timeseries import TimeseriesAPI, TimeseriesEnvironment
from omnia_timeseries.http_client import TimeseriesRequestFailedException


class DummyCredentials(MsalCredential):
Expand Down

0 comments on commit d9c47ee

Please sign in to comment.