Repository navigation
fix: small robustness fixes in sync, fnirs and xdf - #316
Merged
Merged
Conversation
An optional package that is installed but fails to import (torch, numba, cupy, Metal) no longer makes hypyp fail to import: the backend is disabled with a warning that gives the original error. get_metric accepts envelope_corr, pow_corr and imaginary_coh as compute_sync does. The hints for a missing numba or torch give the pip extras instead of a poetry command that no longer exists. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Study() no longer shares its default list of dyads between objects. Recording.load_raw gives the intended random label to a Raw without subject_info or without his_id. Study.compute_wtcs_shuffle accepts with_intra. XDFImport raises ValueError for an unknown stream id and recognises a numpy integer as a stream id. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
Study() keeps its shared default list for now: giving each study its own list changes what a second Study() computes, so it belongs to 0.7.0. compute_wtcs_shuffle accepts only the redundant with_intra=False and still refuses True. get_metric looks a name up in METRICS before trying the aliases, so a metric registered under an alias name is still returned. The probes of the optional packages tell an absent package, skipped silently, from an installed one that fails to load, which now warns whatever the exception, ImportError included. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rs-xdf-sync # Conflicts: # CHANGELOG.md
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Six small defects found by the October audit. Each replaces a crash or a wrong message; no call that worked before returns a different value.
hypyp/syncimport hypyp.analysesfailed when the import of torch, numba, cupy or the Metal bindings raised anything other thanImportError, for example theOSErrorof a missing shared library. The four probes now tell an absent package, skipped silently as before, from an installed one that fails to load, which disables the backend with a warning giving the original error. An installed package that failed with anImportErrorwas skipped silently and now gets that warning too. A package that imports but is broken further down is not covered.get_metricrejectedenvelope_corr,pow_corrandimaginary_coh, whichcompute_syncaccepts. The mapping ishypyp.sync.METRIC_ALIASES; a name registered inMETRICStakes precedence over an alias.poetry install --with optim_*, which no longer exists; they give the pip extras.hypyp/fnirsRecording.load_rawraisedTypeErroron aRawwithoutsubject_info(anyRawArray) andKeyErrorwhenhis_idwas absent; the random label that the next lines intended is now reached.Study.compute_wtcs_shuffleraisedTypeErrorwhen givenwith_intra=False, since it passes that argument itself. The redundantFalseis accepted, so the keyword arguments ofcompute_wtcscan be reused.with_intra=Trueis still refused.hypyp/xdfXDFImport(select_matches=[id])raised a bareKeyErrorfor an unknown integer id and treated a numpy integer as a stream name. An unknown id raises the sameValueErroras an unknown name, and a numpy integer is an id.Measured
master(which now holds fix: clear errors instead of crashes in analyses, stats and utils #315): 388 passed, 12 skipped, 0 failed.44a666d): 391 passed, 9 skipped, 0 failed, and the backend each of the nine metrics resolves to, for eight kinds of request, is identical to whatmastergave before this pull request.Withdrawn after review
Study()uses a mutable default, so two studies created without arguments share one list of dyads. Giving each its own list changes what the second study computes, so the repair is kept for 0.7.0.Left out on purpose
compute_synckeeps its own copy of the alias table in this pull request, to avoid a conflict with #315, which edits the same lines. The new tests oftest_fnirs.pyandtest_xdf.pylive in modules that download sample data when collected, like the tests around them.🤖 Generated with Claude Code