diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d6ed39c..28c61e1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - python-version: ['3.8'] #, '3.10'] + python-version: ['3.8', '3.10'] os: [ubuntu-latest] runs-on: ${{ matrix.os }} defaults: diff --git a/qiimp/src/metadata_transformers.py b/qiimp/src/metadata_transformers.py index f0a84e3..327c233 100644 --- a/qiimp/src/metadata_transformers.py +++ b/qiimp/src/metadata_transformers.py @@ -58,7 +58,7 @@ def format_a_datetime(row, source_fields): else: try: strftimeable_x = parser.parse(x) - except: + except: # noqa: E722 raise ValueError(f"{source_fields[0]} cannot be parsed to a date") formatted_x = strftimeable_x.strftime('%Y-%m-%d %H:%M') diff --git a/qiimp/tests/test_metadata_configurator.py b/qiimp/tests/test_metadata_configurator.py index 60a2df5..af5877e 100644 --- a/qiimp/tests/test_metadata_configurator.py +++ b/qiimp/tests/test_metadata_configurator.py @@ -763,197 +763,3 @@ def test_flatten_nested_stds_dict(self): self.assertDictEqual( self.FLATTENED_STDS_W_STUDY_DICT["host_type_specific_metadata"], out_flattened_dict) - - # stds_nested_input = { - # "host_type_specific_metadata": { - # "host_associated": { - # "metadata_fields": { - # # not overridden - # "country": { - # "allowed": ["USA"], - # "default": "USA", - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # }, - # # overridden in stds sample type specific metadata - # "description": { - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # }, - # # overridden in study lower host - # "dna_extracted": { - # "allowed": ["true", "false"], - # "default": "true", - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # }, - # # overridden in stds lower host + sample type - # "elevation": { - # "anyof": [ - # { - # "allowed": [ - # "not collected", - # "not provided", - # "restricted access"], - # "type": "string" - # }, - # { - # "min": -413.0, - # "type": "number" - # }], - # "empty": False, - # "is_phi": False, - # "required": True - # }, - # # overridden in study for this host - # "geo_loc_name": { - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # }, - # # overridden in stds lower host - # "host_type": { - # "allowed": ["human", "non-human"], - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # } - # }, - # "sample_type_specific_metadata": { - # "stool": { - # "metadata_fields": { - # # override of std host - # "description": { - # "allowed": ["stool"], - # "default": "stool", - # "type": "string" - # }, - # # overridden BY study host + sample type - # "physical_specimen_location": { - # "allowed": ["UCSD"], - # "default": "UCSD", - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # }, - # # overridden BY study lower host + sample type - # "physical_specimen_remaining": { - # "allowed": ["true", "false"], - # "default": "true", - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # } - # } - # } - # }, - # "host_type_specific_metadata": { - # "human": { - # "metadata_fields": { - # # note: this overrides the standard for parent - # # host type BUT the study host type at this - # # level overrides THIS, and the study is - # # more specific than the standards; since - # # more specific always wins, this will NOT be - # # included in the output - # "dna_extracted": { - # "allowed": ["false"], - # "default": "false", - # "type": "string" - # }, - # # override of parent std host - # "host_type": { - # "allowed": ["human"], - # "default": "human", - # "type": "string" - # } - # }, - # "sample_type_specific_metadata": { - # "stool": { - # "metadata_fields": { - # # override of parent std host - # "elevation": { - # "default": 14, - # "type": "number" - # } - # } - # } - # } - # } - # } - # } - # } - # } - # - # flat_input = { - # "host_type_specific_metadata": { - # # FLAT list of host types - # "host_associated": { - # "metadata_fields": { - # # override of standard for this host type - # "geo_loc_name": { - # "allowed": ["USA:CA:San Diego"], - # "default": "USA:CA:San Diego", - # "type": "string" - # }, - # # note: this overrides the standard for this host type - # # BUT the std lower host type overrides this, - # # and the lowest (most specific) directive wins, - # # so this will NOT be included in output - # "host_type": { - # "allowed": ["dog", "cat"], - # "type": "string" - # }, - # }, - # "sample_type_specific_metadata": { - # "stool": { - # "metadata_fields": { - # # override of standard for this - # # host + sample type - # "physical_specimen_location": { - # "allowed": ["UCSDMI"], - # "default": "UCSDMI", - # "type": "string" - # } - # } - # } - # } - # }, - # "human": { - # "metadata_fields": { - # # overrides std parent host type - # "dna_extracted": { - # "allowed": ["true"], - # "default": "true", - # "type": "string" - # }, - # }, - # "sample_type_specific_metadata": { - # "stool": { - # "metadata_fields": { - # # override of std parent - # # host + sample type - # "physical_specimen_remaining": { - # "allowed": ["false"], - # "default": "false", - # "empty": False, - # "is_phi": False, - # "required": True, - # "type": "string" - # } - # } - # } - # } - # } - # } - # } \ No newline at end of file