Fix fire module bugs and update development status classifier#1292
Merged
Fix fire module bugs and update development status classifier#1292
Conversation
- Fix FutureWarning in _apply_client_filters: replace plain list mask with pd.Series to avoid pandas deprecation warning for logical ops between DataFrames and dtype-less sequences - Add missing duration_max parameter to fire_gdf_from_place, which was present in fire_gdf_from_bbox and search_fires but silently dropped when searching by place name - Pass duration_max through in search_fires when calling fire_gdf_from_place - Remove unused shapely.geometry.box import from fire_gdf_from_place - Update Development Status classifier from '2 - Pre-Alpha' to '5 - Production/Stable' to reflect the project's maturity
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes critical bugs in the newly added fire module that prevented proper filtering functionality and caused deprecation warnings with pandas 2.x. It also updates the project's development status classifier.
Changes:
- Fixed FutureWarning in
_apply_client_filtersby replacing plain list mask with pandas Series - Added missing
duration_maxparameter tofire_gdf_from_placeand wired it throughsearch_fires - Removed unused shapely import and updated error message
- Updated development status from Pre-Alpha to Production/Stable
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| leafmap/fire.py | Fixed FutureWarning by using pandas Series for boolean mask; added missing duration_max parameter throughout the call chain; removed unused shapely import |
| pyproject.toml | Updated Development Status classifier from Pre-Alpha to Production/Stable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚀 Deployed on https://697da4632f57c9e8fffd06ef--opengeos.netlify.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several bugs in the new fire module and updates an outdated project classifier.
Bug Fixes
Fix FutureWarning in
_apply_client_filters: The filter mask was initialized as a plain Python list ([True] * len(gdf)), which triggers aFutureWarningin pandas 2.x when performing logical operations with DataFrame columns:Replaced with
pd.Series(True, index=gdf.index)for proper pandas-native boolean indexing.Add missing
duration_maxparameter tofire_gdf_from_place: Theduration_maxfilter parameter was present infire_gdf_from_bboxandsearch_firesbut was missing fromfire_gdf_from_place. This causedsearch_fires(..., duration_max=X)to silently ignore the filter when searching by place name.Pass
duration_maxthrough insearch_fires: Thesearch_firesfunction acceptedduration_maxbut didn't pass it tofire_gdf_from_place, so the filter was silently dropped for place-based searches.Remove unused import:
from shapely.geometry import boxwas imported infire_gdf_from_placebut never used.Improvement
Development Status :: 2 - Pre-AlphatoDevelopment Status :: 5 - Production/Stableinpyproject.tomlto reflect the project's maturity (3,600+ stars, 200+ releases).