gli icon indicating copy to clipboard operation
gli copied to clipboard

[BUG] Attribute class from gli.io fails to detect str type data automatically

Open huskydoge opened this issue 1 year ago • 0 comments

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

截屏2023-12-06 10 21 56

huskydoge avatar Dec 06 '23 02:12 huskydoge