-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #719 from hed-standard/master
Remodeling JSON summaries now have common output format.
- Loading branch information
Showing
60 changed files
with
1,289 additions
and
696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
MIT License | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2020+ HED Standard Working Group | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
defusedxml>=0.7.1 | ||
inflect>=6.0.2 | ||
myst-parser>=0.18.1 | ||
inflect>=6.0.5 | ||
numpy>=1.21.6 | ||
openpyxl>=3.1.0 | ||
pandas>=1.3.5 | ||
portalocker>=2.7.0 | ||
semantic_version>=2.10.0 | ||
Sphinx>=5.2.2 | ||
sphinx_rtd_theme>=1.0.0 | ||
wordcloud==1.9.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
"""The built-in functions to validate known attributes. | ||
Template for the functions: | ||
attribute_checker_template(hed_schema, tag_entry, attribute_name, possible_values): | ||
hed_schema (HedSchema): The schema to use for validation | ||
tag_entry (HedSchemaEntry): The schema entry for this tag. | ||
attribute_name (str): The name of this attribute | ||
Returns: | ||
bool | ||
""" | ||
|
||
from hed.errors.error_types import SchemaWarnings, ValidationErrors | ||
from hed.errors.error_reporter import ErrorHandler | ||
from hed.schema.hed_schema import HedSchema | ||
|
||
|
||
def tag_is_placeholder_check(hed_schema, tag_entry, attribute_name): | ||
""" Check if comma separated list has valid HedTags. | ||
Parameters: | ||
hed_schema (HedSchema): The schema to use for validation | ||
tag_entry (HedSchemaEntry): The schema entry for this tag. | ||
attribute_name (str): The name of this attribute | ||
Returns: | ||
list: A list of issues. Each issue is a dictionary. | ||
""" | ||
issues = [] | ||
if not tag_entry.name.endswith("/#"): | ||
issues += ErrorHandler.format_error(SchemaWarnings.NON_PLACEHOLDER_HAS_CLASS, tag_entry.name, | ||
attribute_name) | ||
|
||
return issues | ||
|
||
|
||
def tag_exists_check(hed_schema, tag_entry, attribute_name): | ||
""" Check if the list of possible tags exists in the schema. | ||
Parameters: | ||
hed_schema (HedSchema): The schema to use for validation | ||
tag_entry (HedSchemaEntry): The schema entry for this tag. | ||
attribute_name (str): The name of this attribute | ||
Returns: | ||
list: A list of issues. Each issue is a dictionary. | ||
""" | ||
issues = [] | ||
possible_tags = tag_entry.attributes.get(attribute_name, "") | ||
split_tags = possible_tags.split(",") | ||
for org_tag in split_tags: | ||
if org_tag and org_tag not in hed_schema.all_tags: | ||
issues += ErrorHandler.format_error(ValidationErrors.NO_VALID_TAG_FOUND, | ||
org_tag, | ||
index_in_tag=0, | ||
index_in_tag_end=len(org_tag)) | ||
|
||
return issues | ||
|
||
|
||
def tag_exists_base_schema_check(hed_schema, tag_entry, attribute_name): | ||
""" Check if the single tag is a partnered schema tag | ||
Parameters: | ||
hed_schema (HedSchema): The schema to use for validation | ||
tag_entry (HedSchemaEntry): The schema entry for this tag. | ||
attribute_name (str): The name of this attribute | ||
Returns: | ||
list: A list of issues. Each issue is a dictionary. | ||
""" | ||
issues = [] | ||
rooted_tag = tag_entry.attributes.get(attribute_name, "") | ||
if rooted_tag and rooted_tag not in hed_schema.all_tags: | ||
issues += ErrorHandler.format_error(ValidationErrors.NO_VALID_TAG_FOUND, | ||
rooted_tag, | ||
index_in_tag=0, | ||
index_in_tag_end=len(rooted_tag)) | ||
|
||
return issues |
Oops, something went wrong.