shareddata 3.3.9__tar.gz → 3.3.12__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.
Files changed (35) hide show
  1. {shareddata-3.3.9/src/shareddata.egg-info → shareddata-3.3.12}/PKG-INFO +1 -1
  2. {shareddata-3.3.9 → shareddata-3.3.12}/setup.cfg +1 -1
  3. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/Scheduler.py +68 -45
  4. {shareddata-3.3.9 → shareddata-3.3.12/src/shareddata.egg-info}/PKG-INFO +1 -1
  5. {shareddata-3.3.9 → shareddata-3.3.12}/LICENSE +0 -0
  6. {shareddata-3.3.9 → shareddata-3.3.12}/README.md +0 -0
  7. {shareddata-3.3.9 → shareddata-3.3.12}/pyproject.toml +0 -0
  8. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/AWSKinesis.py +0 -0
  9. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/AWSS3.py +0 -0
  10. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/DataFrame.py +0 -0
  11. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Defaults.py +0 -0
  12. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Logger.py +0 -0
  13. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Metadata.py +0 -0
  14. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/MultiProc.py +0 -0
  15. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/RealTime.py +0 -0
  16. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/Orchestrator.py +0 -0
  17. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/ReadLogs.py +0 -0
  18. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/SendCommand.py +0 -0
  19. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/Server.py +0 -0
  20. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/Worker.py +0 -0
  21. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/WorkerLib.py +0 -0
  22. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Routines/__init__.py +0 -0
  23. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/SharedData.py +0 -0
  24. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/SharedNumpy.py +0 -0
  25. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Table.py +0 -0
  26. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/TableIndex.py +0 -0
  27. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/TableIndexJit.py +0 -0
  28. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/TimeSeries.py +0 -0
  29. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/TimeseriesContainer.py +0 -0
  30. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/Utils.py +0 -0
  31. {shareddata-3.3.9 → shareddata-3.3.12}/src/SharedData/__init__.py +0 -0
  32. {shareddata-3.3.9 → shareddata-3.3.12}/src/shareddata.egg-info/SOURCES.txt +0 -0
  33. {shareddata-3.3.9 → shareddata-3.3.12}/src/shareddata.egg-info/dependency_links.txt +0 -0
  34. {shareddata-3.3.9 → shareddata-3.3.12}/src/shareddata.egg-info/requires.txt +0 -0
  35. {shareddata-3.3.9 → shareddata-3.3.12}/src/shareddata.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shareddata
3
- Version: 3.3.9
3
+ Version: 3.3.12
4
4
  Summary: Shared Memory Database with S3 repository
5
5
  Home-page: https://github.com/jcarlitooliveira/SharedData
6
6
  Author: Jose Carlito de Oliveira Filho
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = shareddata
3
- version = 3.3.9
3
+ version = 3.3.12
4
4
  author = Jose Carlito de Oliveira Filho
5
5
  author_email = jcarlitooliveira@gmail.com
6
6
  description = Shared Memory Database with S3 repository
@@ -98,9 +98,9 @@ class RoutineScheduler:
98
98
  else:
99
99
  break
100
100
 
101
- sched_sort.index.name='sequence'
102
- self.lastschedule = sched_sort
101
+ sched_sort.index.name='sequence'
103
102
  self.schedule = sched_sort
103
+ self.lastschedule = self.schedule.copy()
104
104
  self.save()
105
105
  return sched_sort
106
106
 
@@ -110,13 +110,16 @@ class RoutineScheduler:
110
110
  # RefreshLogs
111
111
  dflogs = self.consumer.readLogs().copy()
112
112
  if not dflogs.empty:
113
+ # CREATE AN INDEX
113
114
  dflogs['index'] = dflogs['user_name']+':'+dflogs['logger_name']
114
115
  dflogs['index'] = [s.lower().replace('\\','/') for s in dflogs['index']]
115
116
 
117
+ # LOCALIZE TIME
116
118
  dflogs = dflogs[dflogs['asctime'].notnull()].copy()
117
119
  dflogs['asctime'] = pd.to_datetime(dflogs['asctime'])
118
120
  dflogs['asctime'] = [dt.astimezone(tz=local_tz) for dt in dflogs['asctime']]
119
121
 
122
+ # GET LAST MESSAGE
120
123
  i=0
121
124
  now = datetime.now().astimezone(tz=local_tz)
122
125
  for i in sched.index:
@@ -128,7 +131,7 @@ class RoutineScheduler:
128
131
  sched.loc[i,'LstMsgTimestamp'] = dflogs[idx].iloc[-1]['asctime']
