cnuernber / dtype-next

A Clojure library designed to aid in the implementation of high performance algorithms and systems.
Other
328 stars 19 forks source link

Docs for `dt-struct/map->struct!` and `dt-struct/map->struct` #110

Open phronmophobic opened 14 hours ago

phronmophobic commented 14 hours ago

These struct helpers seem really useful.

Also, I'm not sure if makes sense, but I think a 2 arity version of map->struct would be helpful:

(defn map->struct
  ([dtype data]
   (map->struct dtype data :gc))
  ([dtype data track-type]
   (map->struct! data (new-struct dtype {:container-type :native-heap
                                         :resource-type track-type}))))

If not, then I would suggest that the doc string also document the relevant values for :resource-type. Otherwise, you have to follow read the doc strings for dt-struct/new-struct, native-buffer/malloc, and tech.v3.resource/track.

phronmophobic commented 14 hours ago

See https://github.com/cnuernber/dtype-next/pull/111