for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import pytest
from pocketutils.core.dot_dict import NestedDotDict
from mandos.analysis.io_defns import *
math
mandos.analysis.io_defns
np
defaultdict
pd
Optional
Union
Tuple
Set
Sequence
Dict
Collection
cycle
TypedDfs
ConcordanceDf
EnrichmentDf
ScoreDf
SimilarityDfLongForm
PsiProjectedDf
from .. import get_test_resource
class TestIoDefns:
def test_read_short_form(self):
If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example
class Foo: def some_method(self, x, y): return x + y;
could be written as
class Foo: @classmethod def some_method(cls, x, y): return x + y;
df = SimilarityDfShortForm.read_file(get_test_resource("shortform-matrix.csv"))
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
assert len(df) == 3
long = df.to_long_form("phi", "phi")
assert len(long) == 6
if __name__ == "__main__":
pytest.main()