Passed
Push — main ( ec3fe3...82dd22 )
by Douglas
02:00
created

mandos.analysis.corr_plots   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 27
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A CorrPlotter.plot() 0 6 3
1
"""
2
Plots.
3
"""
4
from collections import Mapping
0 ignored issues
show
Bug introduced by
The name Mapping does not seem to exist in module collections.
Loading history...
Unused Code introduced by
Unused Mapping imported from collections
Loading history...
5
from dataclasses import dataclass
6
from typing import Any
0 ignored issues
show
Unused Code introduced by
Unused Any imported from typing
Loading history...
7
8
try:
9
    import seaborn as sns
10
    from matplotlib.axes import Axes
0 ignored issues
show
Unused Code introduced by
Unused Axes imported from matplotlib.axes
Loading history...
11
    from matplotlib.figure import Figure
0 ignored issues
show
Unused Code introduced by
Unused Figure imported from matplotlib.figure
Loading history...
12
    from matplotlib.gridspec import GridSpec
13
    import umap
0 ignored issues
show
Unused Code introduced by
The import umap seems to be unused.
Loading history...
14
except ImportError:
15
    sns = None
16
    Axes = None
17
    Figure = None
18
    umap = None
19
    GridSpec = None
20
21
from mandos.analysis.io_defns import SimilarityDfLongForm
22
from mandos.analysis.concordance import ConcordanceDf
0 ignored issues
show
Unused Code introduced by
Unused ConcordanceDf imported from mandos.analysis.concordance
Loading history...
23
24
25
@dataclass(frozen=True, repr=True)
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
26
class CorrPlotter:
27
    """"""
28
29
    def plot(self, phis: SimilarityDfLongForm, psis: SimilarityDfLongForm):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

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;
Loading history...
30
        gs = GridSpec(len(phis), len(psis))
0 ignored issues
show
Unused Code introduced by
The variable gs seems to be unused.
Loading history...
Coding Style Naming introduced by
Variable name "gs" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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.

Loading history...
31
        for phi in phis["key"]:
0 ignored issues
show
Unused Code introduced by
The variable phi seems to be unused.
Loading history...
32
            for psi in psis["key"]:
0 ignored issues
show
Unused Code introduced by
The variable psi seems to be unused.
Loading history...
33
                pass
34
        g.map_dataframe(sns.histplot, x="total_bill")
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'g'
Loading history...
Comprehensibility Best Practice introduced by
The variable g does not seem to be defined.
Loading history...
35
36
37
__all__ = ["CorrPlotter"]
38