Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent length for range buffers #125

Open
daslu opened this issue Dec 1, 2024 · 0 comments
Open

inconsistent length for range buffers #125

daslu opened this issue Dec 1, 2024 · 0 comments

Comments

@daslu
Copy link

daslu commented Dec 1, 2024

Here is an interesting phenomenon:

$ clj -Sdeps '{:deps {cnuernber/dtype-next {:mvn/version "10.124"}}}'

user=> (require '[tech.v3.datatype :as dtype])
nil

user=> (->> (range 2 3 0.01)
     count)
101

user=> (->> (range 2 3 0.01)
     (tech.v3.datatype/emap identity :float32)
     count)
100

Probably it is related to the fact that the different between the range start an end is close to a multiple of the step size.
Not all step sizes are problematic:

ser=> (->> (range 2 3 0.0099)
     count)
102

user=> (->> (range 2 3 0.0099)
     (tech.v3.datatype/emap identity :float32)
     count)
102

The issue seems important since it affects column addition in tech.ml.dataset:

$ clj -Sdeps '{:deps {techascent/tech.ml.dataset {:mvn/version "7.034"}}}'
Clojure 1.12.0

user=> (require '[tech.v3.dataset :as ds])
nil

user=> (-> {:x (range 2 3 0.01)}
    ds/->dataset
    (ds/column-map :y identity [:x]))

Error printing return value (IndexOutOfBoundsException) at ham_fisted.Ranges$DoubleRange/lgetDouble (Ranges.java:186).
Index out of range: 100 size: 100

Zulip discussion: #tech.ml.dataset.dev>a strange bug with a range column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant