Remove flatdict dependency by replacing fiboa-cli with lightweight parquet utilities#235
Remove flatdict dependency by replacing fiboa-cli with lightweight parquet utilities#235
Conversation
Co-authored-by: isaaccorley <22203655+isaaccorley@users.noreply.github.com>
Co-authored-by: isaaccorley <22203655+isaaccorley@users.noreply.github.com>
…d imports Co-authored-by: isaaccorley <22203655+isaaccorley@users.noreply.github.com>
|
@copilot can we instead just upgrade the fiboa-cli which doesn't have flatdict dependency anymore? |
|
No, this doesn't work yet. |
fiboa-cli >= 0.20.0 removed flatdict but underwent a complete rewrite that removed the Upgrading would require refactoring both call sites in The current lightweight implementation (~80 LOC) maintains exact API compatibility while removing the flatdict dependency. Would you prefer I refactor to use fiboa-cli 0.20.3's new API instead? Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Sounds good, saw the build errors in other PRs was just looking to debug but thanks for the heads up |
|
I'll try to get to it next week. |
|
Colsing in favor of #241 |
flatdicthas build issues with setuptools. It's pulled in as a transitive dependency fromfiboa-cli==0.7.Changes
New module:
ftw_tools/parquet_utils.pyfeatures_to_dataframe(): Converts GeoJSON features to GeoDataFramecreate_parquet(): Writes GeoDataFrame to Parquet with fiboa metadata injectionUpdated imports
ftw_tools/inference/utils.pyftw_tools/postprocess/polygonize.pyDependencies
fiboa-cli==0.7frompyproject.tomlApproach
The codebase only uses two functions from fiboa-cli:
create_parquetandfeatures_to_dataframe. Newer fiboa-cli versions (≥0.20.0) dropped flatdict but underwent a major rewrite with breaking API changes.Rather than migrating to the incompatible API, implemented focused replacements (~80 LOC) that:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.lightly.ai/home/REDACTED/work/ftw-baselines/ftw-baselines/.venv/bin/pytest pytest tests/ -k not integration and not instance_segmentation -v(dns block)/home/REDACTED/work/ftw-baselines/ftw-baselines/.venv/bin/pytest pytest tests/ -k not integration and not instance_segmentation --ignore=tests/test_eval.py --ignore=tests/test_model_registry.py --ignore=tests/test_models.py -v(dns block)astral.sh/usr/bin/curl curl -LsSf REDACTED(dns block)data.source.coop/home/REDACTED/work/ftw-baselines/ftw-baselines/.venv/bin/pytest pytest tests/ -k not integration and not instance_segmentation --ignore=tests/test_eval.py --ignore=tests/test_model_registry.py --ignore=tests/test_models.py -v(dns block)planetarycomputer.microsoft.com/home/REDACTED/work/ftw-baselines/ftw-baselines/.venv/bin/pytest pytest tests/ -k not integration and not instance_segmentation --ignore=tests/test_eval.py --ignore=tests/test_model_registry.py --ignore=tests/test_models.py -v(dns block)sentinel-cogs.s3.us-west-2.amazonaws.com/home/REDACTED/work/ftw-baselines/ftw-baselines/.venv/bin/pytest pytest tests/ -k not integration and not instance_segmentation --ignore=tests/test_eval.py --ignore=tests/test_model_registry.py --ignore=tests/test_models.py -v(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.