-
Notifications
You must be signed in to change notification settings - Fork 0
feat: v0.3.0-alpha feedback #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
d5c651e
ff62264
179391d
c5cedcc
0bc3748
28a3844
27fd836
593bc39
f77da68
8f5d1e2
db76858
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -235,13 +235,14 @@ def _process_histogram_file(file_path: Path) -> list[HistogramResult]: | |
| ] | ||
|
|
||
|
|
||
| def compute_histograms(x: np.ndarray) -> list[HistogramResult]: | ||
| def compute_histograms(x: NDArray[np.float64]) -> list[HistogramResult]: | ||
| """Compute optimal histogram of an array using khisto CLI binary input. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| x : np.ndarray | ||
| Array of numeric values. | ||
| x : NDArray[np.float64] | ||
| Array of numeric values. Only 1-dimensional arrays are supported. | ||
| Missing values (NaN) are filtered out. | ||
|
|
||
| Returns | ||
| ------- | ||
|
|
@@ -257,10 +258,14 @@ def compute_histograms(x: np.ndarray) -> list[HistogramResult]: | |
| If input array is empty after filtering. | ||
| """ | ||
| x = np.asarray(x, dtype=np.float64) | ||
|
|
||
| if len(x) == 0: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use the NumPy ndarray API here:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| raise ValueError("Input array is empty") | ||
|
|
||
| x = x[~np.isnan(x)] | ||
|
|
||
| if len(x) == 0: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idem,
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| raise ValueError("Input array is empty after filtering") | ||
| raise ValueError("Input array is empty after filtering missing values") | ||
|
|
||
| # Use delete=False so the files are closed before the subprocess reads them. | ||
| # On Windows, files keep an exclusive lock while open, whence, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.