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

[better error handling] buildstock could handle duplicated files better #425

Closed
wenyikuang opened this issue Dec 29, 2023 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@wenyikuang
Copy link
Collaborator

If we run buildstock_local for same yml file twice. It will raise the FileExistsError .

DEBUG:2023-12-29 05:42:52:buildstockbatch.local:Compressing simulation outputs to /App2/baseline_test_output/simulation_output/simulations_job0.tar.gz
Traceback (most recent call last):
  File "/usr/local/bin/buildstock_local", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/buildstockbatch/utils.py", line 120, in run_with_error_capture
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/buildstockbatch/local.py", line 471, in main
    batch.process_results()
  File "/usr/local/lib/python3.8/site-packages/buildstockbatch/base.py", line 911, in process_results
    postprocessing.combine_results(fs, self.results_dir, self.cfg, do_timeseries=do_timeseries)
  File "/usr/local/lib/python3.8/site-packages/buildstockbatch/postprocessing.py", line 405, in combine_results
    fs.makedirs(dr)
  File "/usr/local/lib/python3.8/site-packages/fsspec/implementations/local.py", line 54, in makedirs
    os.makedirs(path, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/App2/baseline_test_output/results_csvs'
root@f113d48994f9:/App2# rm -rf /App2/baseline_test_output/
root@f113d48994f9:/App2# buildstock_local ymls/bsb-integration-test-baseline.yml

I will fix it later.

@wenyikuang wenyikuang added the enhancement New feature or request label Dec 29, 2023
@wenyikuang wenyikuang self-assigned this Dec 29, 2023
@nmerket
Copy link
Member

nmerket commented Jan 10, 2024

Ok, yeah, I thought we had it throw an error on the project validation step if the output directory exists. There's some nuance to it because you may want to run postprocessing on a run that's already done. Ultimately, we do want to have some sort of error if you're trying to overwrite existing results.

@wenyikuang
Copy link
Collaborator Author

Ok, make sense. Thanks for elaboration. Close it.

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

No branches or pull requests

2 participants