mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 07:28:12 +08:00
temp fixes for TS lint (#2352)
This commit is contained in:
@@ -12,6 +12,7 @@ import * as viewActions from "./viewStack";
|
|||||||
import * as embActions from "./embedding";
|
import * as embActions from "./embedding";
|
||||||
import * as genesetActions from "./geneset";
|
import * as genesetActions from "./geneset";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||||
function setGlobalConfig(config: any) {
|
function setGlobalConfig(config: any) {
|
||||||
/**
|
/**
|
||||||
* Set any global run-time config not _exclusively_ managed by the config reducer.
|
* Set any global run-time config not _exclusively_ managed by the config reducer.
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
|
|||||||
result.colIndex.labels()
|
result.colIndex.labels()
|
||||||
);
|
);
|
||||||
|
|
||||||
result = normalizeResponse(field, query, this.schema, result);
|
result = normalizeResponse(field, this.schema, result);
|
||||||
|
|
||||||
return [whereCacheUpdate, result];
|
return [whereCacheUpdate, result];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,12 @@ import {
|
|||||||
} from "../globals";
|
} from "../globals";
|
||||||
import { Dataframe } from "../util/dataframe";
|
import { Dataframe } from "../util/dataframe";
|
||||||
|
|
||||||
// @ts-expect-error ts-migrate(7006)
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
export function normalizeResponse(field, query, schema, response) {
|
export function normalizeResponse(
|
||||||
|
field: string,
|
||||||
|
schema: any, // eslint-disable-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
|
response: Dataframe
|
||||||
|
): Dataframe {
|
||||||
/**
|
/**
|
||||||
* There are a number of assumptions in the front-end about data typing and data
|
* There are a number of assumptions in the front-end about data typing and data
|
||||||
* characteristics. This routine will normalize a server response dataframe
|
* characteristics. This routine will normalize a server response dataframe
|
||||||
@@ -61,6 +65,7 @@ export function normalizeResponse(field, query, schema, response) {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
function castColumnToBoolean(df: Dataframe, label: any): Dataframe {
|
function castColumnToBoolean(df: Dataframe, label: any): Dataframe {
|
||||||
const colData = df.col(label).asArray();
|
const colData = df.col(label).asArray();
|
||||||
const newColData = new Array(colData.length);
|
const newColData = new Array(colData.length);
|
||||||
@@ -69,6 +74,7 @@ function castColumnToBoolean(df: Dataframe, label: any): Dataframe {
|
|||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
export function normalizeWritableCategoricalSchema(colSchema: any, col: any) {
|
export function normalizeWritableCategoricalSchema(colSchema: any, col: any) {
|
||||||
/*
|
/*
|
||||||
Ensure all enum writable / categorical schema have a categories array, that
|
Ensure all enum writable / categorical schema have a categories array, that
|
||||||
@@ -85,10 +91,11 @@ export function normalizeWritableCategoricalSchema(colSchema: any, col: any) {
|
|||||||
return colSchema;
|
return colSchema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
export function normalizeCategorical(
|
export function normalizeCategorical(
|
||||||
df: Dataframe,
|
df: Dataframe,
|
||||||
colLabel: any,
|
colLabel: any, // eslint-disable-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
colSchema: any
|
colSchema: any // eslint-disable-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
) {
|
) {
|
||||||
/*
|
/*
|
||||||
If writable, ensure schema matches data and we have an unassigned label
|
If writable, ensure schema matches data and we have an unassigned label
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
Private helper functions related to schema
|
Private helper functions related to schema
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
export function _getColumnSchema(schema: any, field: any, col: any) {
|
export function _getColumnSchema(schema: any, field: any, col: any) {
|
||||||
/* look up the column definition */
|
/* look up the column definition */
|
||||||
switch (field) {
|
switch (field) {
|
||||||
@@ -23,11 +24,13 @@ export function _getColumnSchema(schema: any, field: any, col: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function _isIndex(schema: any, field: any, col: any): bool {
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
|
export function _isIndex(schema: any, field: any, col: any): boolean {
|
||||||
const index = schema.annotations?.[field].index;
|
const index = schema.annotations?.[field].index;
|
||||||
return index && index === col;
|
return index && index === col;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||||
export function _getColumnDimensionNames(schema: any, field: any, col: any) {
|
export function _getColumnDimensionNames(schema: any, field: any, col: any) {
|
||||||
/*
|
/*
|
||||||
field/col may be an alias for multiple columns. Currently used to map ND
|
field/col may be an alias for multiple columns. Currently used to map ND
|
||||||
|
|||||||
@@ -18,11 +18,13 @@ function caseInsensitiveCompare(a: any, b: any) {
|
|||||||
return textA < textB ? -1 : textA > textB ? 1 : 0;
|
return textA < textB ? -1 : textA > textB ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||||
const catLabelSort = (isUserAnno: boolean, values: any[]): any[] => {
|
const catLabelSort = (isUserAnno: boolean, values: any[]): any[] => {
|
||||||
/* this sort could be memoized for perf */
|
/* this sort could be memoized for perf */
|
||||||
|
|
||||||
const strings: string[] = [];
|
const strings: string[] = [];
|
||||||
const ints: number[] = [];
|
const ints: number[] = [];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||||
const unassignedOrNaN: any = [];
|
const unassignedOrNaN: any = [];
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||||
@@ -42,6 +44,7 @@ const catLabelSort = (isUserAnno: boolean, values: any[]): any[] => {
|
|||||||
ints.sort((a, b) => +a - +b);
|
ints.sort((a, b) => +a - +b);
|
||||||
unassignedOrNaN.sort(caseInsensitiveCompare);
|
unassignedOrNaN.sort(caseInsensitiveCompare);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
|
||||||
return (<any>ints).concat(strings, unassignedOrNaN);
|
return (<any>ints).concat(strings, unassignedOrNaN);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export function createCategorySummaryFromDfCol(dfCol: any, colSchema: any) {
|
|||||||
const { categories: allCategoryValues } = colSchema;
|
const { categories: allCategoryValues } = colSchema;
|
||||||
const categoryValues = allCategoryValues;
|
const categoryValues = allCategoryValues;
|
||||||
const categoryValueCounts = allCategoryValues.map(
|
const categoryValueCounts = allCategoryValues.map(
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
||||||
(cat: any) => summary.categoryCounts.get(cat) ?? 0
|
(cat: any) => summary.categoryCounts.get(cat) ?? 0
|
||||||
);
|
);
|
||||||
const categoryValueIndices = new Map(
|
const categoryValueIndices = new Map(
|
||||||
|
|||||||
Reference in New Issue
Block a user