Skip to content
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

Fetch boolean data from h5grove as binary #1709

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Fetch boolean data from h5grove as binary #1709

merged 1 commit into from
Sep 13, 2024

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Sep 9, 2024

Follows #1692

Requires h5web@2.3.0, which I've just released. I've also updated the demo server on Bosquet.

I'll add client-side code to support datatypes in my next PR.


import type { DataProviderApi } from './api';

export const CANCELLED_ERROR_MSG = 'Request cancelled';

export function typedArrayFromDType(dtype: DType) {
if (isEnumType(dtype)) {
if (isEnumType(dtype) || isBoolType(dtype)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the dumb question: isn't bool a particular type of enum ? So that isEnumType should encompass bool ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We split the two in our internal types and the purpose of these guards is to narrow our internal types. We need two separate types so Primitive<BooleanType> can resolve to number | boolean. But we may be able to reconsider this choice with #1679 (comment)

@axelboc axelboc merged commit 18f038a into main Sep 13, 2024
8 checks passed
@axelboc axelboc deleted the h5grove-bool branch September 13, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants