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

Metadata fix #99

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@ def _resolve_duplicates(resolved_dict, ids1, dict1, ids2, dict2):
resolved_dict[id1] = {}
for key1 in dict1[id1].keys():
if key1 in dict2[id1].keys():
if dict1[id1][key1] == "":
dict1[id1][key1] = dict2[id1][key1]
if dict2[id1][key1] == "":
dict2[id1][key1] = dict1[id1][key1]
if dict1[id1][key1] != dict2[id1][key1]:
print(
f"dict1 and dict2 don't match (dict1[{id1}][{key1}]: {dict1[id1][key1]}, dict2[{id1}][{key1}]: {dict2[id1][key1]})"
)
assert (
dict1[id1][key1] == dict2[id1][key1]
), f"dict1 and dict2 don't match (dict1[{id1}][{key1}]: {dict1[id1][key1]}, dict2[{id1}][{key1}]: {dict2[id1][key1]})"
Expand Down Expand Up @@ -632,32 +640,32 @@ def get_session_name(session_df):
]
velocity_modulation_examples = ["c621e134-50ec-4e8b-8175-a8c023d92789"]

reinforcement_session_metadata, reinforcement_subject_metadata = extract_reinforcement_metadata(
data_path,
)
photometry_session_metadata, photometry_subject_metadata = extract_photometry_metadata(
data_path,
)
# reinforcement_session_metadata, reinforcement_subject_metadata = extract_reinforcement_metadata(
# data_path,
# )
# photometry_session_metadata, photometry_subject_metadata = extract_photometry_metadata(
# data_path,
# )
(
reinforcement_photometry_session_metadata,
reinforcement_photometry_subject_metadata,
) = extract_reinforcement_photometry_metadata(data_path, example_uuids=reinforcement_photometry_examples)
velocity_session_metadata, velocity_subject_metadata = extract_velocity_modulation_metadata(
data_path,
)
keypoint_session_metadata, keypoint_subject_metadata = extract_keypoint_metadata(data_path)
) = extract_reinforcement_photometry_metadata(data_path)
# velocity_session_metadata, velocity_subject_metadata = extract_velocity_modulation_metadata(
# data_path,
# )
# keypoint_session_metadata, keypoint_subject_metadata = extract_keypoint_metadata(data_path)

path2metadata = {
photometry_session_metadata_path: photometry_session_metadata,
photometry_subject_metadata_path: photometry_subject_metadata,
reinforcement_session_metadata_path: reinforcement_session_metadata,
reinforcement_subject_metadata_path: reinforcement_subject_metadata,
# photometry_session_metadata_path: photometry_session_metadata,
# photometry_subject_metadata_path: photometry_subject_metadata,
# reinforcement_session_metadata_path: reinforcement_session_metadata,
# reinforcement_subject_metadata_path: reinforcement_subject_metadata,
reinforcement_photometry_session_metadata_path: reinforcement_photometry_session_metadata,
reinforcement_photometry_subject_metadata_path: reinforcement_photometry_subject_metadata,
velocity_session_metadata_path: velocity_session_metadata,
velocity_subject_metadata_path: velocity_subject_metadata,
keypoint_session_metadata_path: keypoint_session_metadata,
keypoint_subject_metadata_path: keypoint_subject_metadata,
# velocity_session_metadata_path: velocity_session_metadata,
# velocity_subject_metadata_path: velocity_subject_metadata,
# keypoint_session_metadata_path: keypoint_session_metadata,
# keypoint_subject_metadata_path: keypoint_subject_metadata,
}
for path, resolved_dict in path2metadata.items():
with open(path, "w") as f:
Expand Down