mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 11:48:12 +08:00
add array type foundations (#2376)
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
import { IdentityInt32Index, isLabelIndex } from "./labelIndex";
|
||||
// weird cross-dependency that we should clean up someday...
|
||||
import {
|
||||
isTypedArray,
|
||||
isArrayOrTypedArray,
|
||||
callOnceLazy,
|
||||
memoize,
|
||||
__getMemoId,
|
||||
} from "./util";
|
||||
import { callOnceLazy, memoize, __getMemoId } from "./util";
|
||||
import { isTypedArray, isAnyArray } from "../../common/types/arraytypes";
|
||||
import {
|
||||
summarizeContinuous,
|
||||
summarizeCategorical as _summarizeCategorical,
|
||||
@@ -163,7 +158,7 @@ class Dataframe {
|
||||
if (!Array.isArray(columnarData)) {
|
||||
throw new TypeError("Dataframe constructor requires array of columns");
|
||||
}
|
||||
if (!columnarData.every((c) => isArrayOrTypedArray(c))) {
|
||||
if (!columnarData.every((c) => isAnyArray(c))) {
|
||||
throw new TypeError("Dataframe columns must all be Array or TypedArray");
|
||||
}
|
||||
if (!isLabelIndex(rowIndex)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
Dataframe histogram
|
||||
*/
|
||||
import { isTypedArray } from "./util";
|
||||
import { isTypedArray } from "../../common/types/arraytypes";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||
function _histogramContinuous(column: any, bins: any, min: any, max: any) {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Private utility code for dataframe
|
||||
*/
|
||||
|
||||
export { isTypedArray, isArrayOrTypedArray } from "../typeHelpers";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||
export function callOnceLazy(f: any) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user