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

fix: Adding default values for optional fields #19

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions ingestion_tools/dataset_configs/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,20 @@ tomograms:
standardization_config:
destination_prefix: '99999'
source_prefix: path/to/source
run_glob: frames/*
run_regex: /TS_\d\d$
run_name_regex: (.*)
frames_glob: frames/{run_name}_*.tif
frames_name_regex: (.*)
gain_glob: frames/CountRef.dm4
rawtlt_files:
- metadata/{run_name}.rawtlt
- metadata/{run_name}.xf
- metadata/mdocs_modified/{run_name}.mdoc
tiltseries_glob: metadata/{run_name}.st
ts_name_regex: (.*)\.rec
tomo_format: mrc
tomo_glob: tomograms/*.rec
tomo_regex: (.*)\.mrc
tomo_voxel_size: '13.48'
run_glob: frames/*
run_regex: /TS_\d\d$
run_name_regex: (.*)
tomo_key_photo_glob: .*\.jpg
28 changes: 14 additions & 14 deletions ingestion_tools/scripts/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ class DataImportConfig:
run_regex: re.Pattern[str]
tomo_glob: str
tomo_format: str
tomo_regex: re.Pattern[str] | None
tomo_key_photo_glob: str | None
tomo_regex: re.Pattern[str] | None = None
tomo_key_photo_glob: str | None = None
tomo_voxel_size: str
ts_name_regex: re.Pattern[str] | None
ts_name_regex: re.Pattern[str] | None = None
run_name_regex: re.Pattern[str]
frames_name_regex: re.Pattern[str]
frames_name_regex: re.Pattern[str] | None = None
frames_glob: str
tiltseries_glob: str | None
run_to_tomo_map_file: str | None
run_to_tomo_map: dict[str, str] | None
run_to_frame_map_csv: str | None
run_to_frame_map: dict[str, str] | None
run_to_ts_map_csv: str | None
run_to_ts_map: dict[str, str] | None
tiltseries_glob: str | None = None
run_to_tomo_map_file: str | None = None
run_to_tomo_map: dict[str, str] | None = None
run_to_frame_map_csv: str | None = None
run_to_frame_map: dict[str, str] | None = None
run_to_ts_map_csv: str | None = None
run_to_ts_map: dict[str, str] | None = None
gain_glob: str
rawtlt_files: list[str] | None
rawtlt_files: list[str] | None = None
# metadata templates
dataset_template: dict[str, Any]
run_template: dict[str, Any]
Expand All @@ -60,9 +60,9 @@ class DataImportConfig:
annotation_template: dict[str, Any]
output_prefix: str
input_prefix: str
overrides_by_run: list[RunOverride] | None
overrides_by_run: list[RunOverride] | None = None
run_data_map: dict[str, Any]
run_data_map_file: str | None
run_data_map_file: str | None = None

def __init__(self, fs: FileSystemApi, config_path: str, output_prefix: str, input_bucket: str):
self.output_prefix = output_prefix
Expand Down
Loading