diff --git a/hed/schema/schema_io/df_util.py b/hed/schema/schema_io/df_util.py index 0f4927a6..ba0d8f49 100644 --- a/hed/schema/schema_io/df_util.py +++ b/hed/schema/schema_io/df_util.py @@ -182,4 +182,8 @@ 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 28c05d5d..c7de7fdf 100644 --- a/hed/schema/schema_io/ontology_util.py +++ b/hed/schema/schema_io/ontology_util.py @@ -163,7 +163,11 @@ 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/spec_tests/test_errors.py b/spec_tests/test_errors.py index 0d0602cf..e0b5aee2 100644 --- a/spec_tests/test_errors.py +++ b/spec_tests/test_errors.py @@ -209,7 +209,7 @@ def test_errors(self): for test_file in self.test_files: self.run_single_test(test_file) # test_file = './temp.json' - self.run_single_test(test_file) + # self.run_single_test(test_file) print(f"{len(self.fail_count)} tests got an unexpected result") print("\n".join(self.fail_count)) self.assertEqual(len(self.fail_count), 0) diff --git a/tests/models/test_hed_string.py b/tests/models/test_hed_string.py index fba92013..dd2b91a9 100644 --- a/tests/models/test_hed_string.py +++ b/tests/models/test_hed_string.py @@ -8,7 +8,11 @@ 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 b6cbdfa9..8037eb7f 100644 --- a/tests/tools/analysis/test_annotation_util.py +++ b/tests/tools/analysis/test_annotation_util.py @@ -295,6 +295,30 @@ 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 73a89073..2545a626 100644 --- a/tests/validator/test_def_validator.py +++ b/tests/validator/test_def_validator.py @@ -230,7 +230,11 @@ 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 557660d3..711f77d6 100644 --- a/tests/validator/test_tag_validator.py +++ b/tests/validator/test_tag_validator.py @@ -503,8 +503,13 @@ 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, @@ -1045,7 +1050,11 @@ 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)