Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
saving JSON files to ~/.brainglobe/atlases/validation
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorpm committed Feb 2, 2024
1 parent 0bd3163 commit a980f67
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bg_atlasgen/validate_atlases.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,18 @@ def validate_atlas(atlas_name, version, validation_functions):
print("### Invalid atlases ###")
print(invalid_atlases)

# Get the directory path
output_dir_path = str(get_brainglobe_dir() / "atlases/validation")

# Create the directory if it doesn't exist
if not os.path.exists(output_dir_path):
os.makedirs(output_dir_path)

# Open a file for writing
with open("failed_validations.json", "w") as file:
with open(str(get_brainglobe_dir() / "atlases/validation/failed_validations.json"), "w") as file:
# Write the dictionary to the file in JSON format
json.dump(failed_validations, file)

with open("successful_validations.json", "w") as file:
with open(str(get_brainglobe_dir() / "atlases/validation/successful_validations.json"), "w") as file:
# Write the dictionary to the file in JSON format
json.dump(successful_validations, file)

0 comments on commit a980f67

Please sign in to comment.