129
132
  sched.loc[i,'LstMsgAge'] = (now - sched.loc[i,'LstMsgTimestamp']).seconds
130
133
 
131
-
134
+ # ERROR ROUTINES
132
135
  dferr = dflogs[dflogs['message']=='ROUTINE ERROR!']
133
136
  dferr = dferr.reset_index(drop=True).sort_values(by='asctime')
134
137
  i=0
@@ -143,7 +146,9 @@ class RoutineScheduler:
143
146
  idx = idx.index[idx]
144
147
  sched.loc[idx,'Status'] = 'EXPIRED'
145
148
 
146
- compl = dflogs[dflogs['message']=='ROUTINE COMPLETED!'].reset_index(drop=True).sort_values(by='asctime')
149
+ # COMPLETED ROUTINES
150
+ compl = dflogs[dflogs['message']=='ROUTINE COMPLETED!'].\
151
+ reset_index(drop=True).sort_values(by='asctime')
147
152
  i=0
148
153
  for i in compl.index:
149
154
  r = compl.iloc[i]
@@ -156,16 +161,19 @@ class RoutineScheduler:
156
161
  idx = idx.index[idx]
157
162
  sched.loc[idx,'Status'] = 'EXPIRED'
158
163
 
159
- # mark pending routines
164
+ # PENDING ROUTINES
160
165
  idx = datetime.now().astimezone(tz=local_tz)>=sched['Run Times']
161
- idx = (idx) & ((sched['Status'].isnull()) | (sched['Status']=='WAITING DEPENDENCIES'))
162
-
166
+ idx = (idx) & ((sched['Status'].isnull()) | (sched['Realtime']) \
167
+ | (sched['Status']=='WAITING DEPENDENCIES'))
163
168
  dfpending = sched[idx]
169
+
170
+ # EXPIRED ROUTINES
164
171
  expiredidx = dfpending.duplicated(['Computer','Script'],keep='last')
165
172
  if expiredidx.any():
166
173
  expiredids = expiredidx.index[expiredidx]
167
174
  sched.loc[expiredids,'Status'] = 'EXPIRED'
168
-
175
+
176
+ # PENDING ROUTINES
169
177
  dfpending = dfpending[~expiredidx]
170
178
  for i in dfpending.index:
171
179
  r = dfpending.loc[i]
@@ -182,57 +190,54 @@ class RoutineScheduler:
182
190
  else:
183
191
  if not str(sched.loc[ids[-1],'Status']) == 'COMPLETED':
184
192
  run=False
185
- if run:
186
- if (str(sched.loc[i,'Last Message'])=='nan') \
187
- & (np.isnan(sched.loc[i,'RunMsgTimestamp'])):
188
- if sched.loc[i,'Run']:
189
- sched.loc[i,'Status'] = 'PENDING'
193
+ if run:
194
+ if not sched.loc[i,'Realtime']:
195
+ if (str(sched.loc[i,'Last Message'])=='nan') \
196
+ & (np.isnan(sched.loc[i,'RunMsgTimestamp'])):
197
+ if sched.loc[i,'Run']:
198
+ sched.loc[i,'Status'] = 'PENDING'
199
+ else:
200
+ sched.loc[i,'Status'] = 'PENDING EXTERNAL'
190
201
  else:
191
- sched.loc[i,'Status'] = 'PENDING EXTERNAL'
192
- else:
193
- if sched.loc[i,'Realtime']:
194
- if sched.loc[i,'LstMsgAge']<=35:
202
+ if sched.loc[i,'LstMsgAge']<=300:
195
203
  if (sched.loc[i,'Run']):
196
204
  sched.loc[i,'Status'] = 'RUNNING'
197
205
  else:
198
206
  sched.loc[i,'Status'] = 'RUNNING EXTERNAL'
199
207
  else:
200
208
  if (sched.loc[i,'Run']):
201
- sched.loc[i,'Status'] = 'RESTART'
209
+ sched.loc[i,'Status'] = 'DELAYED'
202
210
  else:
203
- sched.loc[i,'Status'] = 'RESTART EXTERNAL'
211
+ sched.loc[i,'Status'] = 'DELAYED EXTERNAL'
212
+ else: # is realtime
213
+ if (str(sched.loc[i,'Last Message'])=='nan') \
214
+ & (np.isnan(sched.loc[i,'RunMsgTimestamp'])):
215
+ if sched.loc[i,'Run']:
216
+ sched.loc[i,'Status'] = 'PENDING'
217
+ else:
218
+ sched.loc[i,'Status'] = 'PENDING EXTERNAL'
204
219
  else:
