Spaces:
Running
Running
Commit History
-
fix(map-viewer): actually replace Carto layers with OSM in JS Running
GuilhermePMarques0fea1cc -
feat(map-viewer): replace Carto maps with OpenStreetMap and add nodes export
GuilhermePMarquesaa88432
-
fix(polygon-optimizer): close the empty bays the outline was leaving open
GabrielJunqueira +1: Claude Opus 5The suggested polygon still showed notches over the stadium bowl. Hole filling only ever removed closed interior rings, and those gaps are not rings: the bowl usually opens onto the outside through an access channel, so it is a concave bay and ring removal never touched it. Bays are now closed by escalating the closing radius until the gap is gone, with a hard constraint that no node the analysis did not select may end up inside. The radius stops one step before it would swallow one, and interior rings are kept when something sits in them rather than filled unconditionally. The outline therefore only ever expands into genuinely empty space. Verified on a reconstruction of the Metropolitano run: a bowl and access channel carrying no nodes are both filled, no unselected node is captured, every selected node stays inside, and the result is one polygon with no holes. The same shape with unselected nodes sitting in the gap keeps its notch, which is the correct answer rather than a cosmeti…9e09799 -
feat(polygon-optimizer): round the exported outline and rework the review UI
GabrielJunqueira +1: Claude Opus 5Nine pieces of feedback from the first real runs. Geometry. The export was a staircase of tile squares, sometimes broken into islands and pocked with holes — the run against the Metropolitano came back as a MultiPolygon of two blocks 114 m apart. It is now always a single rounded outline: detached blocks are bridged with a corridor along their shortest connecting line, every interior hole is filled, and the corners are rounded by closing then opening at the same radius. The corridor is sized from that radius, because a fixed width narrower than twice the radius is erased by the opening step. On the Arena MRV run this costs 5% extra area and swallows no unselected node; when it does swallow one, the count is reported rather than hidden, since those nodes will be aggregated into whatever project is built from the polygon. Styling. The upload areas, tabs and file inputs on this page had no styles at all: those classes live inside each page's own <style> across the toolbox, not in styles…beb5a0d
-
fix(polygon-optimizer): move the card to the home page
GabrielJunqueira +1: Claude Opus 5It was filed under the Project Creators hub, and the person who commissioned the tool went looking for it on the home page and did not find it. The placement was wrong: the tool creates no project, it produces a GeoJSON, which puts it with Project Validator and Scaling Factor rather than with the project creators. Moving it out also keeps the hub's "3 Tools" badge honest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>878211e -
fix(polygon-optimizer): say the node file is missing, not from the wrong country
GabrielJunqueira +1: Claude Opus 5Reaching the analysis with no cached node file produced "Wrong country?", because the country check ran before anything confirmed a file was loaded at all. On a Space that hibernates and clears /tmp, arriving with an empty cache is the common case, not the exotic one — and the message sent the user looking for the wrong problem. Found by exercising the deployed Space. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>755e7cf -
feat(polygon-optimizer): place the tool in the Project Creators hub
GabrielJunqueira +1: Claude Opus 5Rebased onto the Space, whose home page is now a set of hub pages rather than a flat tool grid. The card belongs on Project Creators alongside AOI Generator, API Generator and LI Project Creator, and the page navbar follows the Home / Project Creators / Report Creator / Scaling Factor structure the rest of the toolbox uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>21a44f5 -
fix(polygon-optimizer): recover the node cache after a worker restart
GabrielJunqueira +1: Claude Opus 5Two fixes found by running the tool against the live Brazil API. The node cache has two halves: an in-memory registry and a parquet file under /tmp. Only the registry was consulted, so a worker restart — which empties the registry while /tmp survives — told the user to upload 143 MB again for a file that was sitting right there. get_entry now rehydrates from the parquet when the registry has no entry, and deletes a cache it cannot read rather than serving it. Verified against the real file: a fresh process recovers all 1,581,982 nodes in 0.04s. The price step also read "89 cores, 0 day(s)". The platform computes days as end minus start, which is zero for the single-day query this tool makes, so the count is dropped in favour of the credit total. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>2268459 -
feat(polygon-optimizer): build the review screen, export and audit report
GabrielJunqueira +1: Claude Opus 5- Review map with four switchable layers (Decision, Excess, Similarity, Raw volume), a permanent legend, node popups carrying a sparkline of the node against the event reference curve, the dashed input polygon and the suggested outline. - Coverage headline comparing what the user's polygon captured against the current selection, the aggregate hourly chart with the window shaded, the editable window with Recompute, and a justification list that flies the map to a node when clicked. - Toggle nodes repaints locally in ~3 ms and fetches the dissolved outline; a request token drops stale responses so fast clicking cannot rewind the polygon. Draw manually resolves the drawn shape back into a node set and reports what came in and what dropped out. - Export writes the single-Feature GeoJSON with poly_type "core" and the audit CSV with every metric plus both hourly curves. - The review step drops the progress sidebar and widens the container: by then the map is the work su…1264824 -
feat(polygon-optimizer): add the scoring algorithm and final geometry
GabrielJunqueira +1: Claude Opus 5services/polygon_scoring.py holds the analysis as pure functions, so each stage is testable on its own: - Event window from the seed delta against either a baseline day (rescaled by a global volume factor) or the background profile of the outer ring, smoothed over three hours, longest run above half the peak, widened by one. - Per-node excess, ratio, curve similarity with volume shrinkage, peak alignment, proximity and coverage ratio; composite score on robust median/MAD z-scores. - Selection cascade: seeds always kept, an absolute floor measured from the local noise of the outer ring, a knee cut, 8-neighbourhood hole filling and noise removal, connected components and the 10-node target. - Geometry by dissolving the tile squares, morphological closing, hole removal and simplification, verified in both directions and falling back to the raw union rather than ever dragging in an unselected node. Plus /rescore, /geometry, /nodes-in-polygon and the audit CSV. Three bugs…d89cafe -
feat(polygon-optimizer): wire the Kido platform integration
GabrielJunqueira +1: Claude Opus 5Full validate → price → create → wait → query pipeline against the platform: - validate?mode=hard&is_aoi_project=false is mandatory; the cleaned `polygons` it returns is what goes to create, never the local GeoJSON. Zones listed in rejected_names are dropped from the analysis, and a rejection rate above 20% stops the run with a "your node file is stale" message. min_num_nodes warnings are expected (one node per zone) and are logged rather than surfaced. - create sends is_geoinsight false, unlike the shared endpoint which serves Tourism. 422 bodies are formatted, not dumped. - wait_ready polls projects/?search_term with 3s→15s backoff and a 5 minute ceiling, always naming the project so a timeout is recoverable. - stays queries paginate at 5000 and treat 422 as "still processing", the same reading routers/calibration.py already uses. - Response parsing never calls float() on the metric column: "<10" is parsed with to_numeric(errors="coerce"), counted as zero and kept …d0de946 -
feat(polygon-optimizer): add job pipeline, wizard page and node preview
GabrielJunqueira +1: Claude Opus 5Flow skeleton for the new tool, end to end on everything that does not touch the Kido platform yet: - services/polygon_optimizer.py: in-memory job store with a 2h TTL and a 20-job ceiling, the ten to-do steps, GeoJSON input parsing (rejects projected CRS, non-polygon geometry, warns on extra features), UTM buffering, node collection with the 800/2000 guards and the no_seed_nodes fallback, and diagnostic zone building at 80% of the tile square. - routers/polygon_optimizer.py: node upload/status/replace, /preview and /zones-preview for inspecting the area before spending a project, plus /run and /status. The access token stays inside the job record and is stripped from every response. - frontend: five-step wizard with a sticky to-do sidebar, Leaflet.draw or GeoJSON upload for the area, baseline auto-suggestion, radius slider and the full Advanced panel. Card and navbar entry on the home page. Verified locally: a 2601-node synthetic file for Rio uploads as zip, caches …2fc716d -
feat(polygon-optimizer): add z18 tile math and node file service
GabrielJunqueira +1: Claude Opus 5Foundation for the Event Polygon Optimizer: - services/tiles.py: Web Mercator math for the z=18 projection grid. tile_bounds, tile_center (the node file stores tile centers, i.e. x+0.5), lonlat_to_tile, tile_width_m, 8-neighbourhood adjacency, node id packing and shrinkable tile polygons for diagnostic zones. - services/nodes.py: per-country node file upload. Detects zip/gzip/csv by content, reads with lean dtypes, caches as parquet under /tmp and answers bbox queries by numeric tile-range filtering instead of a spatial index. - 29 unit tests covering tile math, container detection, content validation, cache loss after Space hibernation and bbox querying. - pyarrow added for the parquet cache. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>c1c6aaf
-
refactor(geojson_validator): remove multipolygon explosion, keep sliver cleaning
GuilhermePMarques9b95b16
-
fix(geojson_validator): translate UI to English and fix download button
GuilhermePMarques1581ef3 -
fix: Add file size check to nodes CSV processing to prevent empty file parse errors
GuilhermePMarquesb411415
-
Add missing GeoJSON Validator endpoints and homepage card
GuilhermePMarquese7ce940 -
Optimize GeoJSON Validator: Improve UI responsiveness and fix Leaflet crashes
GuilhermePMarques95c34d7
-
feat(editor): user-selectable identifier column for CSV export
GuilhermePMarques- Backend returns polygon_columns list in /api/editor/process response - Frontend shows a column picker dropdown (hidden until data loads) - CSV header and values use the user-selected column instead of hardcoded polygon_idb81797e
-
feat: group tools into Project Creators and Report Creator hub pages
GuilhermePMarques- Replace 6 individual tool cards on homepage with 2 hub cards - Add /project-creators hub page (AOI Generator, API Generator, LI Creator) - Add /report-creator hub page (AOI Report, Tourism Report, Retail Report) - Update navbar to reflect new grouped structure - Add backend routes for both hub pages in main.py - All original tool URLs remain unchanged6f841e4
-
feat: Add Checkpoints filtering, Night Mode toggle, bidirectional slider sync, and CSV export to Map Viewer
GuilhermePMarquesb66f7cd -
feat(report): dynamic headers and UI cleanup
GuilhermePMarques- Removed broken 'Print PDF' button from the frontend. - Added placeholders for Project Name, Number of AOIs, and Period in the dashboard template. - Implemented backend logic to fetch project details and format the analysis period dynamically. - Injected dynamic values into the generated HTML.acb3d31 -
feat(report): add custom date range picker alongside month selection
GuilhermePMarquesStep 3 now has a toggle between 'By Months' and 'Custom Date Range' modes. Date range mode adds start/end date inputs with quick presets (7/14/30/90 days). Backend accepts either months[] or start_date/end_date params.d235e50
-
fix(report): python 3.9 compat — use typing.Dict/Optional/Set instead of 3.10+ syntax
GuilhermePMarques11c0e56 -
fix(report): rewrite data transfer — save HTML to temp file + download URL instead of broken base64-over-SSE
GuilhermePMarquesThe previous approach streamed the entire HTML file as base64 chunks via SSE events. XHR onprogress line-splitting caused chunks to be lost, producing a corrupt download (216KB of raw JSON with no HTML structure at all). New approach: - Backend saves the generated HTML to a temp file (data/temp_reports/) - SSE only carries lightweight progress events and a final success with file_id - New GET /api/retail-report/download/{file_id} serves the file via FileResponse - Frontend downloads the file via a simple anchor click (bulletproof)9ab18e2 -
fix(report): correct html template generation regex that broke DOM structure when injecting data
GuilhermePMarques12b972f -
fix(report): initialize polygons array before parsing attributes to avoid UnboundLocalError
GuilhermePMarques867992e -
fix(report): add missing logger import that crashed error handling stream
GuilhermePMarques913cbc9 -
fix(report): chunk base64 html string via sse to prevent network timeouts or payload truncation
GuilhermePMarquesa6a8066 -
fix(report): dynamically extract polygons from zip filenames and match project attributes mapping flexibly
GuilhermePMarques55f59d1 -
fix(report): parse csv correctly and handle missing data with sklearn dependency
GuilhermePMarquesbc14c87
-
fix(report): fetch aoi dimension instead of origin
GuilhermePMarques4f6693c -
fix(report): use fuzzy string matching for zip csv file loading
GuilhermePMarques61b7faf -
fix(report): re-add BaseModel import to retail_report.py
GuilhermePMarques708272e -
fix(report): rename project report to retail report and fix v2 api url
GuilhermePMarques0699088 -
fix: add project report generator card to index.html
GuilhermePMarques05f37f6 -
fix: remove local-only imports breaking docker build
GuilhermePMarques5ce46a7 -
feat: add project report generator tool
GuilhermePMarquesef7a186
-
feat: add polygon drawing map interaction to step 3 review
GuilhermePMarques47ed860 -
feat: add layer toggles and fullscreen mode to map review step
GuilhermePMarques208954b -
fix: correct _merge_rings logic for proper GeoJSON polygon assembly
GuilhermePMarquesad1d2ba -
fix: coerce state_id and city_id to strings to prevent 422 for non-BR countries
GuilhermePMarquesed71863 -
fix: replace IBGE codes with OSM relation IDs in states_BR.json
GuilhermePMarques1a38afd -
fix: populate cities_BR.json with 5571 municipalities from IBGE API
GuilhermePMarquesf7ec54f
-
chore: bump version to v1.2
GabrielJunqueira +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2d95368 -
fix: slider sync — dispatch input events after configureDualSliders, add cache busting
GuilhermePMarques0833da4 -
fix: dual-range slider sync — use .value for number inputs, add bidirectional sync
GuilhermePMarquesdc33f25 -
feat: sort View Current SFs list by most recent first (committed_at desc)
GabrielJunqueira266fd5e
-
chore: bump version to v1.1
GabrielJunqueirabdc21a2
-
feat: add Project Generator via API (Beta)
GuilhermePMarques8459fe1