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

Addressing progress bar issue #300

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

jeronimoluza
Copy link
Contributor

  • Added tqdm to main.py in zonal_stats function
    • stats generator is created doing gen_zonal_stats() and then the total length of the generator (for tqdm to know) is done doing total=sum(1 for _ in stats). Not sure how I feel about this.
    • if progress == True, the zonal_stats() function will return the list comprehension using the tqdm module, if not it will return the original generator list-initialization.
  • Added tqdm in project.optional-dependencies in pyproject.toml.

@jeronimoluza jeronimoluza changed the title Addressing progress bar issue. Addressing progress bar issue Sep 19, 2024
Copy link
Owner

@perrygeo perrygeo left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for your contribution! A change requested - making tqdm an optional import.

src/rasterstats/main.py Outdated Show resolved Hide resolved
src/rasterstats/main.py Show resolved Hide resolved
@jeronimoluza
Copy link
Contributor Author

jeronimoluza commented Sep 26, 2024

Just added those changes, @perrygeo !
Let me know if there's anything else you need me to do.

@perrygeo
Copy link
Owner

perrygeo commented Sep 27, 2024

The errors in CI are unrelated to this PR. Looks like a breaking change in Fiona. I'll deal with it another PR.

@perrygeo perrygeo merged commit 830bcac into perrygeo:master Sep 27, 2024
0 of 5 checks passed
@perrygeo
Copy link
Owner

see Toblerity/Fiona#1455

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