virgo-modules 0.0.79__tar.gz → 0.0.80__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 virgo-modules might be problematic. Click here for more details.
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/PKG-INFO +1 -1
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/setup.py +1 -1
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/re_utils.py +54 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/PKG-INFO +1 -1
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/LICENSE +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/README.md +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/setup.cfg +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/__init__.py +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/__init__.py +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/aws_utils.py +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/edge_utils.py +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/pull_artifacts.py +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/ticketer_source.py +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/SOURCES.txt +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/dependency_links.txt +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/requires.txt +0 -0
- {virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ with open("virgo_app/README.md", "r") as f:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="virgo_modules",
|
|
8
|
-
version="0.0.
|
|
8
|
+
version="0.0.80",
|
|
9
9
|
description="data processing and statistical modeling using stock market data",
|
|
10
10
|
package_dir={"": "virgo_app"},
|
|
11
11
|
packages=find_packages(where="virgo_app"),
|
|
@@ -455,6 +455,60 @@ def ranking(data, weighted_features, top = 5, window = 5):
|
|
|
455
455
|
|
|
456
456
|
return top_up, top_low
|
|
457
457
|
|
|
458
|
+
def ranking_first(data, weighted_features, top = 5, window = 5):
|
|
459
|
+
'''
|
|
460
|
+
Create a ranking of assets given current signals and weighted average importance
|
|
461
|
+
|
|
462
|
+
Parameters:
|
|
463
|
+
data (pd.Dataframe): base data
|
|
464
|
+
weighted_features (dict): configuration dictionary
|
|
465
|
+
top (int): top n to get result
|
|
466
|
+
window (int): number of days to assess
|
|
467
|
+
|
|
468
|
+
Returns:
|
|
469
|
+
top_up (list): top roof signal asset
|
|
470
|
+
top_low (list): top botton signal asset
|
|
471
|
+
'''
|
|
472
|
+
features = weighted_features.keys()
|
|
473
|
+
up_columns = ['signal_up_' + x for x in features]
|
|
474
|
+
low_columns = ['signal_low_' + x for x in features]
|
|
475
|
+
|
|
476
|
+
def compute_score(df,col,window):
|
|
477
|
+
score = 0
|
|
478
|
+
for i in range(window):
|
|
479
|
+
row = df.iloc[i]
|
|
480
|
+
if (row[col] == 1) and (i == 0):
|
|
481
|
+
score += 1000
|
|
482
|
+
elif (row[col] == 1) and (i == 1):
|
|
483
|
+
score -= 200
|
|
484
|
+
elif (row[col] == 1) and (i >= 2):
|
|
485
|
+
score -= 50
|
|
486
|
+
return score
|
|
487
|
+
|
|
488
|
+
ticket_list= list(data.Ticket.unique())
|
|
489
|
+
result = dict()
|
|
490
|
+
for ticket in ticket_list:
|
|
491
|
+
result[ticket] = dict()
|
|
492
|
+
df = data[data.Ticket == ticket].sort_values('Date').iloc[-window:]
|
|
493
|
+
|
|
494
|
+
for col in low_columns:
|
|
495
|
+
df = df.sort_values('Date', ascending = False)
|
|
496
|
+
score = compute_score(df,col,window)
|
|
497
|
+
result[ticket][col] = score
|
|
498
|
+
for col in up_columns:
|
|
499
|
+
score = 0
|
|
500
|
+
df = df.sort_values('Date', ascending = False)
|
|
501
|
+
score = compute_score(df,col,window)
|
|
502
|
+
result[ticket][col] = score
|
|
503
|
+
|
|
504
|
+
df = pd.DataFrame(result).T
|
|
505
|
+
df['up_signas'] = df[up_columns].sum(axis=1)
|
|
506
|
+
df['low_signas'] = df[low_columns].sum(axis=1)
|
|
507
|
+
|
|
508
|
+
top_up = list(df.sort_values('up_signas', ascending = False).index)[:top]
|
|
509
|
+
top_low = list(df.sort_values('low_signas', ascending = False).index)[:top]
|
|
510
|
+
return top_up, top_low, df
|
|
511
|
+
|
|
458
512
|
def produce_dashboard(data, columns , ticket_list, show_plot = True, nrows = 150,save_name = False, save_path = False, save_aws = False, aws_credential = False):
|
|
459
513
|
'''
|
|
460
514
|
produce dashboard using signals and list of assets
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules/src/ticketer_source.py
RENAMED
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.79 → virgo_modules-0.0.80}/virgo_app/virgo_modules.egg-info/top_level.txt
RENAMED
|
File without changes
|