volue-insight-timeseries 1.0.4__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of volue-insight-timeseries might be problematic. Click here for more details.
- {volue-insight-timeseries-1.0.4/volue_insight_timeseries.egg-info → volue-insight-timeseries-1.1.0}/PKG-INFO +1 -1
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/README.md +2 -2
- volue-insight-timeseries-1.1.0/volue_insight_timeseries/VERSION +1 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/__init__.py +0 -1
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/auth.py +0 -1
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/events.py +3 -4
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/util.py +25 -13
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0/volue_insight_timeseries.egg-info}/PKG-INFO +1 -1
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries.egg-info/requires.txt +0 -2
- volue-insight-timeseries-1.0.4/volue_insight_timeseries/VERSION +0 -1
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/LICENSE +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/MANIFEST.in +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/setup.cfg +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/setup.py +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/curves.py +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/session.py +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries.egg-info/SOURCES.txt +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries.egg-info/dependency_links.txt +0 -0
- {volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries.egg-info/top_level.txt +0 -0
|
@@ -13,9 +13,9 @@ the latest Python version.
|
|
|
13
13
|
## Documentation
|
|
14
14
|
|
|
15
15
|
The
|
|
16
|
-
[documentation](https://wattsight-volue-insight-timeseries.readthedocs-hosted.com/en/
|
|
16
|
+
[documentation](https://wattsight-volue-insight-timeseries.readthedocs-hosted.com/en/master/)
|
|
17
17
|
with various
|
|
18
|
-
[examples](https://wattsight-volue-insight-timeseries.readthedocs-hosted.com/en/
|
|
18
|
+
[examples](https://wattsight-volue-insight-timeseries.readthedocs-hosted.com/en/master/examples.html)
|
|
19
19
|
is hosted on Read the Docs.
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.1.0
|
{volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/events.py
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import contextlib
|
|
1
2
|
import json
|
|
2
3
|
import time
|
|
3
4
|
|
|
@@ -58,10 +59,8 @@ class EventListener:
|
|
|
58
59
|
event.curve = self.curve_cache[event.id]
|
|
59
60
|
self.queue.put(event)
|
|
60
61
|
if sse_event.retry is not None:
|
|
61
|
-
|
|
62
|
+
with contextlib.suppress(ValueError, TypeError):
|
|
62
63
|
self.retry = int(sse_event.retry)
|
|
63
|
-
except:
|
|
64
|
-
pass
|
|
65
64
|
if self.do_shutdown:
|
|
66
65
|
break
|
|
67
66
|
# Session was closed by server/network, wait for retry before looping.
|
|
@@ -107,7 +106,7 @@ class DefaultEvent(object):
|
|
|
107
106
|
self._raw_event = sse_event
|
|
108
107
|
try:
|
|
109
108
|
self.json_data = json.loads(sse_event.data)
|
|
110
|
-
except:
|
|
109
|
+
except (json.JSONDecodeError, TypeError):
|
|
111
110
|
self.json_data = None
|
|
112
111
|
|
|
113
112
|
|
{volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/util.py
RENAMED
|
@@ -8,6 +8,7 @@ import datetime
|
|
|
8
8
|
import dateutil.parser
|
|
9
9
|
import pandas as pd
|
|
10
10
|
import numpy as np
|
|
11
|
+
import warnings
|
|
11
12
|
from past.types import basestring
|
|
12
13
|
try:
|
|
13
14
|
from urllib.parse import quote_plus
|
|
@@ -26,29 +27,38 @@ TAGGED_INSTANCES = 'TAGGED_INSTANCES'
|
|
|
26
27
|
|
|
27
28
|
# Frequency mapping from TS to Pandas
|
|
28
29
|
_TS_FREQ_TABLE = {
|
|
29
|
-
'Y': '
|
|
30
|
+
'Y': 'YS',
|
|
30
31
|
'S': '2QS',
|
|
31
32
|
'Q': 'QS',
|
|
32
33
|
'M': 'MS',
|
|
33
34
|
'W': 'W-MON',
|
|
34
|
-
'H12': '
|
|
35
|
-
'H6': '
|
|
36
|
-
'H3': '
|
|
37
|
-
'MIN30': '
|
|
38
|
-
'MIN15': '
|
|
39
|
-
'MIN5': '
|
|
40
|
-
'MIN': '
|
|
35
|
+
'H12': '12h',
|
|
36
|
+
'H6': '6h',
|
|
37
|
+
'H3': '3h',
|
|
38
|
+
'MIN30': '30min',
|
|
39
|
+
'MIN15': '15min',
|
|
40
|
+
'MIN5': '5min',
|
|
41
|
+
'MIN': 'min',
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
# Mapping from various versions of Pandas to TS is built from map above,
|
|
45
|
+
# with some additions to support older versions of pandas
|
|
43
46
|
_PANDAS_FREQ_TABLE = {
|
|
47
|
+
'YS-JAN': 'Y',
|
|
44
48
|
'AS-JAN': 'Y',
|
|
45
|
-
'
|
|
49
|
+
'AS': 'Y',
|
|
46
50
|
'2QS-JAN': 'S',
|
|
47
51
|
'QS-JAN': 'Q',
|
|
48
|
-
'
|
|
52
|
+
'12H': 'H12',
|
|
53
|
+
'6H': 'H6',
|
|
54
|
+
'3H': 'H3',
|
|
55
|
+
'30T': 'MIN30',
|
|
56
|
+
'15T': 'MIN15',
|
|
57
|
+
'5T': 'MIN5',
|
|
58
|
+
'T': 'MIN',
|
|
49
59
|
}
|
|
50
|
-
for
|
|
51
|
-
_PANDAS_FREQ_TABLE[
|
|
60
|
+
for ts_freq, pandas_freq in _TS_FREQ_TABLE.items():
|
|
61
|
+
_PANDAS_FREQ_TABLE[pandas_freq.upper()] = ts_freq
|
|
52
62
|
|
|
53
63
|
|
|
54
64
|
class CurveException(Exception):
|
|
@@ -166,6 +176,8 @@ class TS(object):
|
|
|
166
176
|
def _rev_map_freq(frequency):
|
|
167
177
|
if frequency.upper() in _PANDAS_FREQ_TABLE:
|
|
168
178
|
frequency = _PANDAS_FREQ_TABLE[frequency.upper()]
|
|
179
|
+
else:
|
|
180
|
+
warnings.warn(f"Frequency is not supported: '{frequency}'", FutureWarning, stacklevel=2)
|
|
169
181
|
return frequency
|
|
170
182
|
|
|
171
183
|
@staticmethod
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.4
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{volue-insight-timeseries-1.0.4 → volue-insight-timeseries-1.1.0}/volue_insight_timeseries/curves.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|