| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: add DashMap support for Plotly Dash (#2136) * Add DashMap component * feat: add DashMap support * style: auto-format (ruff + oxfmt) [pre-commit.ci] * Address CodeRabbit review feedback - DashMap front end: the app posts "geolibre:ready" only once per iframe load, so a project change on a mounted iframe never reached it. Track readiness in a ref and push the latest project when `project` changes after ready, mirroring the anywidget front end's ready + onProjectChange pattern. Message handlers now read the latest props through a ref (so a changed setProps is never stale) and each load carries an incrementing seq instead of a constant 1. - Add tests/dash-component-frontend.test.ts covering the ready handshake, the project-change-after-ready push (fails without the fix), the before-ready case, cross-origin/foreign-window rejection, and the click -> clickData mapping. - Install Dash in the publish-python test job and add it to the `dev` extra, so test_dashmap_requires_dash_or_has_component exercises the installed-Dash branch instead of only the ImportError fallback. Claude-Session: https://claude.ai/code/session_01J6hyqLp3Cfym5WGZjsxYTT --------- Co-authored-by: arich <arich@scwa.ca.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: giswqs <giswqs@gmail.com> | 29 天前 | |
ci(fmt): add ruff + oxfmt auto-format workflow and config (#1327) * ci(fmt): add ruff + oxfmt auto-format workflow and config Adds a GitHub Actions workflow that runs ruff format/check on Python and notebooks and oxfmt on JS/TS/JSON/CSS/YAML/TOML, then pushes a style commit back to the branch. Mirrors the local pre-commit hooks so CI and local runs produce identical output. - .github/workflows/format.yml: pinned ruff==0.15.22, oxfmt@0.59.0 - ruff.toml: line-length 100, rules F/I/W/E, py310 target - .oxfmtrc.json: width 100, double quotes, lockfile/generated excludes - .pre-commit-config.yaml: local ruff + oxfmt hooks (offline-friendly) - .gitattributes: normalize all text to LF, explicit binary rules - docs/contributing.md: document the new formatting pipeline * ci(fmt): switch auto-format from GitHub Actions to pre-commit.ci pre-commit.ci authenticates via its own GitHub App, so the auto-format bot can push fixes back on fork PRs (where GITHUB_TOKEN is read-only). It only runs on PRs, so auto-formatted commits never bypass review. - Delete .github/workflows/format.yml - Add autofix/autoupdate config to .pre-commit-config.yaml; the ruff and oxfmt version pins there are now the single source of truth - Trim ignorePatterns comments in .oxfmtrc.json - Rewrite the coding-conventions section in docs/contributing.md * ci(fmt): address review feedback on ruff.toml and .gitattributes - .gitattributes: add explicit binary rules for *.icns, *.pbf, *.pmtiles (icon.icns, MapLibre glyph pbfs, osm.pbf fixtures, and mini.pmtiles are all tracked in-repo; closes the explicit-safety-net gap flagged in review) - ruff.toml: drop the misleading lines-after-imports = -1 (no-op default) and its comment; add .ruff_cache to extend-exclude so the intent survives any future change to ruff's default exclusion list - .gitignore: ignore .ruff_cache/ - .pre-commit-config.yaml: drop the redundant `files: \.(py|ipynb)$` regex (types_or already scopes the ruff hooks to python/pyi/jupyter) and fix the nbstripout hook indentation * ci(fmt): exclude generated whitebox-menu-catalog from oxfmt The file is auto-generated by scripts/gen-whitebox-menu-catalog.mjs (its header says 'do not hand-edit'), so add it to .oxfmtrc.json's ignorePatterns alongside the other generated catalogs. * ci(fmt): run ruff check --fix before ruff format Lint autofixes (import sorting via I, unused-import removal via F) can change layout; the formatter must run last so a single pre-commit pass stabilizes the file. Matches the order recommended by ruff's docs and astral-sh/ruff-pre-commit. * Update .gitattributes Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * style: auto-format (ruff + oxfmt) [pre-commit.ci] * Address Claude review feedback - docs/contributing.md: note that oxfmt also sorts package.json keys into its conventional order, so contributors expect key reordering (not just whitespace changes) in future package.json diffs. * Address Claude review feedback - .oxfmtrc.json: drop the "python/**" ignore. It was a no-op for .py/.ipynb (the hook's types_or never passes them, and *.ipynb is excluded globally) while wrongly hiding real JS/TOML under python/ from oxfmt; the generated python/src/geolibre/static stays excluded via "**/static/**". Format the newly covered python/pyproject.toml and python/src/geolibre/_frontend.js. - ruff.toml: delete the [lint.pycodestyle] max-line-length block; it equaled the top-level line-length, which is already the default, so behavior is unchanged. Reworded the E-rules comment that pointed at it. - docs/contributing.md: restore the 2-space list-continuation indent on the mixed-line-ending bullet so the inline code span isn't split oddly. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Qiusheng Wu <giswqs@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> | 2 个月前 | |
feat: support xarray raster layers in Python API (#2105) * feat: support xarray raster layers in Python API Allow DataArray and Dataset inputs to be materialized as session-scoped COGs so they render directly in the browser. Include optional raster dependencies, focused tests, and a runnable notebook example. * style: auto-format (ruff + oxfmt) [pre-commit.ci] * Address CodeRabbit review feedback - Document raster dependencies included by the all extra. - Apply Dataset nodata metadata to each DataArray variable before COG export. * Address Claude review feedback - add stacklevel=2 to the "array_args is ignored" warning so it is attributed to the caller, matching every other warnings.warn in geolibre.py - register a weakref.finalize safety net for the GeoTIFFs materialized from xarray objects, so they are removed when the Map is collected and at interpreter exit rather than only on an explicit Map.close(); close() now clears the shared list in place so the finalizer stays valid afterwards, and the lifetime is documented in add_raster's docstring and docs/python.md - add a `vector` extra (geopandas + shapely) so environments that only need GeoDataFrame/local-vector support can opt out of the rasterio/GDAL stack that `all` now pulls in; document the split in docs/python.md and python/README.md - cover the finalizer cleanup path in python/tests/test_map.py * Address CodeRabbit review feedback - make the fake xarray Dataset.copy() return an independent Dataset (a new mapping over the same variables, as xarray's shallow copy does) instead of self, and assert the GeoTIFF is written from the copy rather than the caller's Dataset — removing the production data.copy() now fails the test * Address Claude review feedback - keep `add_raster(url=...)` working: the first parameter's rename to `source` broke that keyword for a published API, so `url` is back as a keyword-only deprecated alias that emits a DeprecationWarning, raises if combined with `source`, and still raises a clear TypeError when neither is given - carry the xarray behavior into skills/geolibre: the agent reference now documents `array_args` (variable, isel, x_dim/y_dim, crs, nodata, plus the rio.to_raster passthrough), the EPSG:4326-only-for-lon/lat rule and the errors raised otherwise, and the temp-file/close() cleanup caveat - cover the deprecated alias and both TypeErrors in python/tests/test_map.py * Address Claude review feedback - add `_server.unregister_local_file` and call it when a materialized GeoTIFF is removed: every xarray materialization writes to a fresh mkstemp path, so the token registry (which register_local_file scans linearly to dedup) grew one dead entry per add_raster call for the life of the kernel - pin the Dataset nodata path against real rioxarray: a round-trip test opens the written COG with rasterio and asserts the CRS, band count and nodata survive the copy + per-variable reassignment, which the fake xarray modules cannot model * Address CodeRabbit review feedback - note in the agent reference that `url=` remains a deprecated keyword alias of `add_raster`'s `source`, so an existing caller reading only the skill does not think the keyword was dropped - say that `driver` only defaults to "COG" and that overriding it through array_args really does change the written format, with the reason the default matters (the app range-reads a COG; a plain GeoTIFF is converted in the browser first) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 29 天前 | ||
| 2 个月前 | ||
| 1 个月前 |