You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several functions use NumPy's structured arrays. I thought it is better to replace them to dataclasses for several reasons:
It is basically not informative to users to know what members are contained in the array since the array does not provide static type information (i.e., users can't comprehend the behavior by seeing the function signatures). Unfortunately we couldn't expect that structured arrays are supported by a mypy-friendly manner in the near future: Type hinting / annotation (PEP 484) for ndarray, dtype, and ufunc numpy/numpy#7370 (comment)
Manipulating structured arrays with heterogeneous data is usually much expensive than manipulating usual objects. Enforcing memory alignment can mitigate this problem, but it requires to constrain the length of string fields, which may be not suitable for the current implementation.
Several functions use NumPy's structured arrays. I thought it is better to replace them to dataclasses for several reasons:
RFC: @neubig @pfliu-nlp
The text was updated successfully, but these errors were encountered: