-
Couldn't load subscription status.
- Fork 38
Description
The inconsistency when converting to colors (Issue #389) was fixed in #402. In the case of _color_arg_to_dict, it helps that colors are specified with tuples or strings so that if there is an iterable of scalars, it is clear that the scalars must be mapped to a color. In contrast, for the _scalar_arg_to_dict method, it's unclear whether an iterable of scalars are the desired values, or whether those values should be interpolated between preset (or user-defined) min and max allowable values. For example:
>>> import xgi
>>> H = xgi.Hypergraph([{1, 2, 3}, {1, 2}, {1, 4}])
>>> d = H.nodes.degree.asnumpy()
>>> xgi.drawing.draw._scalar_arg_to_dict(d, [1, 2, 3, 4], 10, 30)
{1: 3.0, 2: 2.0, 3: 1.0, 4: 1.0}
>>> xgi.drawing.draw._scalar_arg_to_dict(H.nodes.degree, [1, 2, 3, 4], 10, 30)
{1: 30.0, 2: 20.0, 3: 10.0, 4: 10.0}*I ran the _scalar_arg_to_dict function by pasting into a notebook and running it directly, because there was some weirdness with the importing.