virgo-modules 0.0.67__py3-none-any.whl → 0.0.69__py3-none-any.whl

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.

@@ -584,7 +584,7 @@ def call_ml_objects(stock_code, client, call_models = False):
584
584
  return objects
585
585
 
586
586
  class produce_plotly_plots:
587
- def __init__(self,ticket_name, data_frame,settings, save_path = False, save_aws = False, show_plot= True, aws_credentials = False):
587
+ def __init__(self,ticket_name, data_frame,settings, save_path = False, save_aws = False, show_plot= True, aws_credentials = False, return_figs = False):
588
588
  """
589
589
  ticket_name: str asset name
590
590
  data_frame: pandas df
@@ -602,6 +602,7 @@ class produce_plotly_plots:
602
602
  self.save_aws = save_aws
603
603
  self.show_plot = show_plot
604
604
  self.aws_credentials = aws_credentials
605
+ self.return_figs = return_figs
605
606
 
606
607
  def plot_asset_signals(self, feature_list,spread_column, date_intervals = False):
607
608
 
@@ -674,7 +675,9 @@ class produce_plotly_plots:
674
675
  if self.save_path and self.save_aws:
675
676
  # upload_file_to_aws(bucket = 'VIRGO_BUCKET', key = f'market_plots/{self.ticket_name}/'+result_json_name ,input_path = self.save_path+result_json_name)
676
677
  upload_file_to_aws(bucket = 'VIRGO_BUCKET', key = self.save_aws + result_json_name, input_path = self.save_path + result_json_name, aws_credentials = self.aws_credentials)
677
-
678
+ if self.return_figs:
679
+ return fig
680
+
678
681
  def explore_states_ts(self):
679
682
  result_json_name = 'ts_hmm.json'
680
683
  df = self.data_frame
@@ -720,8 +723,10 @@ class produce_plotly_plots:
720
723
  if self.save_path and self.save_aws:
721
724
  # upload_file_to_aws(bucket = 'VIRGO_BUCKET', key = f'market_plots/{self.ticket_name}/'+result_json_name ,input_path = self.save_path+result_json_name)
722
725
  upload_file_to_aws(bucket = 'VIRGO_BUCKET', key = self.save_aws + result_json_name, input_path = self.save_path + result_json_name, aws_credentials = self.aws_credentials)
723
-
724
- def plot_hmm_analysis(self,settings, hmm_model, date_intervals = False, model = False):
726
+ if self.return_figs:
727
+ return fig
728
+
729
+ def plot_hmm_analysis(self,settings, t_matrix, model = False):
725
730
  result_json_name = 'hmm_analysis.json'
726
731
  df = self.data_frame
727
732
  hmm_n_clust = self.settings['settings']['hmm']['n_clusters']
@@ -744,7 +749,7 @@ class produce_plotly_plots:
744
749
 
745
750
  ### transition probabilities
746
751
  row_i = 1
747
- t_matrix = (hmm_model._model_impl['hmm'].transmat_)*100
752
+ # t_matrix = (hmm_model._model_impl['hmm'].transmat_)*100
748
753
  fig.add_trace(go.Heatmap(z = t_matrix, text = np.round(t_matrix,2),texttemplate="%{text}",coloraxis='coloraxis'),row=row_i, col=2)
749
754
  fig.update_xaxes(title_text='State To', row=row_i, col=2)
750
755
  fig.update_yaxes(title_text='State From', row=row_i, col=2)
@@ -839,7 +844,9 @@ class produce_plotly_plots:
839
844
 
840
845
  upload_file_to_aws(bucket = 'VIRGO_BUCKET', key = self.save_aws + result_json_name, input_path = self.save_path + result_json_name, aws_credentials = self.aws_credentials)
841
846
  upload_file_to_aws(bucket = 'VIRGO_BUCKET', key = self.save_aws + 'market_message.json', input_path = self.save_path + 'market_message.json', aws_credentials = self.aws_credentials)
842
-
847
+
848
+ if self.return_figs:
849
+ return fig, messages
843
850
  def produce_forecasting_plot(self,predictions):
844
851
  result_json_name = 'forecast_plot.json'
845
852
  hmm_n_clust = self.settings['settings']['hmm']['n_clusters']
@@ -1034,9 +1041,9 @@ def produce_simple_ts_from_model(stock_code, configs, n_days = 2000 , window_sco
1034
1041
 
1035
1042
  fig.update_layout(height=height_plot, width=1600, title_text = f'asset plot and signals: {stock_code}')
1036
1043
 
1037
- del object_stock, df
1044
+ del object_stock
1038
1045
 
1039
- return fig
1046
+ return fig, df
1040
1047
 
1041
1048
  def save_edge_model(data, save_path = False, save_aws = False, show_result = False, aws_credentials = False):
1042
1049
  """
@@ -1,53 +1,53 @@
1
- Metadata-Version: 2.1
2
- Name: virgo-modules
3
- Version: 0.0.67
4
- Summary: data processing and statistical modeling using stock market data
5
- Home-page: https://github.com/miguelmayhem92/virgo_module
6
- Author: Miguel Mayhuire
7
- Author-email: miguelmayhem92@gmail.com
8
- License: MIT
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.9, <3.10
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: feature-engine (==1.6.1)
16
- Requires-Dist: matplotlib (==3.6.3)
17
- Requires-Dist: mlflow (==2.1.1)
18
- Requires-Dist: numpy (==1.23.5)
19
- Requires-Dist: optuna (==3.1.0)
20
- Requires-Dist: pandas (==1.5.3)
21
- Requires-Dist: plotly (==5.15.0)
22
- Requires-Dist: rsa (==4.9)
23
- Requires-Dist: scikit-learn (==1.2.1)
24
- Requires-Dist: scipy (==1.10.0)
25
- Requires-Dist: seaborn (==0.12.2)
26
- Requires-Dist: starlette (==0.22.0)
27
- Requires-Dist: statsmodels (==0.13.5)
28
- Requires-Dist: ta (==0.10.2)
29
- Requires-Dist: yfinance (==0.2.9)
30
- Requires-Dist: hmmlearn (==0.3.0)
31
- Requires-Dist: boto3
32
- Provides-Extra: dev
33
- Requires-Dist: pytest (>=7.0) ; extra == 'dev'
34
-
35
- # Virgo Package
36
-
37
- this package contains the utils and helper functions that used in virgo project
38
-
39
- ### how to use
40
-
41
- istall using
42
-
43
- ```
44
- pip install virgo-modules
45
- ```
46
-
47
- geting data:
48
-
49
- ```
50
- obj = stock_eda_panel(stock_code = 'PEP', n_days = 20)
51
- obj.get_data()
52
- print(obj.df.shape)
53
- ```
1
+ Metadata-Version: 2.1
2
+ Name: virgo-modules
3
+ Version: 0.0.69
4
+ Summary: data processing and statistical modeling using stock market data
5
+ Home-page: https://github.com/miguelmayhem92/virgo_module
6
+ Author: Miguel Mayhuire
7
+ Author-email: miguelmayhem92@gmail.com
8
+ License: MIT
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.9, <3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: feature-engine ==1.6.1
16
+ Requires-Dist: matplotlib ==3.6.3
17
+ Requires-Dist: mlflow ==2.1.1
18
+ Requires-Dist: numpy ==1.23.5
19
+ Requires-Dist: optuna ==3.1.0
20
+ Requires-Dist: pandas ==1.5.3
21
+ Requires-Dist: plotly ==5.15.0
22
+ Requires-Dist: rsa ==4.9
23
+ Requires-Dist: scikit-learn ==1.2.1
24
+ Requires-Dist: scipy ==1.10.0
25
+ Requires-Dist: seaborn ==0.12.2
26
+ Requires-Dist: starlette ==0.22.0
27
+ Requires-Dist: statsmodels ==0.13.5
28
+ Requires-Dist: ta ==0.10.2
29
+ Requires-Dist: yfinance ==0.2.9
30
+ Requires-Dist: hmmlearn ==0.3.0
31
+ Requires-Dist: boto3
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest >=7.0 ; extra == 'dev'
34
+
35
+ # Virgo Package
36
+
37
+ this package contains the utils and helper functions that used in virgo project
38
+
39
+ ### how to use
40
+
41
+ istall using
42
+
43
+ ```
44
+ pip install virgo-modules
45
+ ```
46
+
47
+ geting data:
48
+
49
+ ```
50
+ obj = stock_eda_panel(stock_code = 'PEP', n_days = 20)
51
+ obj.get_data()
52
+ print(obj.df.shape)
53
+ ```
@@ -3,10 +3,10 @@ virgo_modules/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
3
3
  virgo_modules/src/aws_utils.py,sha256=GWmVdXM0mIJJPn-X-bEtM4KtNPCHM1D457hnuKxaM7E,1383
4
4
  virgo_modules/src/edge_utils.py,sha256=Ihdmq7dyb8gOvG6CrDal7wsa15tqsdsFk6KINwM6578,7691
5
5
  virgo_modules/src/pull_artifacts.py,sha256=5OPrgR7pcMSdpbevDRhf0ebk7g7ZRjff4NpTIIWAKjE,1989
6
- virgo_modules/src/re_utils.py,sha256=s6fbjOI59Clw5f1sVfqexiviYJyRVGobYe7qFsC-tQo,52211
6
+ virgo_modules/src/re_utils.py,sha256=lS7Zx0PGT6aWRcL5kAAfGMt1Q0J1y2IV2fnnCqma-io,52445
7
7
  virgo_modules/src/ticketer_source.py,sha256=_vJkF38yAl2FbxvcOWHbjG5n7o34lh8SdRR8zzIxChY,101408
8
- virgo_modules-0.0.67.dist-info/LICENSE,sha256=pNgFyCYgmimaw0o6V20JupZLROycAnOA_HDDh1tX2V4,1097
9
- virgo_modules-0.0.67.dist-info/METADATA,sha256=Y5PmJf9G5ZC04DYJcfP1lZJl6IL7oKU8MxIWqjc5FHg,1410
10
- virgo_modules-0.0.67.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
11
- virgo_modules-0.0.67.dist-info/top_level.txt,sha256=ZjI-qEkDtT-8mFwGAWnXfqPOKEGlIhWRW1es1VyXc60,14
12
- virgo_modules-0.0.67.dist-info/RECORD,,
8
+ virgo_modules-0.0.69.dist-info/LICENSE,sha256=pNgFyCYgmimaw0o6V20JupZLROycAnOA_HDDh1tX2V4,1097
9
+ virgo_modules-0.0.69.dist-info/METADATA,sha256=RVCh9ZFZ3G9Z1mklQJwOatQSSzOFgBMVpF0jFpg-gaY,1429
10
+ virgo_modules-0.0.69.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
11
+ virgo_modules-0.0.69.dist-info/top_level.txt,sha256=ZjI-qEkDtT-8mFwGAWnXfqPOKEGlIhWRW1es1VyXc60,14
12
+ virgo_modules-0.0.69.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5