-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathadd_dataset.html
More file actions
executable file
·141 lines (125 loc) · 5.13 KB
/
add_dataset.html
File metadata and controls
executable file
·141 lines (125 loc) · 5.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{% extends "base.html" %}
{% block js_init %}
function showTaskTypeOption() {
var selector = $("select[name=task_type]")[0];
$(".TaskTypeOptions:visible").hide("fast");
$("#TaskType" + selector.options[selector.selectedIndex].value + "Options").show("fast")
};
showTaskTypeOption();
$("select[name=task_type]").change(showTaskTypeOption);
{% endblock js_init %}
{% block core %}
<div class="core_title">
<h1><a href="{{ url("task", task.id) }}">{{ task.title }} ({{ task.name }})</a> - Create dataset</h1>
</div>
{% if original_dataset is none %}
<form enctype="multipart/form-data" action="{{ url("task", task.id, "add_dataset") }}" method="POST">
{% else %}
You are cloning the dataset "{{ original_dataset.description }}".
<form enctype="multipart/form-data" action="{{ url("dataset", clone_id, "clone") }}" method="POST">
{% endif %}
{{ xsrf_form_html|safe }}
<table>
<tr><td colspan=2><h2>Dataset information</h2></td></tr>
<tr>
<td>
<span class="info" title="A (unique) description for this dataset."></span>
Description
</td>
<td>
<input type="text" name="description" value="{{ default_description }}"/>
</td>
</tr>
{% if original_dataset is not none %}
<tr>
<td>
<span class="info" title="Whether to copy over the evaluations from the original dataset."></span>
Clone evaluation results
</td>
<td>
<input type="checkbox" name="clone_results"/>
</td>
</tr>
{% endif %}
<tr><td colspan=2><h2>Limits</h2></td></tr>
<tr>
<td>
<span class="info" title="Total maximum time for each evaluation, in seconds."></span>
Time limit
</td>
<td><input type="text" name="time_limit" value="{{ 1 if original_dataset is none else original_dataset.time_limit or "" }}"/> second(s)</td>
</tr>
<tr>
<td>
<span class="info" title="Total maximum memory usage for each evaluation, in MiB (2^20 bytes)."></span>
Memory limit
</td>
<td><input type="text" name="memory_limit" value="{{ 512 if original_dataset is none else (original_dataset.memory_limit // (1024 * 1024) if original_dataset.memory_limit is not none else "") }}"/> MiB</td>
</tr>
<tr><td colspan=2><h2>Task type settings (<a href="http://cms.readthedocs.org/en/{{ rtd_version }}/Task%20types.html" target="_blank">documentation</a>)</h2></td></tr>
<tr>
<td>
<span class="info" title="Please see the task type documentation."></span>
Task type
</td>
<td>
<select name="task_type">
{% for task_type_name, task_type in TASK_TYPES.items() %}
<option value="{{ task_type_name }}"{% if original_dataset is not none and task_type_name == original_dataset.task_type %} selected{% endif %}>{{ task_type_name }}</option>
{% endfor %}
</select>
{% for task_type_name, task_type in TASK_TYPES.items() %}
<table class="TaskTypeOptions bordered" id="TaskType{{ task_type_name }}Options" style="display: none;">
{% if original_dataset is not none and task_type_name == original_dataset.task_type %}
{% set values = original_dataset_task_type_parameters %}
{% else %}
{% set values = none %}
{% endif %}
{% for i in range(task_type.ACCEPTED_PARAMETERS|length) %}
{% set param_def = task_type.ACCEPTED_PARAMETERS[i] %}
{% set val = values[i] if values is not none else none %}
<tr>
<td>{{ param_def.name }}</td>
<td>
{{ param_def.render("TaskTypeOptions_%s_"|format(task_type_name), previous_value=val)|safe }}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</td>
</tr>
{% if original_dataset is not none and original_dataset.managers|length != 0 %}
<tr>
<td>
<span class="info" title="Whether to copy the managers from the original dataset."></span>
Clone managers
</td>
<td><input type="checkbox" name="clone_managers" checked/></td>
</tr>
{% endif %}
<tr><td colspan=2><h2>Score type settings (<a href="http://cms.readthedocs.org/en/{{ rtd_version }}/Score%20types.html" target="_blank">documentation</a>)</h2></td></tr>
<tr>
<td>
<span class="info" title="Please see the score type documentation."></span>
Score Type
</td>
<td>
<select name="score_type">
{% for score_type_name, score_type in SCORE_TYPES.items() %}
<option value="{{ score_type_name }}"{% if original_dataset is not none and score_type_name == original_dataset.score_type %} selected{% endif %}>{{ score_type_name }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td>
<span class="info" title="Please see the score type documentation."></span>
Score Parameters
</td>
<td><textarea name="score_type_parameters">{{ original_dataset.score_type_parameters|tojson|forceescape if original_dataset is not none else "" }}</textarea></td>
</tr>
</table>
<input type="submit" value="Create"/>
</form>
{% endblock core %}