Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 52deb190 authored by Alain Shakour's avatar Alain Shakour
Browse files

Remove progress bars

parent 4dc42a44
......@@ -13,7 +13,8 @@ from services.webservice import WebService
import shutil
import os
from subprocess import Popen, PIPE
from security import SafePopen
import time
def ilp_aleph(input_dict):
aleph = Aleph()
......@@ -128,16 +129,16 @@ def ilp_treeliker(input_dict):
arff_train, arff_test = treeliker.run()
return {'arff': arff_train, 'treeliker': treeliker}
def ilp_cardinalization(input_dict,widget):
return cardinalization(input_dict,widget,False)
def ilp_cardinalization(input_dict):
return cardinalization(input_dict,False)
def ilp_quantiles(input_dict,widget):
return cardinalization(input_dict,widget,False)
def ilp_quantiles(input_dict):
return cardinalization(input_dict,False)
def ilp_relaggs(input_dict,widget):
return cardinalization(input_dict,widget,True)
def ilp_relaggs(input_dict):
return cardinalization(input_dict,True)
def cardinalization(input_dict,widget,is_relaggs):
def cardinalization(input_dict,is_relaggs):
output_dict = {}
excluded_fields = parse_excluded_fields(input_dict['context'])
args_list = ['java', '-Xmx512m', '-jar', 'proper/properLauncher.jar']
......@@ -146,7 +147,9 @@ def cardinalization(input_dict,widget,is_relaggs):
else:
args_list += ['-cardinalizer']
result_table = '_%s_%s_%s' % (('relaggs' if is_relaggs else ('quantiles' if 'discretize_parts' in input_dict else 'cardinalize' )), str(widget.workflow_id), str(widget.id))
result_table = '_%s_%s' % (('relaggs' if is_relaggs else ('quantiles' if 'discretize_parts' in input_dict else 'cardinalize' )), int(round(time.time() * 1000)) )
#progress bar issue
#result_table = '_%s_%s_%s' % (('relaggs' if is_relaggs else ('quantiles' if 'discretize_parts' in input_dict else 'cardinalize' )), str(widget.workflow_id), str(widget.id))
args_list += [
'-use_foreign_keys',
......@@ -166,19 +169,9 @@ def cardinalization(input_dict,widget,is_relaggs):
except KeyError:
pass
p = SafePopen(args_list,cwd=os.path.dirname(os.path.abspath(__file__)), stdout=PIPE).safe_run()
p = Popen(args_list,cwd=os.path.dirname(os.path.abspath(__file__)), stdout=PIPE)
stdout_str, stderr_str = p.communicate()
#while True:
# line = p.stdout.readline()
# match_obj = re.match( r'(\d*)/(\d*) rows', line, re.I)
# if match_obj:
# current_percent = (float(match_obj.group(1))/float(match_obj.group(2)))*100
# widget.progress = current_percent
# widget.save()
# if not line:
# break
widget.progress=100
widget.save()
output_dict['context'] = input_dict['context'].change_table(result_table)
return output_dict
......
......@@ -8,7 +8,7 @@
"windows_queue": false,
"package": "ilp",
"interaction_view": "",
"has_progress_bar": true,
"has_progress_bar": false,
"image": "",
"description": "",
"static_image": "",
......
......@@ -8,7 +8,7 @@
"windows_queue": false,
"package": "ilp",
"interaction_view": "",
"has_progress_bar": true,
"has_progress_bar": false,
"image": "",
"description": "",
"static_image": "",
......
......@@ -8,7 +8,7 @@
"windows_queue": false,
"package": "ilp",
"interaction_view": "",
"has_progress_bar": true,
"has_progress_bar": false,
"image": "",
"description": "",
"static_image": "",
......
......@@ -4,6 +4,8 @@ MySQL connectivity library.
@author: Anze Vavpetic <anze.vavpetic@ijs.si>
'''
import os
import tempfile
import time
from context import DBConnection, DBContext, MySqlDAL, PgSqlDAL
from converters import RSD_Converter, Aleph_Converter, Orange_Converter, TreeLikerConverter, PrdFctConverter
from mapper import domain_map
......@@ -60,37 +62,30 @@ def mysql_orange_converter(input_dict):
orange = Orange_Converter(context)
return {'target_table_dataset' : orange.target_Orange_table(),'other_table_datasets': orange.other_Orange_tables()}
def mysql_prd_fct_converter(input_dict, widget):
widget.progress=0
widget.save()
def mysql_prd_fct_converter(input_dict):
context = input_dict['context']
prd_fct = PrdFctConverter(context)
#progress bar issue
url=os.path.dirname(os.path.abspath(__file__))
url=os.path.normpath(os.path.join(url,'..','..','mothra','public','files'))
if not os.path.exists(url):
os.makedirs(url)
url=os.path.normpath(os.path.join(url,str(widget.workflow_id)))
if not os.path.exists(url):
os.makedirs(url)
widget.progress=20
widget.save()
prd_file_url=os.path.join(url,"prdFctTemp%s.prd"%str(widget.id))
#if not os.path.exists(url):
# os.makedirs(url)
#url=os.path.normpath(os.path.join(url,str(widget.workflow_id)))
#if not os.path.exists(url):
# os.makedirs(url)
url = tempfile.mkdtemp(dir=url)
timenow = int(round(time.time() * 1000))
prd_file_url=os.path.join(url,"prdFctTemp%s.prd"%str(timenow))
with open(prd_file_url, "w") as prd:
prd.write( prd_fct.create_prd_file());
widget.progress=40
widget.save()
fct_file_url=os.path.join(url,"prdFctTemp%s.fct"%str(widget.id))
fct_file_url=os.path.join(url,"prdFctTemp%s.fct"%str(timenow))
with open(fct_file_url, "w") as fct:
fct.write( prd_fct.create_fct_file());
widget.progress=100
widget.save()
return {'prd_file' : prd_file_url,'fct_file': fct_file_url}
def ilp_map_rsd(input_dict):
......
......@@ -8,7 +8,7 @@
"windows_queue": false,
"package": "mysql",
"interaction_view": "",
"has_progress_bar": true,
"has_progress_bar": false,
"image": "",
"description": "",
"static_image": "mysql.png",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment