The docstring of partition_to_color method in ismags.py seems off to me. The description is not clear, and it's hard to understand what the method is supposed to do.
def partition_to_color(partitions):
"""
Creates a dictionary with for every item in partition for every partition
in partitions the index of partition in partitions.
Parameters
----------
partitions: collections.abc.Sequence[collections.abc.Iterable]
As returned by :func:`make_partitions`.
Returns
-------
dict
"""
colors = {}
for color, keys in enumerate(partitions):
for key in keys:
colors[key] = color
return colors
I think the following description explains the method better.
def partition_to_color(partitions):
"""
Creates a dictionary that maps each item in each partition to the index of
the partition it belongs to
"""
If the new description looks alright, I'll go ahead and make the changes.
The docstring of
partition_to_colormethod in ismags.py seems off to me. The description is not clear, and it's hard to understand what the method is supposed to do.I think the following description explains the method better.
If the new description looks alright, I'll go ahead and make the changes.