Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
climix
climix
Commits
df86bee1
Commit
df86bee1
authored
Nov 04, 2019
by
Klaus Zimmermann
Browse files
Adapt editor to new index function column (closes
#123
)
parent
41c984ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
climix/editor/alttable.py
View file @
df86bee1
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment