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

Add progress bars to finder.find() #117

Merged
merged 4 commits into from
Oct 10, 2024
Merged

Conversation

Pennycook
Copy link
Contributor

Parsing each file in the codebase and subsequent preprocessing are the two most time-consuming steps of running codebasin.

Adding progress bars for these steps is expected to be a significant improvement to user experience, as it enables a user to reason about how fast codebasin is running and when it may complete.

Related issues

N/A

Proposed changes

  • Use tqdm to implement a progress bar for parsing all source files. The codebase and platform configuration loops are collapsed because we only parse source files once (even if they are used by multiple platforms).
  • Use tqdm to implement nested progress bars for preprocessing: the outer bar tracks preprocessing for each platform, and the inner bar tracks preprocessing for each source file used by that platform.
  • Add a show_progress option that defaults to False, since other tools (e.g., cbicov?) may wish to run the preprocessor without showing the progress bars.

@Pennycook Pennycook added the enhancement New feature or request label Sep 26, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Sep 26, 2024
Copy link
Contributor

@laserkelvin laserkelvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some minor (aesthetic) comments

codebasin/finder.py Outdated Show resolved Hide resolved
codebasin/finder.py Outdated Show resolved Hide resolved
codebasin/finder.py Outdated Show resolved Hide resolved
codebasin/finder.py Show resolved Hide resolved
Parsing each file in the codebase and subsequent preprocessing are the
two most time-consuming steps of running codebasin.

Adding progress bars for these steps is expected to be a significant
improvement to user experience, as it enables a user to reason about how
fast codebasin is running and when it may complete.

Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
By default, progress bar renders as XXfile/s instead of XX file/s.

Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook merged commit 20d11b4 into intel:main Oct 10, 2024
3 checks passed
@Pennycook Pennycook deleted the progress-bars branch October 10, 2024 10:22
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

Successfully merging this pull request may close these issues.

2 participants