Skip to content

Commit

Permalink
allowing ot init colorsequence
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed Feb 20, 2020
1 parent bc48f14 commit 6bf3625
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions majortrack/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@ def get_auto_corrs(self, residents=True):
}
return None

def get_community_coloring(self, n=None, iterator=None, *args, **kwargs):
def get_community_coloring(self, n=None, iterator=None, **kwargs):
if n is None:
n = self.comm_nbr
use_dc = kwargs.get('distinct_colors', None)
Expand All @@ -2107,15 +2107,20 @@ def get_community_coloring(self, n=None, iterator=None, *args, **kwargs):
assert n <= use_dc.n
self.color_sequence = use_dc
elif self.color_sequence is None:
self.color_sequence = DistinctColors(
n,
[0, 1], [0.2, 1.0], [0.9, 1.0],
dc_params = kwargs.get(
'dc_params', dict(
h_shuffle=False,
s_shuffle=False,
h_init=0.1,
s_init=1.0,
v_init=1.0,
)
)
self.color_sequence = DistinctColors(
n,
[0, 1], [0.2, 1.0], [0.9, 1.0],
**dc_params
)
else:
assert self.color_sequence.n >= n
if iterator is None:
Expand Down

0 comments on commit 6bf3625

Please sign in to comment.