corebridge 0.2.4__tar.gz → 0.2.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: corebridge
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Bridge for Stactics AICore
5
5
  Home-page: https://github.com/fenke/corebridge
6
6
  Author: Fenke Meijer
@@ -28,18 +28,20 @@ License-File: LICENSE
28
28
  This package provides functions and classes to run wodan style
29
29
  processing functions in the Stactics AICore environment.
30
30
 
31
- ## Install
31
+ ## Installation
32
+
33
+ Use
32
34
 
33
35
  ``` sh
34
36
  pip install corebridge
35
37
  ```
36
38
 
39
+ to install corebrdige.
40
+
37
41
  ## How to use
38
42
 
39
43
  ### Introduction
40
44
 
41
- #### Wodan processing functions
42
-
43
45
  Wodan is a proprietary backend service that applies high performance,
44
46
  custom analytical processing to timeseries data in the Whysor data and
45
47
  dashboarding environment.
@@ -60,13 +62,17 @@ def multiply(data:np.ndarray, multiplier:float=1.0):
60
62
 
61
63
  ```
62
64
 
63
- #### AICore modules
65
+ Wodan binds this function to a service endpoint and takes care of
66
+ fetching data and parameters and converting the result for the caller.
67
+
68
+ ### AICore modules
64
69
 
65
- For AICore one defines a class, always named `Module` with a constructor
66
- `__init__` and a method `infer`.
70
+ For AICore users define a class, always named `Module` with a
71
+ constructor `__init__` and a method `infer`.
67
72
 
68
73
  This package defines a baseclass to quickly construct a custom `Module`
69
- class that uses a wodan processor function inside the AICore system:
74
+ class that is able to use a wodan processor function inside the AICore
75
+ system:
70
76
 
71
77
  ``` {python}
72
78
  import numpy as np
@@ -77,23 +83,32 @@ def multiply(data:np.ndarray, multiplier:float=1.0):
77
83
 
78
84
  class Module(corebridge.aicorebridge.AICoreModule):
79
85
  def __init__(self, save_dir, assets_dir, *args, **kwargs):
80
- super().__init__(read, save_dir, assets_dir, *args, **kwargs)
86
+ super().__init__(multiply, save_dir, assets_dir, *args, **kwargs)
81
87
 
82
88
  ```
83
89
 
84
90
  That’s it. Well, you can add parameters to `__init__` that can be used
85
- as hyperparameters and you could override `infer` for the same reason.
91
+ as hyperparameters in the web-interface and you could override `infer`
92
+ for the same reason. The baseclass takes care of converting call
93
+ parameters and data to the function specification and, calls the
94
+ function and converts the result for the caller, similar to the original
95
+ Wodan service.
86
96
 
87
- ``` python
88
- ```
97
+ ## Development
98
+
99
+ Setup a virtual environment, activate it and install the development
100
+ package and dependencies with, on linux
101
+
102
+ pip install -e ‘.\[dev\]’
103
+
104
+ or on Windows
89
105
 
90
- 2
106
+ pip install -e .\[dev\]
91
107
 
92
- ## nbdev cycle
108
+ ### nbdev cycle
93
109
 
94
110
  - edit
95
111
  - nbdev_export
96
- - pip install -e ‘.\[dev\]’
97
112
  - nbdev_test
98
113
  - nbdev_clean
99
114
  - nbdev_readme
@@ -6,18 +6,20 @@
6
6
  This package provides functions and classes to run wodan style
7
7
  processing functions in the Stactics AICore environment.
8
8
 
9
- ## Install
9
+ ## Installation
10
+
11
+ Use
10
12
 
11
13
  ``` sh
12
14
  pip install corebridge
13
15
  ```
14
16
 
17
+ to install corebrdige.
18
+
15
19
  ## How to use
16
20
 
17
21
  ### Introduction
18
22
 
19
- #### Wodan processing functions
20
-
21
23
  Wodan is a proprietary backend service that applies high performance,
22
24
  custom analytical processing to timeseries data in the Whysor data and
23
25
  dashboarding environment.
@@ -38,13 +40,17 @@ def multiply(data:np.ndarray, multiplier:float=1.0):
38
40
 
39
41
  ```
40
42
 
41
- #### AICore modules
43
+ Wodan binds this function to a service endpoint and takes care of
44
+ fetching data and parameters and converting the result for the caller.
45
+
46
+ ### AICore modules
42
47
 
43
- For AICore one defines a class, always named `Module` with a constructor
44
- `__init__` and a method `infer`.
48
+ For AICore users define a class, always named `Module` with a
49
+ constructor `__init__` and a method `infer`.
45
50
 
46
51
  This package defines a baseclass to quickly construct a custom `Module`
47
- class that uses a wodan processor function inside the AICore system:
52
+ class that is able to use a wodan processor function inside the AICore
53
+ system:
48
54
 
49
55
  ``` {python}
50
56
  import numpy as np
@@ -55,23 +61,32 @@ def multiply(data:np.ndarray, multiplier:float=1.0):
55
61
 
56
62
  class Module(corebridge.aicorebridge.AICoreModule):
57
63
  def __init__(self, save_dir, assets_dir, *args, **kwargs):
58
- super().__init__(read, save_dir, assets_dir, *args, **kwargs)
64
+ super().__init__(multiply, save_dir, assets_dir, *args, **kwargs)
59
65
 
60
66
  ```
61
67
 
62
68
  That’s it. Well, you can add parameters to `__init__` that can be used
63
- as hyperparameters and you could override `infer` for the same reason.
69
+ as hyperparameters in the web-interface and you could override `infer`
70
+ for the same reason. The baseclass takes care of converting call
71
+ parameters and data to the function specification and, calls the
72
+ function and converts the result for the caller, similar to the original
73
+ Wodan service.
64
74
 
65
- ``` python
66
- ```
75
+ ## Development
76
+
77
+ Setup a virtual environment, activate it and install the development
78
+ package and dependencies with, on linux
79
+
80
+ pip install -e ‘.\[dev\]’
81
+
82
+ or on Windows
67
83
 
68
- 2
84
+ pip install -e .\[dev\]
69
85
 
70
- ## nbdev cycle
86
+ ### nbdev cycle
71
87
 
72
88
  - edit
73
89
  - nbdev_export
74
- - pip install -e ‘.\[dev\]’
75
90
  - nbdev_test
76
91
  - nbdev_clean
77
92
  - nbdev_readme
@@ -0,0 +1 @@
1
+ __version__ = "0.2.5"
@@ -14,6 +14,7 @@ import numpy as np
14
14
 
15
15
  from fastcore.basics import patch_to, patch
16
16
  from .core import *
17
+ from . import __version__
17
18
 
18
19
 
19
20
  # %% ../nbs/01_aicorebridge.ipynb 5
@@ -21,7 +22,7 @@ syslog = logging.getLogger(__name__)
21
22
 
22
23
  # %% ../nbs/01_aicorebridge.ipynb 6
23
24
  try:
24
- print(f"Loading {__name__} from {__file__}")
25
+ print(f"Loading {__name__} {__version__} from {__file__}")
25
26
  except:
26
27
  pass
27
28
 
@@ -141,7 +142,7 @@ def get_call_data(
141
142
  "Convert data to the processor signature"
142
143
 
143
144
  df = set_time_index_zone(timeseries_dataframe_from_datadict(
144
- data, ['datetimemeasure', 'time'], recordformat), timezone)
145
+ data, ['datetimeMeasure', 'time'], recordformat), timezone)
145
146
 
146
147
  if reversed:
147
148
  df = df[::-1]
@@ -95,15 +95,15 @@ def timeseries_dataframe_from_datadict(
95
95
 
96
96
  if orient == 'records':
97
97
  df = pd.DataFrame.from_records(data)
98
- time_column = [C for C in df.columns if C.lower() in timecolumns][0]
98
+ time_column = [C for C in df.columns if C in timecolumns][0]
99
99
 
100
100
  elif orient == 'table':
101
101
  time_column = data['schema']['primaryKey'][0]
102
102
  df = pd.DataFrame.from_dict(data['data']).set_index(data['schema']['primaryKey'])
103
103
  df.index.name = 'time'
104
104
 
105
- df.columns = [C.lower() for C in df.columns]
106
- time_column = [C for C in df.columns if C in timecolumns][0]
105
+
106
+ df.columns = list(df.columns)
107
107
  df[time_column] = pd.to_datetime(df[time_column],utc=True,format='ISO8601')
108
108
  df.set_index(time_column, inplace=True)
109
109
  #df.index = pd.DatetimeIndex(df.index).round('ms')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: corebridge
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Bridge for Stactics AICore
5
5
  Home-page: https://github.com/fenke/corebridge
6
6
  Author: Fenke Meijer
@@ -28,18 +28,20 @@ License-File: LICENSE
28
28
  This package provides functions and classes to run wodan style
29
29
  processing functions in the Stactics AICore environment.
30
30
 
31
- ## Install
31
+ ## Installation
32
+
33
+ Use
32
34
 
33
35
  ``` sh
34
36
  pip install corebridge
35
37
  ```
36
38
 
39
+ to install corebrdige.
40
+
37
41
  ## How to use
38
42
 
39
43
  ### Introduction
40
44
 
41
- #### Wodan processing functions
42
-
43
45
  Wodan is a proprietary backend service that applies high performance,
44
46
  custom analytical processing to timeseries data in the Whysor data and
45
47
  dashboarding environment.
@@ -60,13 +62,17 @@ def multiply(data:np.ndarray, multiplier:float=1.0):
60
62
 
61
63
  ```
62
64
 
63
- #### AICore modules
65
+ Wodan binds this function to a service endpoint and takes care of
66
+ fetching data and parameters and converting the result for the caller.
67
+
68
+ ### AICore modules
64
69
 
65
- For AICore one defines a class, always named `Module` with a constructor
66
- `__init__` and a method `infer`.
70
+ For AICore users define a class, always named `Module` with a
71
+ constructor `__init__` and a method `infer`.
67
72
 
68
73
  This package defines a baseclass to quickly construct a custom `Module`
69
- class that uses a wodan processor function inside the AICore system:
74
+ class that is able to use a wodan processor function inside the AICore
75
+ system:
70
76
 
71
77
  ``` {python}
72
78
  import numpy as np
@@ -77,23 +83,32 @@ def multiply(data:np.ndarray, multiplier:float=1.0):
77
83
 
78
84
  class Module(corebridge.aicorebridge.AICoreModule):
79
85
  def __init__(self, save_dir, assets_dir, *args, **kwargs):
80
- super().__init__(read, save_dir, assets_dir, *args, **kwargs)
86
+ super().__init__(multiply, save_dir, assets_dir, *args, **kwargs)
81
87
 
82
88
  ```
83
89
 
84
90
  That’s it. Well, you can add parameters to `__init__` that can be used
85
- as hyperparameters and you could override `infer` for the same reason.
91
+ as hyperparameters in the web-interface and you could override `infer`
92
+ for the same reason. The baseclass takes care of converting call
93
+ parameters and data to the function specification and, calls the
94
+ function and converts the result for the caller, similar to the original
95
+ Wodan service.
86
96
 
87
- ``` python
88
- ```
97
+ ## Development
98
+
99
+ Setup a virtual environment, activate it and install the development
100
+ package and dependencies with, on linux
101
+
102
+ pip install -e ‘.\[dev\]’
103
+
104
+ or on Windows
89
105
 
90
- 2
106
+ pip install -e .\[dev\]
91
107
 
92
- ## nbdev cycle
108
+ ### nbdev cycle
93
109
 
94
110
  - edit
95
111
  - nbdev_export
96
- - pip install -e ‘.\[dev\]’
97
112
  - nbdev_test
98
113
  - nbdev_clean
99
114
  - nbdev_readme
@@ -27,3 +27,4 @@ aiohttp
27
27
  asyncpg
28
28
  apscheduler
29
29
  twine
30
+ addroot
@@ -5,7 +5,7 @@
5
5
  ### Python library ###
6
6
  repo = corebridge
7
7
  lib_name = %(repo)s
8
- version = 0.2.4
8
+ version = 0.2.6
9
9
  min_python = 3.7
10
10
  license = apache2
11
11
  black_formatting = False
@@ -39,5 +39,5 @@ user = fenke
39
39
 
40
40
  ### Optional ###
41
41
  requirements = python-dateutil pytz numpy pandas scipy scikit-learn fastcore twine
42
- dev_requirements = python-dateutil pytz numpy pyarrow pandas scipy scikit-learn fastcore jupyter ipywidgets jupyterlab>4 jupyter_contrib_nbextensions jupyterlab-git jupyterlab-quarto nbdev aiohttp asyncpg apscheduler twine
42
+ dev_requirements = python-dateutil pytz numpy pyarrow pandas scipy scikit-learn fastcore jupyter ipywidgets jupyterlab>4 jupyter_contrib_nbextensions jupyterlab-git jupyterlab-quarto nbdev aiohttp asyncpg apscheduler twine addroot
43
43
  # console_scripts =
@@ -1 +0,0 @@
1
- __version__ = "0.2.3"
File without changes
File without changes
File without changes
File without changes