Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
[plots/networks] fix handling of ndarray of strings for arrow_labels.
Browse files Browse the repository at this point in the history
Thx @gph82 for noticing!
  • Loading branch information
marscher committed May 4, 2016
1 parent 3e18553 commit b664107
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyemma/plots/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from __future__ import absolute_import
import math
import numpy as np
import six

from pyemma.util import types as _types
from six.moves import range
Expand Down Expand Up @@ -213,9 +214,10 @@ def plot_network(self,
L = arrow_labels
else:
L = np.empty(np.shape(self.A), dtype=object)

if arrow_labels is None:
L[:, :] = ''
elif arrow_labels.lower() == 'weights':
elif isinstance(arrow_labels, six.string_types) and arrow_labels.lower() == 'weights':
for i in range(n):
for j in range(n):
L[i, j] = arrow_label_format % self.A[i, j]
Expand Down

0 comments on commit b664107

Please sign in to comment.