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

Mistake in output_dir and overwrite parameters validation #20

Open
Aivean opened this issue Jul 5, 2021 · 1 comment
Open

Mistake in output_dir and overwrite parameters validation #20

Aivean opened this issue Jul 5, 2021 · 1 comment

Comments

@Aivean
Copy link

Aivean commented Jul 5, 2021

This assert only lets in the following combination of parameter values:

  • output_dir must exist and overwrite=False

assert os.path.exists(
output_dir
) and overwrite is not True, f"{output_dir} is not empty and overwrite is not True."

From the context is seems that other combinations of parameter values should also be valid, such as:

  • output_dir doesn't exist an overwrite is whatever
  • output_dir exist and overwrite=True

I think the fix is to change the clause to:

assert not os.path.exists(
     output_dir 
 ) or overwrite, f"{output_dir} is not empty and overwrite is not True." 
@fumihwh
Copy link
Owner

fumihwh commented Aug 16, 2021

@Aivean Sorry for late reply.
Some PR will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants