Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AmandaBirmingham committed May 24, 2024
1 parent 1a41373 commit 277fffc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion qiimp/src/metadata_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
194 changes: 0 additions & 194 deletions qiimp/tests/test_metadata_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# }
# }
# }
# }
# }
# }
# }

0 comments on commit 277fffc

Please sign in to comment.