From 2127919cc311b30c3bff6cb621f518a7b2103712 Mon Sep 17 00:00:00 2001 From: ghammad Date: Tue, 25 Apr 2023 14:27:48 +0200 Subject: [PATCH 1/6] Add possibility to have numerical char in BBA filename and non-abs filepath in json --- pyActigraphy/io/bba/bba.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyActigraphy/io/bba/bba.py b/pyActigraphy/io/bba/bba.py index 1d2a66b9..94ec2f91 100644 --- a/pyActigraphy/io/bba/bba.py +++ b/pyActigraphy/io/bba/bba.py @@ -274,7 +274,7 @@ def __read_baa_metadata_json(input_fname, metadata_fname): # - INPUT DATA: input_fname = 'basename'-timeSeries.csv[.gz] match_basename = re.match( - pattern=r'^(\w*)-timeSeries.csv(\.gz)?', + pattern=r'^(.+?)-timeSeries.csv(\.gz)?', string=os.path.basename(input_fname) ) if match_basename: @@ -287,7 +287,7 @@ def __read_baa_metadata_json(input_fname, metadata_fname): if not re.match( pattern=r'{}.(cwa|CWA)(\.gz)?'.format(input_basename), - string=meta_data['file-name'] + string=os.path.basename(meta_data['file-name']) ): raise ValueError( 'Attempting to read a metadata file referring to another ' From 4c968160812789de171023159bc9e8c0dbaf1a0b Mon Sep 17 00:00:00 2001 From: ghammad Date: Tue, 25 Apr 2023 16:05:48 +0200 Subject: [PATCH 2/6] Upper case the AWD UUID device type character --- pyActigraphy/io/awd/awd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyActigraphy/io/awd/awd.py b/pyActigraphy/io/awd/awd.py index 9228dbbe..da30d39f 100644 --- a/pyActigraphy/io/awd/awd.py +++ b/pyActigraphy/io/awd/awd.py @@ -217,7 +217,7 @@ def __extract_awd_model(uuid): ) match = re.match(pattern=r'^([A-Za-z])[0-9a-fA-F]+', string=uuid) if match: # check if UUID matches the expected pattern - dcode = match.groups()[0] + dcode = match.groups()[0].upper() if dcode in RawAWD.device_code.keys(): return dcode else: From 232880e944baf56d8fe3c14dd6fddb81740ef946 Mon Sep 17 00:00:00 2001 From: ghammad Date: Wed, 26 Apr 2023 09:46:40 +0200 Subject: [PATCH 3/6] Add support for BBA and MESA in batch reader --- pyActigraphy/io/reader/reader.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pyActigraphy/io/reader/reader.py b/pyActigraphy/io/reader/reader.py index 2246a455..16b3406f 100644 --- a/pyActigraphy/io/reader/reader.py +++ b/pyActigraphy/io/reader/reader.py @@ -9,7 +9,9 @@ from ..agd import read_raw_agd from ..atr import read_raw_atr from ..awd import read_raw_awd +from ..bba import read_raw_bba from ..dqt import read_raw_dqt +from ..mesa import read_raw_mesa from ..mtn import read_raw_mtn from ..rpx import read_raw_rpx from ..tal import read_raw_tal @@ -231,8 +233,10 @@ def read_raw( * AGD ((w)GT3X(+)), ActiGraph) * ATR (ActTrust, Condor Instruments) - * AWD (ActiWatch 4, CamNtech) + * AWD (ActiWatch 4/7/L/L-Plus/T, CamNtech) + * BBA (Biobankaccelerometer) * DQT (Daqtometers, Daqtix) + * MESA (MESA dataset, NSRR) * MTN (MotionWatch8, CamNtech) * RPX (Actiwatch, Respironics) * TAL (Tempatilumi, CE Brasil) @@ -257,7 +261,9 @@ def read_raw( An object containing raw data """ - supported_types = ['AGD', 'ATR', 'AWD', 'DQT', 'MTN', 'RPX', 'TAL'] + supported_types = [ + 'AGD', 'ATR', 'AWD', 'BBA', 'DQT', 'MESA', 'MTN', 'RPX', 'TAL' + ] if reader_type not in supported_types: raise ValueError( 'Type {0} unsupported. Supported types: {1}'.format( @@ -284,9 +290,15 @@ def parallel_reader( 'AWD': lambda files: parallel_reader( n_jobs, read_raw_awd, files, prefer, verbose, **kwargs ), + 'BBA': lambda files: parallel_reader( + n_jobs, read_raw_bba, files, prefer, verbose, **kwargs + ), 'DQT': lambda files: parallel_reader( n_jobs, read_raw_dqt, files, prefer, verbose, **kwargs ), + 'MESA': lambda files: parallel_reader( + n_jobs, read_raw_mesa, files, prefer, verbose, **kwargs + ), 'MTN': lambda files: parallel_reader( n_jobs, read_raw_mtn, files, prefer, verbose, **kwargs ), From cba1f329fe71647d469d1aeb7a57f7e8a67ef7a7 Mon Sep 17 00:00:00 2001 From: ghammad Date: Wed, 26 Apr 2023 09:49:34 +0200 Subject: [PATCH 4/6] Add ref to BBA, MESA and TAL reader in intro nb --- docs/source/pyActigraphy-Intro.ipynb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/source/pyActigraphy-Intro.ipynb b/docs/source/pyActigraphy-Intro.ipynb index 235dee01..94a4f9c6 100644 --- a/docs/source/pyActigraphy-Intro.ipynb +++ b/docs/source/pyActigraphy-Intro.ipynb @@ -78,9 +78,12 @@ "* agd (Actigraph)\n", "* atr (ActTrust)\n", "* awd (Actiwatch)\n", + "* bba (Axivity or GeneActiv via the Biobankaccelerometer package)\n", "* dqt (DaqTix)\n", + "* mesa (MESA dataset, hosted by the NSRR)\n", "* mtn (MotionWatch8)\n", - "* rpx (Respironics)\n" + "* rpx (Respironics)\n", + "* tal (Tempatilumi)\n" ] }, { @@ -92,9 +95,12 @@ "* read_raw_agd\n", "* read_raw_atr\n", "* read_raw_awd\n", + "* read_raw_bba\n", "* read_raw_dqt\n", + "* read_raw_mesa\n", "* read_raw_mtn\n", - "* read_raw_rpx\n" + "* read_raw_rpx\n", + "* read_raw_tal\n" ] }, { From 93c6e2090371b83fbf2414876cd308981f7f9fba Mon Sep 17 00:00:00 2001 From: ghammad Date: Wed, 26 Apr 2023 09:51:13 +0200 Subject: [PATCH 5/6] Add change log for v1.2.1 --- docs/source/changelog.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 28f125fb..2e3d8639 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -8,6 +8,17 @@ What's new ************* +v1.2.1 ("No worries", April 2023) +------------------------------------------- + +This release aims to fix: + +* Biobank Accelerometer Analysis file format: support file paths containing numerical characters and/or whitespaces; +* Actiwatch (CamNtech) file format: fix `issue #123 `_ by upper casing the UUID. +* Batch reader: add missing types, 'BBA' and 'MESA'. + +************* + v1.2 ("Let's go 3D", March 2023) ------------------------------------------- From 98c545e689deddc961a92ce7b112cc221690ffc5 Mon Sep 17 00:00:00 2001 From: ghammad Date: Wed, 26 Apr 2023 09:52:01 +0200 Subject: [PATCH 6/6] Bump version to v1.2.1 --- pyActigraphy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyActigraphy/__init__.py b/pyActigraphy/__init__.py index 2e7dc6b4..af60767a 100644 --- a/pyActigraphy/__init__.py +++ b/pyActigraphy/__init__.py @@ -41,4 +41,4 @@ "viz" ] -__version__ = '1.2' +__version__ = '1.2.1'