-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding histogram_list and organizing _list code
- Loading branch information
Showing
8 changed files
with
293 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//@ts-check | ||
import { Arr, AxisArg, kwargs_decorator, frequently_used_parsers, asarray, ArrOrConst, Func_a_axis_keepdims } from "../array/kwargs"; | ||
import * as stats from "./statistics"; | ||
|
||
|
||
type NDArray_non_0D = Arr | number[]; | ||
|
||
// Used in statistics.ts: | ||
export namespace Func_a_q_axis { | ||
export type Implementation = (a: Arr, q: number, axis: number) => Arr; | ||
export type Kwargs = { a?: NDArray_non_0D, q?: number, axis?: AxisArg }; | ||
export type Wrapper = (a: NDArray_non_0D | Kwargs, q: number | Kwargs, axis?: AxisArg | Kwargs) => ArrOrConst; | ||
export const decorator = kwargs_decorator<Wrapper, Implementation>; | ||
export const defaults: [string, any][] = [["a", undefined], ["q", undefined], ["axis", null]]; | ||
export const parsers = [ | ||
frequently_used_parsers.a_axis_flatten, | ||
(kwargs) => { kwargs.q = asarray(kwargs.q); }, | ||
]; | ||
export const defaultDecorator = (implementation: Implementation) => decorator({ | ||
defaults, implementation, parsers | ||
}) | ||
} | ||
|
||
export const quantile = Func_a_q_axis.defaultDecorator(stats.quantile); | ||
export const nanquantile = Func_a_q_axis.defaultDecorator(stats.nanquantile); | ||
export const percentile = Func_a_q_axis.defaultDecorator(stats.percentile); | ||
export const nanpercentile = Func_a_q_axis.defaultDecorator(stats.nanpercentile); | ||
export const median = Func_a_axis_keepdims.defaultDecorator(stats.median); | ||
export const nanmedian = Func_a_axis_keepdims.defaultDecorator(stats.nanmedian); |
Oops, something went wrong.