Commit df86bee1 authored by Klaus Zimmermann's avatar Klaus Zimmermann
Browse files

Adapt editor to new index function column (closes #123)

parent 41c984ba
......@@ -19,23 +19,6 @@ def build_periods(spec):
return periods
INDEX_FUNCTIONS = {
'FUN_count_occurrences': 'count_occurrences',
'FUN_first_occurrence': 'first_occurrence',
'FUN_last_occurrence': 'last_occurrence',
'FUN_spell_length': 'spell_length',
'FUN_spell_beginning': 'spell_beginning',
'FUN_spell_end': 'spell_end',
'FUN_statistic': 'statistics',
'FUN_percentile': 'percentile',
'FUN_degreesum': 'degreesum',
'FUN_thresholded_statistic': 'thresholded_statistics',
'FUN_thresholded_percentile': 'thresholded_percentile',
'FUN_running_statistics': 'running_statistics',
'FUN_thresholded_running_statistics': 'thresholded_running_statistics',
}
def tr_cell_methods(cell_method_string):
name = r'(?P<name>\w+):'
method = (r'(?P<method>('
......@@ -58,6 +41,8 @@ def tr_cell_methods(cell_method_string):
def split_parts(no_parts, part_string):
if no_parts == 0:
return []
parts = [p.strip() for p in part_string.split(',')]
assert len(parts) == no_parts
return parts
......@@ -118,7 +103,7 @@ def tr_index_function(name, no_thresholds,
parameters = split_parameter_definitions(parameter_definitions_string,
parameter_names)
index_function = {
'name': INDEX_FUNCTIONS[name],
'name': name,
'parameters': [tr_parameter(p) for p in parameters],
}
return index_function
......
Supports Markdown
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