gli
gli copied to clipboard
[BUG] Attribute class from gli.io fails to detect str type data automatically
Describe the bug
When I tried to add some str type date into Node Attributes, I found that Attribute class fails to automatically detect the data format of the data. Though adding data_type='str' would work, it's more user-friendly to completely implement the data format detection function.
To Reproduce
follow codes below:
# BUG example
from gli.io import save_graph, Attribute
import numpy as np
a = Attribute("date", np.array(["Mon", "Tue", "Wed"]), "date", data_type="str") # worked
print(a)
a = Attribute("date", np.array(["Mon", "Tue", "Wed"]), "date") # failed without data_type="str"
#FIXME - NotImplementedError: memoryview: unsupported format 3w
Expected behavior I think even without data_type="str", this function should work properly.
Screenshots