Skip to content

Commit

Permalink
Minor corrections to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VisLab committed Sep 27, 2024
1 parent 4b00b4d commit 30ea4b6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 49 deletions.
4 changes: 0 additions & 4 deletions hed/schema/schema_io/df_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions hed/schema/schema_io/ontology_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions tests/models/test_hed_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
24 changes: 0 additions & 24 deletions tests/tools/analysis/test_annotation_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions tests/validator/test_def_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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

0 comments on commit 30ea4b6

Please sign in to comment.