Skip to content

Commit

Permalink
quickfix idea
Browse files Browse the repository at this point in the history
  • Loading branch information
interrogator committed Nov 30, 2019
1 parent e2fa2d9 commit e78b5f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions explorer/parts/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def _new_table(

sort = sort or "total"

relative, keyness = _translate_relative(relkey, CORPORA[slug])
relative, keyness = _translate_relative(relkey)

# check if there are any validation problems
if session_click_table != n_clicks:
Expand Down Expand Up @@ -410,7 +410,7 @@ def _new_table(
table = corpus.table(
show=show,
subcorpora=subcorpora,
relative=relative,
relative=relative if relative != "corpus" else CORPORA[slug],
keyness=keyness,
sort=sort,
)
Expand Down
4 changes: 2 additions & 2 deletions explorer/parts/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ def _tuple_or_list(this_identifier, typ):
return typ(out)


def _translate_relative(inp, corpus):
def _translate_relative(inp):
"""
Get relative and keyness from two-character input
"""
if not inp:
return False, False
mapping = dict(t=True, f=False, n=corpus, l="ll", p="pd") # noqa: E741
mapping = dict(t=True, f=False, n="corpus", l="ll", p="pd") # noqa: E741
return mapping[inp[0]], mapping[inp[1]]


Expand Down

0 comments on commit e78b5f4

Please sign in to comment.