GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — NdArray inconsistently coerces floats and ints · Issue #1914 · docarray/docarray
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
NdArray inconsistently coerces floats and ints #1914Copy link Copy link Open DescriptionInitial Checks
DescriptionI would expect floats and ints to be consistently either able to be coerced to NdArrays or not. Floats cannot be coerced. Ints can be coerced - but not in the expected way. It seems to use Generally, I would expect that an int or a float would be coerced to a 1-dimensional array with a single element. Example Codefrom docarray import BaseDoc from docarray.typing import NdArray class MyDoc(BaseDoc): arr: NdArray MyDoc(arr=10).arr # Undefined behaviour; uninitialized array >> NdArray([7.17677097e-312, 1.77863633e-322, 0.00000000e+000, 0.00000000e+000, 5.28555753e+180, 5.98847221e+174, 5.92957407e-038, 7.42262642e-091, 2.80246406e-032, nan]) MyDoc(arr=10.0).arr # ValidationError I would expect instead: Python, DocArray & OS VersionAffected ComponentsActivity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |