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

too many statements in try-except clause for loading existing .dat file #68

Open
stefanpauliuk opened this issue Sep 20, 2023 · 1 comment

Comments

@stefanpauliuk
Copy link
Member

There are 40 lines of code in the following try-except clause:
try: # Load Pickle parameter dict to save processing time
That means any error within these many commands will give no error message and the same result: The .dat file is not read and all parameter files are re-read.
Consider a introducing a leaner exception handling here, or add more error messages at least!
Not sure whether it's good style to have nexted try-except clauses...

@CarrerF
Copy link
Contributor

CarrerF commented Sep 25, 2023

By replacing try-except with

if ParFileName in os.listdir(RECC_Paths.data_path):
..
else:
..

it should give an error message pointing at the line in which it's happening, rather then the general try-except error message.

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