Skip to content

Commit

Permalink
Merged conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
VisLab committed Sep 27, 2024
2 parents 9e0a8f6 + 887f294 commit 4b00b4d
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 1 deletion.
4 changes: 4 additions & 0 deletions hed/schema/schema_io/df_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions hed/schema/schema_io/ontology_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion spec_tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions tests/models/test_hed_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
24 changes: 24 additions & 0 deletions tests/tools/analysis/test_annotation_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions tests/validator/test_def_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 9 additions & 0 deletions tests/validator/test_tag_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4b00b4d

Please sign in to comment.