Skip to content

Commit 05df365

Browse files
committed
Smaller fixes to use correct protocols.
1 parent 9ab4ff1 commit 05df365

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

src/tech/v3/dataset/dynamic_int_list.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"An int-list implementation that resizes its backing store as it is required to hold
33
wider data."
44
(:require [tech.v3.datatype.protocols :as dtype-proto]
5+
[tech.v3.datatype.hamf-proto :as dtype-hamf-proto]
56
[tech.v3.datatype :as dtype]
67
[tech.v3.datatype.base :as dtype-base]
78
[tech.v3.datatype.errors :as errors]
@@ -44,7 +45,7 @@
4445
(->native-buffer [_item]
4546
(dtype-proto/->native-buffer backing-store))
4647
LongBuffer
47-
(elemwiseDatatype [_this] (dtype-proto/elemwise-datatype backing-store))
48+
(elemwiseDatatype [_this] (dtype/elemwise-datatype backing-store))
4849
(clear [this]
4950
(set! backing-store (abuf/as-growable-list (dtype/make-list :int8 1500) 0))
5051
(set! int-width 8))

src/tech/v3/dataset/impl/column.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@
421421
(invoke [this idx def-val] (.invoke (cached-buffer!) idx def-val))
422422
(meta [this] (assoc metadata
423423
:datatype (dtype-hamf-proto/elemwise-datatype this)
424-
:n-elems (dtype-proto/ecount this)))
424+
:n-elems (.size this)))
425425
(withMeta [_this new-meta] (Column. missing
426426
data
427427
new-meta

src/tech/v3/dataset/protocols.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns tech.v3.dataset.protocols
22
(:require [tech.v3.datatype.protocols :as dtype-proto]
3-
[ham-fisted.protocols :as hamf-proto])
3+
[ham-fisted.protocols :as hamf-proto]
4+
[tech.v3.datatype :as dtype])
45
(:import [org.roaringbitmap RoaringBitmap]
56
[tech.v3.datatype Buffer]
67
[clojure.lang IDeref])
@@ -74,7 +75,7 @@
7475
PColumn
7576
(is-column? [item] false)
7677
PRowCount
77-
(row-count [this] (dtype-proto/ecount this))
78+
(row-count [this] (dtype/ecount this))
7879
PColumnCount
7980
(column-count [this] 0)
8081
PMissing

src/tech/v3/libs/fastexcel.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
```"
2121
(:require [tech.v3.io :as io]
2222
[tech.v3.datatype.protocols :as dtype-proto]
23+
[tech.v3.datatype.hamf-proto :as dtype-hamf-proto]
2324
[tech.v3.datatype :as dtype]
2425
[tech.v3.datatype.errors :as errors]
2526
[tech.v3.dataset.io.spreadsheet :as parse-spreadsheet]
@@ -59,7 +60,7 @@
5960
(defn- wrap-cell
6061
[^Cell cell]
6162
(reify
62-
dtype-proto/PElemwiseDatatype
63+
dtype-hamf-proto/PElemwiseDatatype
6364
(elemwise-datatype [this]
6465
(let [cell-type (.getType cell)]
6566
(if (formula-type? cell-type)
@@ -73,7 +74,7 @@
7374
(value [this]
7475
(if (formula-type? (.getType cell))
7576
(try-parse-double cell)
76-
(case (dtype-proto/elemwise-datatype this)
77+
(case (dtype/elemwise-datatype this)
7778
:none nil
7879
:string (.getRawValue cell)
7980
:boolean (.asBoolean cell)

src/tech/v3/libs/poi.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
(:require [tech.v3.io :as io]
1919
[tech.v3.datatype :as dtype]
2020
[tech.v3.datatype.protocols :as dtype-proto]
21+
[tech.v3.datatype.hamf-proto :as dtype-hamf-proto]
2122
[tech.v3.datatype.errors :as errors]
2223
[tech.v3.datatype.datetime :as dtype-dt]
2324
[tech.v3.dataset.io.spreadsheet :as parse-spreadsheet]
@@ -47,7 +48,7 @@
4748
(defn- wrap-cell
4849
[^Cell cell]
4950
(reify
50-
dtype-proto/PElemwiseDatatype
51+
dtype-hamf-proto/PElemwiseDatatype
5152
(elemwise-datatype [this]
5253
(let [cell-type (.getCellType cell)]
5354
(if (or (= cell-type CellType/FORMULA)
@@ -62,7 +63,7 @@
6263
(getColumnNum [this] (.. cell getAddress getColumn))
6364
(missing [this] (identical? :none (dtype/get-datatype this)))
6465
(value [this]
65-
(case (dtype-proto/elemwise-datatype this)
66+
(case (dtype/elemwise-datatype this)
6667
:none nil
6768
:string (.getStringCellValue cell)
6869
:boolean (.getBooleanCellValue cell)

0 commit comments

Comments
 (0)