You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing @staticmethod on convert_milliseconds_to_seconds silently corrupts BIDS metadata extraction #9
convert_milliseconds_to_seconds is missing the @staticmethod decorator, while its sibling convert_to_milliseconds has it. When called from a class instance (e.g., BaseSequence._extract_common_metadata), Python passes the instance as the first positional argument (values), silently corrupting the conversion.
Reproduction (on main branch)
Script
frompyaslreport.utils.unit_conversion_utilsimportUnitConverterUtils# Test 1: Class-level callr=UnitConverterUtils.convert_milliseconds_to_seconds(15.0) # works by accident# Test 2: Instance-level call (how BaseSequence uses it)r=UnitConverterUtils().convert_milliseconds_to_seconds(15.0) # self consumed as values# Test 3: Introspectiond=UnitConverterUtils.__dict__isinstance(d['convert_milliseconds_to_seconds'], staticmethod) # False — BUG
Results on main branch
#
Test
Status
Detail
1
Class-level call
PASS
Works by accident (no self when called on class)
2
Instance-level call
FAIL
self consumed as values param, real arg ignored
3
@staticmethod present
FAIL
Decorator missing from convert_milliseconds_to_seconds
Summary: PASSED=1, FAILED=2
I have worked on this. This is just the issues i made in your private repo. Now, it is part of OSIPI, I will make the report the issues again here and make the PR in this repo.
Activity
fix: add missing @staticmethod to convert_milliseconds_to_seconds (Fixes