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 36fcdeff authored by Janez K's avatar Janez K
Browse files

Merge branch 'dev'

parents 16aba705 691abe68
......@@ -1183,6 +1183,93 @@
"description": "Data matching the filter provided"
}
},
{
"pk": 68,
"model": "workflows.abstractwidget",
"fields": {
"category": 13,
"treeview_image": "",
"name": "Split dataset",
"is_streaming": false,
"uid": "af4010a8-836c-41c7-adf6-50118295cf8e",
"interaction_view": "",
"image": "",
"package": "cforange",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"action": "cforange_split_dataset",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": "Splits a dataset to a train and test dataset."
}
},
{
"pk": 123,
"model": "workflows.abstractinput",
"fields": {
"widget": 68,
"name": "Dataset",
"short_name": "odt",
"uid": "fe354f76-d6ed-4907-9ab6-d8784b3c7620",
"default": "",
"required": false,
"multi": false,
"parameter_type": null,
"variable": "dataset",
"parameter": false,
"order": 1,
"description": "A dataset that will be split into two parts"
}
},
{
"pk": 124,
"model": "workflows.abstractinput",
"fields": {
"widget": 68,
"name": "Split factor",
"short_name": "p",
"uid": "6a637f14-7ba4-4c33-90e0-6cc260587260",
"default": "0.5",
"required": false,
"multi": false,
"parameter_type": "text",
"variable": "p",
"parameter": true,
"order": 1,
"description": "A number between 0 and 1 that determines the sizes of the two datasets"
}
},
{
"pk": 69,
"model": "workflows.abstractoutput",
"fields": {
"widget": 68,
"name": "Train data",
"short_name": "tra",
"variable": "train_data",
"uid": "665e0af4-6e6e-4616-8e96-2d8866497a40",
"order": 1,
"description": "Train data"
}
},
{
"pk": 70,
"model": "workflows.abstractoutput",
"fields": {
"widget": 68,
"name": "Test data",
"short_name": "tes",
"variable": "test_data",
"uid": "514abf26-b0d5-4483-9273-6b930bf4eb68",
"order": 1,
"description": "Test data"
}
},
{
"pk": 66,
"model": "workflows.abstractwidget",
......
import re
def cforange_create_integers(input_dict):
intStr = input_dict['intStr']
intList = []
for i in re.findall(r'\w+', intStr):
try:
intList.append(int(i))
except:
pass
if input_dict['sort'].lower() == "true":
intList.sort()
return {'intList':intList}
def cforange_sum_integers(input_dict):
intList = input_dict['intList']
return {'sum':sum(intList)}
def cforange_pre_filter_integers(input_dict):
return input_dict
def cforange_post_filter_integers(postdata,input_dict,output_dict):
intListOut = postdata['intListOut']
intList = []
for i in intListOut:
try:
intList.append(int(i))
except:
pass
return {'intList': intList}
def cforange_pre_display_summation(input_dict):
return {}
\ No newline at end of file
def cforange_split_dataset(input_dict):
import orange
output_dict = {}
data = input_dict['dataset']
selection = orange.MakeRandomIndices2(data,float(input_dict['p']))
train_data = data.select(selection,0)
test_data = data.select(selection,1)
output_dict['train_data']=train_data
output_dict['test_data']=test_data
return output_dict
\ No newline at end of file
......@@ -258,6 +258,20 @@ class AbstractWidget(models.Model):
class Meta:
ordering = ('order','name',)
def set_uid(self,commit=False):
import uuid
self.uid = uuid.uuid4()
if commit:
self.save()
for i in self.inputs.all():
i.uid = uuid.uuid4()
if commit:
i.save()
for o in self.outputs.all():
o.uid = uuid.uuid4()
if commit:
o.save()
def __unicode__(self):
return unicode(self.name)
......
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