Skip to content

Conversation

@bendichter
Copy link
Contributor

Add new check that ensures subject weight follows the form '[numeric] [unit]' (e.g., '2.3 kg' or '25kg'). Without a unit, the weight is ambiguous.

  • Add weight_form_regex pattern for validation
  • Register check with CRITICAL importance
  • Add unit tests for valid/invalid weight formats

Closes #370

Add new check that ensures subject weight follows the form
'[numeric] [unit]' (e.g., '2.3 kg' or '25kg'). Without a unit,
the weight is ambiguous.

- Add weight_form_regex pattern for validation
- Register check with CRITICAL importance
- Add unit tests for valid/invalid weight formats

Closes #370
Add documentation for the subject weight field format requirement.
The weight should follow '[numeric] [unit]' format (e.g., '2.3 kg')
to avoid ambiguity. References the check_subject_weight validation
function.
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.40%. Comparing base (59ef74b) to head (5048afb).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #647      +/-   ##
==========================================
+ Coverage   77.41%   80.40%   +2.99%     
==========================================
  Files          47       47              
  Lines        1656     1664       +8     
==========================================
+ Hits         1282     1338      +56     
+ Misses        374      326      -48     
Files with missing lines Coverage Δ
src/nwbinspector/checks/__init__.py 100.00% <ø> (ø)
src/nwbinspector/checks/_nwbfile_metadata.py 96.17% <100.00%> (+0.17%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Add Check]: Subject weight should have form "[numeric] [string]"

3 participants