• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

manahl / PyBloqs / e0ef5b11-a828-46c3-b0cf-c452bea7e733

18 Sep 2024 08:17PM UTC coverage: 87.335% (-0.04%) from 87.377%
e0ef5b11-a828-46c3-b0cf-c452bea7e733

Pull #112

circleci

rspencer01
Add pytest
Pull Request #112: Upgrade code from python 2

99 of 117 new or added lines in 20 files covered. (84.62%)

17 existing lines in 2 files now uncovered.

2117 of 2424 relevant lines covered (87.33%)

2.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

52.94
/pybloqs/plot/extras.py
1
from pybloqs.plot import Chart, ColorAxis, Expr, Legend, Options3d, Plot, Scatter, Title, Tooltip, XAxis, YAxis
3✔
2
from pybloqs.plot import Heatmap as HeatmapPlot
3✔
3

4

5
class Heatmap(Plot):
3✔
6
    def __init__(self, data, *args, **kwargs):
3✔
NEW
7
        super().__init__(data, HeatmapPlot(), flatten=True, *args, **kwargs)
×
8

9
        self._chart_cfg = self._chart_cfg.inherit_many(
×
10
            YAxis(title=None, reversed=True), XAxis(opposite=True), ColorAxis(min_color="#ffffff", max_color="#3060cf")
11
        )
12

13

14
class Corr(Heatmap):
3✔
15
    def __init__(self, data, *args, **kwargs):
3✔
NEW
16
        super().__init__(data, *args, **kwargs)
×
17

18
        self._chart_cfg = self._chart_cfg.inherit_many(
×
19
            ColorAxis(min=0, max=1),
20
            Tooltip(
21
                formatter=Expr("""\
22
                function() {
23
                return '<b>' + this.series.xAxis.categories[this.point.x] + ' - '
24
                       + this.series.yAxis.categories[this.point.y] + '</b>: '
25
                       + ((this.point.value * 100) | 0) + '%';
26
                }
27
                """)
28
            ),
29
        )
30

31

32
class Surface(Plot):
3✔
33
    def __init__(self, data, *args, **kwargs):
3✔
34
        options = Options3d(
×
35
            enabled=True,
36
            alpha=kwargs.pop("alpha", 20),
37
            beta=kwargs.pop("beta", 0),
38
            depth=kwargs.pop("depth", 150),
39
            view_distance=kwargs.pop("view_distance", 10),
40
        )
41

NEW
42
        super().__init__(data, Scatter(), flatten=True, switch_zy=True, *args, **kwargs)
×
43

44
        self._chart_cfg = self._chart_cfg.inherit_many(
×
45
            Chart(options), Legend(enabled=False), YAxis(Title(text=None))
46
        ).override_many(Chart(zoom_type=None))
47

48
    def _write_plot_postprocess(self, chart_buf):
3✔
49
        chart_buf.write("pybloqsSurfaceRotate(chart);")
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc