PMEAL / OpenPNM
Showing 1 of 1 files from the diff.

@@ -2,9 +2,17 @@
Loading
2 2
import openpnm as op
3 3
4 4
5 -
def plot_connections(network, throats=None, fig=None, size_by=None,
6 -
                     color_by=None, cmap='jet', color='b', alpha=1.0,
7 -
                     linestyle='solid', linewidth=1, **kwargs):
5 +
def plot_connections(network,
6 +
                     throats=None,
7 +
                     fig=None,
8 +
                     size_by=None,
9 +
                     color_by=None,
10 +
                     cmap='jet',
11 +
                     color='b',
12 +
                     alpha=1.0,
13 +
                     linestyle='solid',
14 +
                     linewidth=1,
15 +
                     **kwargs):  # pragma: no cover
8 16
    r"""
9 17
    Produce a 3D plot of the network topology.
10 18
@@ -90,7 +98,11 @@
Loading
90 98
        dim[np.argwhere(~dim)[0]] = True
91 99
92 100
    fig = plt.figure() if fig is None else fig
93 -
    ax = fig.gca()
101 +
    if hasattr(fig, 'gca'):
102 +
        ax = fig.gca()
103 +
    else:
104 +
        ax = fig
105 +
94 106
    if ThreeD and ax.name != '3d':
95 107
        fig.delaxes(ax)
96 108
        ax = fig.add_subplot(111, projection='3d')
@@ -128,9 +140,17 @@
Loading
128 140
    return fig
129 141
130 142
131 -
def plot_coordinates(network, pores=None, fig=None, size_by=None,
132 -
                     color_by=None, cmap='jet', color='r', alpha=1.0,
133 -
                     marker='o', markersize=10, **kwargs):
143 +
def plot_coordinates(network,
144 +
                     pores=None,
145 +
                     fig=None,
146 +
                     size_by=None,
147 +
                     color_by=None,
148 +
                     cmap='jet',
149 +
                     color='r',
150 +
                     alpha=1.0,
151 +
                     marker='o',
152 +
                     markersize=10,
153 +
                     **kwargs):  # pragma: no cover
134 154
    r"""
135 155
    Produce a 3D plot showing specified pore coordinates as markers.
136 156
@@ -211,7 +231,10 @@
Loading
211 231
        dim[[0, 1]] = True
212 232
213 233
    fig = plt.figure() if fig is None else fig
214 -
    ax = fig.gca()
234 +
    if hasattr(fig, 'gca'):
235 +
        ax = fig.gca()
236 +
    else:
237 +
        ax = fig
215 238
    if ThreeD and ax.name != '3d':
216 239
        fig.delaxes(ax)
217 240
        ax = fig.add_subplot(111, projection='3d')
@@ -289,8 +312,13 @@
Loading
289 312
            ax.autoscale()
290 313
291 314
292 -
def plot_networkx(network, plot_throats=True, labels=None, colors=None,
293 -
                  scale=1, ax=None, alpha=1.0):
315 +
def plot_networkx(network,
316 +
                  plot_throats=True,
317 +
                  labels=None,
318 +
                  colors=None,
319 +
                  scale=1,
320 +
                  ax=None,
321 +
                  alpha=1.0):  # pragma: no cover
294 322
    r"""
295 323
    Creates a pretty 2d plot for 2d OpenPNM networks.
296 324
@@ -384,7 +412,8 @@
Loading
384 412
                 Tsize='throat.diameter',
385 413
                 Pcolor=None,
386 414
                 Tcolor=None,
387 -
                 cmap='jet', **kwargs):
415 +
                 cmap='jet',
416 +
                 **kwargs):  # pragma: no cover
388 417
    r"""
389 418
    Quickly visualize a network in 3D using VPython.
390 419
@@ -496,8 +525,12 @@
Loading
496 525
    return scene
497 526
498 527
499 -
def plot_tutorial(network, font_size=12, line_width=2,
500 -
                  node_color='b', edge_color='r', node_size=500):
528 +
def plot_tutorial(network,
529 +
                  font_size=12,
530 +
                  line_width=2,
531 +
                  node_color='b',
532 +
                  edge_color='r',
533 +
                  node_size=500):  # pragma: no cover
501 534
    r"""
502 535
    Generate a network plot suitable for tutorials and explanations.
503 536
Files Coverage
openpnm 88.0%
Project Totals (160 files) 88.0%
codecov-umbrella
Build #734005331 -
unittests
1
codecov:
2
  branch: dev
3

4
coverage:
5
  precision: 1
6
  round: down
7
  range: "50...100"
8

9
  status:
10
    project:
11
      default:
12
        target: auto
13
        threshold: 0.5%
14
        branches: null
15

16
    patch:
17
      default:
18
        target: auto
19
        threshold: 0.5%
20
        branches: null
21

22
comment:
23
  layout: "header, diff, changes, sunburst, uncovered"
24
  branches: null
25
  behavior: default
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading