MSTR-Robotics-magerdaniel 0.3.10__tar.gz → 0.3.11__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.
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11/MSTR_Robotics_magerdaniel.egg-info}/PKG-INFO +1 -1
- {mstr_robotics_magerdaniel-0.3.10/MSTR_Robotics_magerdaniel.egg-info → mstr_robotics_magerdaniel-0.3.11}/PKG-INFO +1 -1
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_connectors.py +10 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_helper.py +6 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/navigation.py +10 -4
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/report.py +36 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/setup.py +1 -1
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/LICENSE +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/MANIFEST.in +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/MSTR_Robotics_magerdaniel.egg-info/SOURCES.txt +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/MSTR_Robotics_magerdaniel.egg-info/dependency_links.txt +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/MSTR_Robotics_magerdaniel.egg-info/requires.txt +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/MSTR_Robotics_magerdaniel.egg-info/top_level.txt +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/README.md +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/__init__.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_lu_data.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_mod_prj_obj.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/dossier.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/mstr_classes.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/mstr_pandas.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/prepare_AI_data.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/read_out_prj_obj.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/user_RAG.py +0 -0
- {mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/setup.cfg +0 -0
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_connectors.py
RENAMED
|
@@ -193,6 +193,16 @@ class mstr_api():
|
|
|
193
193
|
url = f'{conn.base_url}/api/v2/cubes/{cube_id}/instances?offset={offset_val}&limit={limit_val}'
|
|
194
194
|
return conn.post(url)
|
|
195
195
|
|
|
196
|
+
def get_open_prp_stat(self,conn,report_id,instance_id):
|
|
197
|
+
url = f'{conn.base_url}/api/reports/{report_id}/instances/{instance_id}/status'
|
|
198
|
+
stat = conn.get(url)
|
|
199
|
+
|
|
200
|
+
try:
|
|
201
|
+
status=stat.json()["status"]
|
|
202
|
+
except:
|
|
203
|
+
print(stat)
|
|
204
|
+
status=1
|
|
205
|
+
return status
|
|
196
206
|
|
|
197
207
|
|
|
198
208
|
def zzz_fetch_cube_elements(self,conn, cube_id, attribute_id, limit_val=100):
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_helper.py
RENAMED
|
@@ -128,6 +128,12 @@ class msic():
|
|
|
128
128
|
dict_l.append(dict_d.copy())
|
|
129
129
|
return dict_l
|
|
130
130
|
|
|
131
|
+
def get_vals_from_dict_l(self,dict_l, key="id"):
|
|
132
|
+
val_l = []
|
|
133
|
+
for d in dict_l:
|
|
134
|
+
val_l.append(d[key])
|
|
135
|
+
return val_l
|
|
136
|
+
|
|
131
137
|
def add_prefix_to_dict_keys(self,dict, dpn_prefix, dict_cols= []):
|
|
132
138
|
#adds a prefix to the keys of a dict
|
|
133
139
|
# use case here is to distinct i.e. between the object_id and the depn_object_id
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/navigation.py
RENAMED
|
@@ -183,10 +183,16 @@ class answer_prompts():
|
|
|
183
183
|
break
|
|
184
184
|
return prp_ans_l
|
|
185
185
|
|
|
186
|
-
def save_AI_rep(self, conn,
|
|
187
|
-
instance_id = i_rep.open_Instance(conn=conn, report_id=
|
|
188
|
-
first_draft = i_rep.set_inst_prompt_ans(conn=conn, report_id=
|
|
189
|
-
|
|
186
|
+
def save_AI_rep(self, conn, report_id, prompt_answ, ai_rep_name, ai_rep_folder_id):
|
|
187
|
+
instance_id = i_rep.open_Instance(conn=conn, report_id=report_id)
|
|
188
|
+
first_draft = i_rep.set_inst_prompt_ans(conn=conn, report_id=report_id, instance_id=instance_id,
|
|
189
|
+
prompt_answ=prompt_answ)
|
|
190
|
+
|
|
191
|
+
rep_stat = i_rep.get_open_prp_stat(conn=conn, report_id=report_id, instance_id=instance_id)
|
|
192
|
+
|
|
193
|
+
if rep_stat == 2:
|
|
194
|
+
prompt_answ = i_rep.close_open_prp(conn=conn, report_id=report_id, instance_id=instance_id,
|
|
195
|
+
prompt_answ=prompt_answ)
|
|
190
196
|
rep_id = i_rep.save_rep_inst(conn=conn, instance_id=instance_id, rep_name=ai_rep_name
|
|
191
197
|
, save_mode="OVERWRITE"
|
|
192
198
|
, promptOption="static"
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/report.py
RENAMED
|
@@ -8,9 +8,11 @@ from mstrio.project_objects.report import Report
|
|
|
8
8
|
from mstrio.api.cubes import cube_definition
|
|
9
9
|
import pandas as pd
|
|
10
10
|
from mstr_robotics.mstr_pandas import df_helper
|
|
11
|
+
from mstr_robotics._helper import msic
|
|
11
12
|
import json
|
|
12
13
|
|
|
13
14
|
i_mstr_api=mstr_api()
|
|
15
|
+
i_msic=msic()
|
|
14
16
|
|
|
15
17
|
class rep:
|
|
16
18
|
|
|
@@ -28,6 +30,10 @@ class rep:
|
|
|
28
30
|
,instance_id=instance_id, closed = False)
|
|
29
31
|
return open_prompts.json()
|
|
30
32
|
|
|
33
|
+
def get_open_prp_stat(self,conn, report_id, instance_id):
|
|
34
|
+
return i_mstr_api.get_open_prp_stat(conn=conn, report_id=report_id,
|
|
35
|
+
instance_id=instance_id)
|
|
36
|
+
|
|
31
37
|
def set_inst_prompt_ans(self, conn, report_id, instance_id, prompt_answ):
|
|
32
38
|
prompt_answ_url = f'{conn.base_url}/api/reports/{report_id}/instances/{instance_id}/prompts/answers'
|
|
33
39
|
ret_prompt_ans = conn.put(prompt_answ_url, data=prompt_answ)
|
|
@@ -366,6 +372,35 @@ class prompts():
|
|
|
366
372
|
def bld_obj_prp_json(self,object_id,object_type):
|
|
367
373
|
return json.dumps({"id": object_id, "type": object_type})
|
|
368
374
|
|
|
375
|
+
def close_open_prp(self,conn, report_id, instance_id, prompt_answ):
|
|
376
|
+
# checks the answered prp
|
|
377
|
+
prompt_answ_d = json.loads(prompt_answ)
|
|
378
|
+
prp_ans_d_l = prompt_answ_d["prompts"]
|
|
379
|
+
prp_ans_id_l = i_msic.keep_cols_from_dict_l(list_l=prp_ans_d_l, keep_cols=["id"])
|
|
380
|
+
|
|
381
|
+
# checks the all prp in report / dashboard
|
|
382
|
+
rep_open_prp_d_l = rep().get_open_prompts(conn=conn, report_id=report_id, instance_id=instance_id)
|
|
383
|
+
rep_open_prp_id_l = i_msic.keep_cols_from_dict_l(list_l=rep_open_prp_d_l, keep_cols=["id"])
|
|
384
|
+
|
|
385
|
+
# checks the prp not answered jet
|
|
386
|
+
open_prp_l = [x for x in rep_open_prp_id_l if x not in prp_ans_id_l]
|
|
387
|
+
open_prp_l = i_msic.get_vals_from_dict_l(dict_l=open_prp_l)
|
|
388
|
+
|
|
389
|
+
for prp in rep_open_prp_d_l:
|
|
390
|
+
print(prp["id"])
|
|
391
|
+
if prp["id"] in open_prp_l:
|
|
392
|
+
print(prp)
|
|
393
|
+
open_prp_d = {}
|
|
394
|
+
open_prp_d["id"] = prp["id"]
|
|
395
|
+
open_prp_d["type"] = prp["type"]
|
|
396
|
+
if prp["type"] in ["OBJECTS", "ELEMENTS"]:
|
|
397
|
+
open_prp_d["answers"] = []
|
|
398
|
+
else:
|
|
399
|
+
open_prp_d["answers"] = {}
|
|
400
|
+
rep_open_prp_d_l.append(open_prp_d.copy())
|
|
401
|
+
prompt_answ = self.frame_prp(prp_ans=rep_open_prp_d_l)
|
|
402
|
+
return prompt_answ
|
|
403
|
+
|
|
369
404
|
def zzz_loop_att_exp_prp(self,prp_job_ans_l):
|
|
370
405
|
expr_JSON_l = []
|
|
371
406
|
for att_exp_prp in prp_job_ans_l:
|
|
@@ -384,6 +419,7 @@ class prompts():
|
|
|
384
419
|
expr_JSON_l.append(att_form_exp_j)
|
|
385
420
|
|
|
386
421
|
return expr_JSON_l
|
|
422
|
+
|
|
387
423
|
def zzz_get_form_type(self,baseFormType):
|
|
388
424
|
form_type_d={"number":"Numeric",
|
|
389
425
|
"big_decimal":"BigDecimal"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/__init__.py
RENAMED
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_lu_data.py
RENAMED
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/_mod_prj_obj.py
RENAMED
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/dossier.py
RENAMED
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/mstr_classes.py
RENAMED
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/mstr_pandas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mstr_robotics_magerdaniel-0.3.10 → mstr_robotics_magerdaniel-0.3.11}/mstr_robotics/user_RAG.py
RENAMED
|
File without changes
|
|
File without changes
|