Skip to content

updated#39

Open
tameen wants to merge 1 commit intokashifpk/convert-to-poetry-fastapi-and-typerfrom
task
Open

updated#39
tameen wants to merge 1 commit intokashifpk/convert-to-poetry-fastapi-and-typerfrom
task

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.

2 participants