205
- if sched.loc[i,'LstMsgAge']<=300:
220
+ if sched.loc[i,'LstMsgAge']<=45:
206
221
  if (sched.loc[i,'Run']):
207
222
  sched.loc[i,'Status'] = 'RUNNING'
208
223
  else:
209
224
  sched.loc[i,'Status'] = 'RUNNING EXTERNAL'
210
225
  else:
211
226
  if (sched.loc[i,'Run']):
212
- sched.loc[i,'Status'] = 'DELAYED'
227
+ sched.loc[i,'Status'] = 'RESTART'
213
228
  else:
214
- sched.loc[i,'Status'] = 'DELAYED EXTERNAL'
215
-
229
+ sched.loc[i,'Status'] = 'RESTART EXTERNAL'
230
+
231
+
216
232
  else: # has no dependency
217
- if (str(sched.loc[i,'Last Message'])=='nan') \
218
- & (np.isnan(sched.loc[i,'RunMsgTimestamp'])):
219
- if sched.loc[i,'Run']:
220
- sched.loc[i,'Status'] = 'PENDING'
221
- else:
222
- sched.loc[i,'Status'] = 'PENDING EXTERNAL'
223
- else:
224
- if sched.loc[i,'Realtime']:
225
- if sched.loc[i,'LstMsgAge']<=35:
226
- if (sched.loc[i,'Run']):
227
- sched.loc[i,'Status'] = 'RUNNING'
228
- else:
229
- sched.loc[i,'Status'] = 'RUNNING EXTERNAL'
230
- else:
231
- if (sched.loc[i,'Run']):
232
- sched.loc[i,'Status'] = 'RESTART'
233
+ if not sched.loc[i,'Realtime']:
234
+ if (str(sched.loc[i,'Last Message'])=='nan') \
235
+ & (np.isnan(sched.loc[i,'RunMsgTimestamp'])):
236
+ if sched.loc[i,'Run']:
237
+ sched.loc[i,'Status'] = 'PENDING'
233
238
  else:
234
- sched.loc[i,'Status'] = 'RESTART EXTERNAL'
235
- else:
239
+ sched.loc[i,'Status'] = 'PENDING EXTERNAL'
240
+ else:
236
241
  if sched.loc[i,'LstMsgAge']<=300:
237
242
  if (sched.loc[i,'Run']):
238
243
  sched.loc[i,'Status'] = 'RUNNING'
@@ -242,12 +247,30 @@ class RoutineScheduler:
242
247
  if (sched.loc[i,'Run']):
243
248
  sched.loc[i,'Status'] = 'DELAYED'
244
249
  else:
245
- sched.loc[i,'Status'] = 'DELAYED EXTERNAL'
246
-
250
+ sched.loc[i,'Status'] = 'DELAYED EXTERNAL'
251
+ else: # is realtime
252
+ if (str(sched.loc[i,'Last Message'])=='nan') \
253
+ & (np.isnan(sched.loc[i,'RunMsgTimestamp'])):
254
+ if sched.loc[i,'Run']:
255
+ sched.loc[i,'Status'] = 'PENDING'
256
+ else:
257
+ sched.loc[i,'Status'] = 'PENDING EXTERNAL'
258
+ else:
259
+ if sched.loc[i,'LstMsgAge']<=45:
260
+ if (sched.loc[i,'Run']):
261
+ sched.loc[i,'Status'] = 'RUNNING'
262
+ else:
263
+ sched.loc[i,'Status'] = 'RUNNING EXTERNAL'
264
+ else:
265
+ if (sched.loc[i,'Run']):
266
+ sched.loc[i,'Status'] = 'RESTART'
267
+ else:
268
+ sched.loc[i,'Status'] = 'RESTART EXTERNAL'
269
+
247
270
  self.schedule=sched
248
271
 
249
272
  if not self.schedule.equals(self.lastschedule):
250
- self.schedule = self.lastschedule
273
+ self.lastschedule = self.schedule.copy()
251
274
  self.save()
252
275
  return sched
253
276
 
@@ -297,7 +320,7 @@ class RoutineScheduler:
297
320
 
298
321
  self.schedule = sched
299
322
  if newcommand:
300
- self.schedule = self.lastschedule
323
+ self.lastschedule = self.schedule.copy()
301
324
  self.save()
302
325
 
303
326
  return sched
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shareddata
3
- Version: 3.3.9
3
+ Version: 3.3.12
4
4
  Summary: Shared Memory Database with S3 repository
5
5
  Home-page: https://github.com/jcarlitooliveira/SharedData
6
6
  Author: Jose Carlito de Oliveira Filho
File without changes
File without changes
File without changes