- Removed obsolete slots: `has_or_had_custodian_observation`, `provider`, and `specificity_annotation`. - Updated `has_or_had_score` slot to use `SpecificityScore` class and modified its description and examples. - Added new slots: `end_seconds`, `end_time`, `has_archive_path`, `has_or_had_custodian_name`, `protocol_name`, and `protocol_version`. - Introduced a script `check_annotation_types.py` to validate the presence and structure of `custodian_types` in YAML files. - Added a script `update_specificity.py` to automate updates related to `SpecificityAnnotation` to `SpecificityScore`.
38 lines
968 B
Python
38 lines
968 B
Python
import os
|
|
|
|
def clean_imports(path):
|
|
with open(path, 'r') as f:
|
|
lines = f.readlines()
|
|
|
|
bad_imports = [
|
|
"DiarizationSegment",
|
|
"SpeechSegment",
|
|
"MusicSegment",
|
|
"ImagingEquipment",
|
|
"EADIdentifier",
|
|
"LEIIdentifier",
|
|
"AlternativeName",
|
|
"Series",
|
|
"MissionStatement",
|
|
"StorageFacility",
|
|
"AcquisitionBudget",
|
|
"DigitizationBudget"
|
|
]
|
|
|
|
new_lines = []
|
|
for line in lines:
|
|
stripped = line.strip()
|
|
remove = False
|
|
for bad in bad_imports:
|
|
if bad in stripped and "modules/classes" in stripped:
|
|
print(f"Removing {bad} from {path}")
|
|
remove = True
|
|
break
|
|
|
|
if not remove:
|
|
new_lines.append(line)
|
|
|
|
with open(path, 'w') as f:
|
|
f.writelines(new_lines)
|
|
|
|
clean_imports("schemas/20251121/linkml/01_custodian_name_modular.yaml")
|