clkhash
clkhash copied to clipboard
Code formatting issues - automate?
See closed PR #110
Essentially the findings are that we can't use black (yet). The problem is we would have to change our inline type annotations for mypy. E.g. the function:
def double_hash_encode_ngrams_non_singular(ngrams, # type: Iterable[str]
keys, # type: Sequence[bytes]
k, # type: int
l, # type: int
encoding # type: str
):
# type: (...) -> bitarray.bitarray
"""
computes the double hash encoding of the provided n-grams with the given keys.
Formatted by black running with all defaults into:
def double_hash_encode_ngrams_non_singular(
ngrams,
keys,
k,
l,
encoding, # type: Iterable[str] # type: Sequence[bytes] # type: int # type: int # type: str
):
# type: (...) -> bitarray.bitarray
"""
computes the double hash encoding of the provided n-grams with the given keys.
...
Which mypy doesn't like.
Black have patched to now handle type annotations so could we worth trying this again.