Passed
Push — dependabot/pip/sphinx-copybutt... ( c72176...cfd31d )
by
unknown
07:42 queued 05:46
created

mandos.analysis.plots.ViolinPlotter.plot()   A

Complexity

Conditions 1

Size

Total Lines 10
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nop 2
dl 0
loc 10
rs 9.9
c 0
b 0
f 0
1
"""
2
Plots.
3
"""
4
from collections import Mapping
0 ignored issues
show
Unused Code introduced by
Unused Mapping imported from collections
Loading history...
Bug introduced by
The name Mapping does not seem to exist in module collections.
Loading history...
5
from dataclasses import dataclass
6
7
import seaborn as sns
0 ignored issues
show
introduced by
Unable to import 'seaborn'
Loading history...
8
from matplotlib.axes import Axes
0 ignored issues
show
introduced by
Unable to import 'matplotlib.axes'
Loading history...
9
from matplotlib.figure import Figure
0 ignored issues
show
introduced by
Unable to import 'matplotlib.figure'
Loading history...
Unused Code introduced by
Unused Figure imported from matplotlib.figure
Loading history...
10
11
from mandos.analysis.concordance import ConcordanceDf
12
13
14
@dataclass(frozen=True, repr=True)
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
15
class HeatmapPlotter:
16
    vmin: float = 0
17
    vmax: float = 1
18
19
    def plot(self, ax: Axes) -> Axes:
0 ignored issues
show
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...
introduced by
Missing function or method docstring
Loading history...
Coding Style Naming introduced by
Argument name "ax" 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...
20
        ax.pcolormesh()
21
        return ax
22
23
24
class ViolinPlotter:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
25
    def plot(self, concordance: ConcordanceDf) -> Axes:
0 ignored issues
show
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...
introduced by
Missing function or method docstring
Loading history...
26
        palette = sns.color_palette(["#0000c0", "#888888"])
27
        return sns.violinplot(
28
            data=concordance,
29
            x="psi",
30
            y="score",
31
            hue="phi",
32
            split=True,
33
            scale_hue=False,
34
            palette=palette,
35
        )
36