From 30ea4b6d1e3d1430a71ed62b1c3618acb48696e3 Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:53:10 -0500 Subject: [PATCH] Minor corrections to tests --- hed/schema/schema_io/df_util.py | 4 ---- hed/schema/schema_io/ontology_util.py | 4 ---- tests/models/test_hed_string.py | 4 ---- tests/tools/analysis/test_annotation_util.py | 24 -------------------- tests/validator/test_def_validator.py | 4 ---- tests/validator/test_tag_validator.py | 9 -------- 6 files changed, 49 deletions(-) diff --git a/hed/schema/schema_io/df_util.py b/hed/schema/schema_io/df_util.py index ba0d8f49..0f4927a6 100644 --- a/hed/schema/schema_io/df_util.py +++ b/hed/schema/schema_io/df_util.py @@ -182,8 +182,4 @@ def get_attributes_from_row(row): if constants.subclass_of in row.index and row[constants.subclass_of] == "HedHeader": header_attributes, _ = _parse_header_attributes_line(attr_string) return header_attributes -<<<<<<< HEAD return parse_attribute_string(attr_string) -======= - return parse_attribute_string(attr_string) ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 diff --git a/hed/schema/schema_io/ontology_util.py b/hed/schema/schema_io/ontology_util.py index c7de7fdf..28c05d5d 100644 --- a/hed/schema/schema_io/ontology_util.py +++ b/hed/schema/schema_io/ontology_util.py @@ -163,11 +163,7 @@ def _verify_hedid_matches(section, df, unused_tag_ids): if id_int not in unused_tag_ids: hedid_errors += schema_util.format_error( row_number, row, f"'{label}' has id {id_int} which is outside " + -<<<<<<< HEAD "of the valid range for this type. Valid range is: " + -======= - f"of the valid range for this type. Valid range is: " + ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 f"{min(unused_tag_ids)} to {max(unused_tag_ids)}") continue except ValueError: diff --git a/tests/models/test_hed_string.py b/tests/models/test_hed_string.py index dd2b91a9..fba92013 100644 --- a/tests/models/test_hed_string.py +++ b/tests/models/test_hed_string.py @@ -8,11 +8,7 @@ class TestHedStrings(unittest.TestCase): @classmethod def setUpClass(cls): cls.schema = load_schema_version("8.3.0") -<<<<<<< HEAD -======= - ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 def validator_scalar(self, test_strings, expected_results, test_function): for test_key in test_strings: test_result = test_function(test_strings[test_key]) diff --git a/tests/tools/analysis/test_annotation_util.py b/tests/tools/analysis/test_annotation_util.py index 8037eb7f..b6cbdfa9 100644 --- a/tests/tools/analysis/test_annotation_util.py +++ b/tests/tools/analysis/test_annotation_util.py @@ -295,30 +295,6 @@ def test_merge_hed_dict_full(self): annotation_util.merge_hed_dict(example_sidecar, spreadsheet_sidecar) self.assertEqual(6, len(example_sidecar), 'merge_hed_dict merges with the correct length') -<<<<<<< HEAD -======= - def test_to_factor(self): - series1 = Series([1.0, 2.0, 3.0, 4.0]) - factor1 = annotation_util.to_factor(series1) - self.assertEqual(len(series1), len(factor1)) - self.assertEqual(sum(factor1), len(factor1)) - series2 = Series(['a', '', None, np.nan, 'n/a']) - factor2 = annotation_util.to_factor(series2) - self.assertEqual(len(series2), len(factor2)) - self.assertEqual(sum(factor2), 1) - data = { - 'Name': ['Alice', '', 'n/a', 1.0], # Contains a space - 'Age': [25, np.nan, 35, 0] - } - df = DataFrame(data) - factor3 = annotation_util.to_factor(df, column='Name') - self.assertEqual(sum(factor3), 2) - factor4 = annotation_util.to_factor(df) - self.assertEqual(sum(factor4), 2) - with self.assertRaises(HedFileError): - annotation_util.to_factor(data) - ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 def test_series_to_factor(self): series1 = Series([1.0, 2.0, 3.0, 4.0]) factor1 = annotation_util.series_to_factor(series1) diff --git a/tests/validator/test_def_validator.py b/tests/validator/test_def_validator.py index 2545a626..73a89073 100644 --- a/tests/validator/test_def_validator.py +++ b/tests/validator/test_def_validator.py @@ -230,11 +230,7 @@ def test_expand_def_tags_placeholder(self): expand_defs=False, shrink_defs=False, remove_definitions=False, basic_definition_string=self.placeholder_definition_string) -<<<<<<< HEAD self.base_def_validator(basic_def_strings, basic_def_strings, -======= - self.base_def_validator(basic_def_strings, basic_def_strings, ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 expand_defs=False, shrink_defs=True, remove_definitions=False, basic_definition_string=self.placeholder_definition_string) diff --git a/tests/validator/test_tag_validator.py b/tests/validator/test_tag_validator.py index 711f77d6..557660d3 100644 --- a/tests/validator/test_tag_validator.py +++ b/tests/validator/test_tag_validator.py @@ -503,13 +503,8 @@ def test_topLevelTagGroup_validation(self): 'valid1': [], 'valid2': [], 'invalid2': self.format_error( -<<<<<<< HEAD ValidationErrors.HED_TOP_LEVEL_TAG, tag=1, actual_error=ValidationErrors.DEFINITION_INVALID) + \ self.format_error(ValidationErrors.HED_TOP_LEVEL_TAG, tag=1), -======= - ValidationErrors.HED_TOP_LEVEL_TAG, tag=1, actual_error= - ValidationErrors.DEFINITION_INVALID) + self.format_error(ValidationErrors.HED_TOP_LEVEL_TAG, tag=1), ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 'invalidTwoInOne': self.format_error(ValidationErrors.HED_MULTIPLE_TOP_TAGS, tag=0, multiple_tags="Definition/InvalidDef3".split(", ")), 'invalid2TwoInOne': self.format_error(ValidationErrors.HED_MULTIPLE_TOP_TAGS, tag=0, @@ -1050,11 +1045,7 @@ def test_special_units(self): expected_issues = { 'ascii': [], 'illegalTab': self.format_error(ValidationErrors.INVALID_VALUE_CLASS_CHARACTER, tag=0, -<<<<<<< HEAD index_in_tag=13, index_in_tag_end=14, value_class="textClass"), -======= - index_in_tag=13, index_in_tag_end=14, value_class="textClass"), ->>>>>>> 887f2944e5b295cd98a5ade9e420185756eec536 'allowTab': [] } self.validator_semantic(test_strings, expected_results, expected_issues, True)