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

updated #39

Open
wants to merge 1 commit into
base: kashifpk/convert-to-poetry-fastapi-and-typer
Choose a base branch
from
Open

Conversation

tameen
Copy link
Collaborator

@tameen tameen commented Jun 14, 2023

No description provided.

@tameen tameen requested a review from kashifpk June 14, 2023 12:25
Copy link
Owner

@kashifpk kashifpk left a comment

Choose a reason for hiding this comment

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

This looks better. Please review the comments otherwise this should be stable enough to merge.

AyaText.new(aya_doc, content.strip(), language, text_name)

total = 0
file_range = len(file.readlines())
Copy link
Owner

Choose a reason for hiding this comment

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

In order to introduce the progress bar, the logic now reads the entire file at the start. The previous logic was meant so even large files don't require big memory overhead because of the program loading the full file. In previous implementation it was just one line at a time that was being read from the file.

Copy link
Owner

Choose a reason for hiding this comment

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

May be to keep the progress bar and avoid the double for loop below we could do something like:

file_lines = file.readlines()
total_lines = len(file_lines)
with typer.progressbar(range(total_lines)) as progress:
    for value in progress:
        line = file_lines[value]

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.

None yet

2 participants