Validate that the output_dir is always set and add a missing argument in overload

PiperOrigin-RevId: 913567460
Change-Id: I3b393fdc12819265a6916cb2c735964d25b3e375
This commit is contained in:
Augustin Zidek
2026-05-11 01:48:25 -07:00
committed by Copybara-Service
parent eba618977e
commit 8850da42a6

View File

@@ -707,6 +707,7 @@ def process_fold_input(
ref_max_modified_date: datetime.date | None = None, ref_max_modified_date: datetime.date | None = None,
conformer_max_iterations: int | None = None, conformer_max_iterations: int | None = None,
resolve_msa_overlaps: bool = True, resolve_msa_overlaps: bool = True,
fix_standalone_glycans: bool = False,
force_output_dir: bool = False, force_output_dir: bool = False,
compress_large_output_files: bool = False, compress_large_output_files: bool = False,
) -> folding_input.Input: ) -> folding_input.Input:
@@ -724,6 +725,7 @@ def process_fold_input(
ref_max_modified_date: datetime.date | None = None, ref_max_modified_date: datetime.date | None = None,
conformer_max_iterations: int | None = None, conformer_max_iterations: int | None = None,
resolve_msa_overlaps: bool = True, resolve_msa_overlaps: bool = True,
fix_standalone_glycans: bool = False,
force_output_dir: bool = False, force_output_dir: bool = False,
compress_large_output_files: bool = False, compress_large_output_files: bool = False,
) -> Sequence[ResultsForSeed]: ) -> Sequence[ResultsForSeed]:
@@ -875,6 +877,9 @@ def main(_):
'Exactly one of --json_path or --input_dir must be specified.' 'Exactly one of --json_path or --input_dir must be specified.'
) )
if _OUTPUT_DIR.value is None:
raise ValueError('Output directory must be specified with --output_dir.')
# Make sure we can create the output directory before running anything. # Make sure we can create the output directory before running anything.
try: try:
os.makedirs(_OUTPUT_DIR.value, exist_ok=True) os.makedirs(_OUTPUT_DIR.value, exist_ok=True)