Skip to content

Commit

Permalink
Rename APIs for feature density stats and quantitative stats (#3618)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin authored Apr 11, 2023
1 parent 12fad84 commit 29e641f
Show file tree
Hide file tree
Showing 46 changed files with 820 additions and 707 deletions.
15 changes: 5 additions & 10 deletions packages/core/TextSearch/TextSearchManager.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import BaseResult from './BaseResults'
import PluginManager from '../PluginManager'
import QuickLRU from '../util/QuickLRU'
import { SearchType, BaseTextSearchAdapter } from '../data_adapters/BaseAdapter'
import {
BaseTextSearchAdapter,
BaseTextSearchArgs,
} from '../data_adapters/BaseAdapter'
import { readConfObject, AnyConfigurationModel } from '../configuration'

export interface BaseArgs {
queryString: string
searchType?: SearchType
signal?: AbortSignal
limit?: number
pageNumber?: number
}

export interface SearchScope {
includeAggregateIndexes: boolean
assemblyName: string
Expand Down Expand Up @@ -91,7 +86,7 @@ export default class TextSearchManager {
* limit of results to return, searchType...prefix | full | exact", etc.
*/
async search(
args: BaseArgs,
args: BaseTextSearchArgs,
searchScope: SearchScope,
rankFn: (results: BaseResult[]) => BaseResult[],
) {
Expand Down
11 changes: 4 additions & 7 deletions packages/core/assemblyManager/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import AbortablePromiseCache from 'abortable-promise-cache'
// locals
import { getConf, AnyConfigurationModel } from '../configuration'
import {
BaseOptions,
BaseRefNameAliasAdapter,
RegionsAdapter,
} from '../data_adapters/BaseAdapter'
Expand Down Expand Up @@ -111,12 +112,6 @@ function getAdapterId(adapterConf: unknown) {

type RefNameAliases = Record<string, string>

export interface BaseOptions {
signal?: AbortSignal
sessionId: string
statusCallback?: Function
}

interface CacheData {
adapterConf: unknown
self: Assembly
Expand Down Expand Up @@ -148,10 +143,12 @@ export default function assemblyFactory(
) {
const adapterLoads = new AbortablePromiseCache<CacheData, RefNameMap>({
cache: new QuickLRU({ maxSize: 1000 }),

// @ts-expect-error
async fill(
args: CacheData,
signal?: AbortSignal,
statusCallback?: Function,
statusCallback?: (arg: string) => void,
) {
const { adapterConf, self, options } = args
return loadRefNameMap(
Expand Down
Loading

0 comments on commit 29e641f

Please sign in to comment.