Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCHEMA] Very minor tune ups to the test_rule_objects test while trying to grasp its function #1728

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

yarikoptic
Copy link
Collaborator

No description provided.

If the point is to go through values, just go through .values()
without iterating through keys() and then dereferencing via [key]
Since then also it is not clear if that is indeed some ValueError from within code.
I also added a string which summarizes the problem.
@yarikoptic yarikoptic requested review from TheChymera and tsalo March 15, 2024 23:28
@yarikoptic yarikoptic requested a review from erdalkaraca as a code owner March 15, 2024 23:28
schema_obj["objects"][object_type][k]["value"]
for k in schema_obj["objects"][object_type].keys()
value["value"]
for value in schema_obj["objects"][object_type].values()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simpler == easier to read and understand

@@ -100,7 +100,7 @@ def test_rule_objects(schema_obj):

if not_found:
not_found_string = "\n".join([f"{'.'.join(path)} == {val}" for path, val in not_found])
raise AssertionError(f"Undefined objects found in rules: {not_found_string}"
raise AssertionError(f"Undefined objects found in rules: {not_found_string}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have sworn I have tested it -- must be some hand tremble removed it last moment ;)

@effigies effigies added exclude-from-changelog This item will not feature in the automatically generated changelog schema-code Updates or changes to the code used to parse, filter, and render the schema. labels Mar 20, 2024
@effigies effigies merged commit 9ed04a6 into bids-standard:master Mar 20, 2024
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-from-changelog This item will not feature in the automatically generated changelog schema-code Updates or changes to the code used to parse, filter, and render the schema.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants