Skip to content

Fix data_process scripts: import, progressbar init and bounds#75

Open
thomasarmstrong98 wants to merge 1 commit intoNVIDIA:mainfrom
thomasarmstrong98:fix/data-process-bugs
Open

Fix data_process scripts: import, progressbar init and bounds#75
thomasarmstrong98 wants to merge 1 commit intoNVIDIA:mainfrom
thomasarmstrong98:fix/data-process-bugs

Conversation

@thomasarmstrong98
Copy link
Copy Markdown

  • Use absolute import for wb2_helpers in convert_wb2_to_makani_input.py since the documented invocation is direct script execution (python script.py), not module execution (python -m), which breaks relative imports.

  • Call progressbar.start() before update() as required by progressbar2 API.

  • Clamp progress count to maxval to prevent ValueError in distributed settings where aggregated count can momentarily exceed the total.

- Use absolute import for wb2_helpers in convert_wb2_to_makani_input.py
  since the documented invocation is direct script execution (python script.py),
  not module execution (python -m), which breaks relative imports.

- Call progressbar.start() before update() as required by progressbar2 API.

- Clamp progress count to maxval to prevent ValueError in distributed
  settings where aggregated count can momentarily exceed the total.
@azrael417
Copy link
Copy Markdown
Collaborator

Hello Thomas,

thanks for the fix. The imports here are a bit inconsistent I agree, since data_process does not belong to the package. Instead of your solution, can we do the same thing we applied here:

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

I had some situations where one or the either approach breaks, but the one above is the most robust. If you have a more elegant solution, I am happy to look into that too.

Best regards
Thorsten

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

Successfully merging this pull request may close these issues.

2 participants