core-lens 0.1.dev194__tar.gz → 0.1.dev196__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/PKG-INFO +1 -1
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/_version.py +2 -2
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/entity.py +14 -3
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/utils/polars_utils.py +1 -7
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/utils/spatial.py +16 -3
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/ISSUE_TEMPLATE/blank-proposal.yaml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/ISSUE_TEMPLATE/bug-report.yaml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/ISSUE_TEMPLATE/feature-request.yaml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/pull_request_template.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/workflows/ci.yml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/workflows/gh-pages.yml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/workflows/pre-release.yml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.github/workflows/release.yml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.gitignore +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.gitmessage +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.pre-commit-config.yaml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/.python-version +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/CONTRIBUTING.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/LICENSE +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/README.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/SKILLS.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/README.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_aoi.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_entity.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_export.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_polars_utils.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_result.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_schema.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_season.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_spatial.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/bench_view.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/benchmarks/run_all.sh +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/Makefile +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/make.bat +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/concepts.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/conf.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/export.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/index.rst +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/intro.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/logging.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/plots.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/plugins.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/queries.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/quickstart.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/docs/source/stats.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/examples/demo_mws.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/examples/demo_tehsil.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/hooks/mypy.sh +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/hooks/no-parquet-outside-fixtures.sh +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/hooks/pytest.sh +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/pyproject.toml +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/__main__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/aoi.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/namespaces/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/namespaces/plot.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/namespaces/stats.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/result.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/base/view.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/entities/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/entities/farms.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/entities/mws.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/entities/tehsil.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/entities/waterbody.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/export/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/export/formats.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/py.typed +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/schema/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/schema/detection.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/schema/profile.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/utils/__init__.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/utils/paths.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/src/core_lens/utils/season.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/fixtures/generate_fixtures.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/conftest.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_aoi.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_entities.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_entity.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_export.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_main.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_plot.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_polars_utils.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_profile.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_result.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_schema_detection.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_schema_profile.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_season.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_season_config.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_spatial.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_stats.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/tests/unit/test_view.py +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/usage.md +0 -0
- {core_lens-0.1.dev194 → core_lens-0.1.dev196}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: core-lens
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.dev196
|
|
4
4
|
Summary: Query, analyse, and visualise CoreStack's microwatershed and Earth science data through a clean, composable Python API.
|
|
5
5
|
Project-URL: Homepage, https://github.com/ApoorvaKashyap/core-lens
|
|
6
6
|
Project-URL: Issues, https://github.com/ApoorvaKashyap/core-lens/issues
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.1.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 1, '
|
|
21
|
+
__version__ = version = '0.1.dev196'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev196')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -475,7 +475,11 @@ class BaseEntity(ABC):
|
|
|
475
475
|
)
|
|
476
476
|
|
|
477
477
|
# --- Combine attribute and spatial filters into a single lazy pipeline ---
|
|
478
|
-
|
|
478
|
+
_so = self._storage_options or {}
|
|
479
|
+
lf = pl.scan_parquet(
|
|
480
|
+
parquet_scan_path(static),
|
|
481
|
+
storage_options=_so or None,
|
|
482
|
+
)
|
|
479
483
|
|
|
480
484
|
if attr_kwargs:
|
|
481
485
|
filter_expr = pl.lit(True)
|
|
@@ -510,11 +514,18 @@ class BaseEntity(ABC):
|
|
|
510
514
|
|
|
511
515
|
lookup_geoms = []
|
|
512
516
|
for entity_kwarg_name, entity_kwarg_val in entity_kwargs.items():
|
|
513
|
-
other_entity = _REGISTRY[entity_kwarg_name](
|
|
517
|
+
other_entity = _REGISTRY[entity_kwarg_name](
|
|
518
|
+
data_root=self._data_root,
|
|
519
|
+
storage_options=self._storage_options,
|
|
520
|
+
)
|
|
514
521
|
other_profile = other_entity.schema_profile
|
|
515
522
|
other_static = other_entity._resolve(other_entity.static_path)
|
|
516
523
|
|
|
517
|
-
|
|
524
|
+
other_so = other_entity._storage_options or {}
|
|
525
|
+
other_lf = pl.scan_parquet(
|
|
526
|
+
other_static,
|
|
527
|
+
storage_options=other_so or None,
|
|
528
|
+
)
|
|
518
529
|
match_expr = pl.lit(False)
|
|
519
530
|
other_schema = cached_read_schema(
|
|
520
531
|
other_static, other_entity._storage_options
|
|
@@ -150,12 +150,7 @@ def scan_with_key_filter(
|
|
|
150
150
|
2. **Time filter** — an optional Polars expression appended with ``&``,
|
|
151
151
|
pushed down when the Parquet file carries min/max column statistics.
|
|
152
152
|
|
|
153
|
-
``use_statistics=True``
|
|
154
|
-
the underlying ``pl.scan_parquet`` call so that:
|
|
155
|
-
|
|
156
|
-
* Row-group skipping via Parquet min/max statistics is always active.
|
|
157
|
-
* On wide Parquet files, column chunks within each row group are fetched
|
|
158
|
-
concurrently instead of serially — reduces round trips on S3.
|
|
153
|
+
``use_statistics=True`` is set explicitly on the underlying ``pl.scan_parquet`` call so that row-group skipping via Parquet min/max statistics is always active.
|
|
159
154
|
|
|
160
155
|
Args:
|
|
161
156
|
path (str): Absolute path or cloud URI to a Parquet file.
|
|
@@ -176,7 +171,6 @@ def scan_with_key_filter(
|
|
|
176
171
|
path,
|
|
177
172
|
hive_partitioning=True,
|
|
178
173
|
use_statistics=True,
|
|
179
|
-
parallel="columns",
|
|
180
174
|
storage_options=_so or None,
|
|
181
175
|
)
|
|
182
176
|
|
|
@@ -668,11 +668,15 @@ def execute_spatial_join(
|
|
|
668
668
|
):
|
|
669
669
|
# Pre-filter other_entity using its in-memory bounding box index
|
|
670
670
|
candidates = bbox_intersects_geometry(other_entity._index, primary_total_box)
|
|
671
|
+
other_so = getattr(other_entity, "_storage_options", None) or {}
|
|
671
672
|
if candidates.is_empty():
|
|
672
673
|
other_df = pl.DataFrame(schema={c: pl.Utf8 for c in other_cols})
|
|
673
674
|
else:
|
|
674
675
|
other_df = (
|
|
675
|
-
pl.scan_parquet(
|
|
676
|
+
pl.scan_parquet(
|
|
677
|
+
other_static,
|
|
678
|
+
storage_options=other_so or None,
|
|
679
|
+
)
|
|
676
680
|
.select(other_cols)
|
|
677
681
|
.join(
|
|
678
682
|
candidates.select(other_key_cols).lazy(),
|
|
@@ -682,7 +686,12 @@ def execute_spatial_join(
|
|
|
682
686
|
.collect()
|
|
683
687
|
)
|
|
684
688
|
else:
|
|
685
|
-
|
|
689
|
+
other_so = getattr(other_entity, "_storage_options", None) or {}
|
|
690
|
+
other_df = pl.read_parquet(
|
|
691
|
+
other_static,
|
|
692
|
+
columns=other_cols,
|
|
693
|
+
storage_options=other_so or None,
|
|
694
|
+
)
|
|
686
695
|
|
|
687
696
|
if other_df.is_empty():
|
|
688
697
|
other_geoms = np.array([])
|
|
@@ -847,8 +856,12 @@ def point_in_entities(
|
|
|
847
856
|
key_cols: list[str] = entity.key_cols
|
|
848
857
|
static_path: str = entity._resolve(entity.static_path)
|
|
849
858
|
|
|
859
|
+
so = getattr(entity, "_storage_options", None) or {}
|
|
850
860
|
geom_df = (
|
|
851
|
-
pl.scan_parquet(
|
|
861
|
+
pl.scan_parquet(
|
|
862
|
+
parquet_scan_path(static_path),
|
|
863
|
+
storage_options=so or None,
|
|
864
|
+
)
|
|
852
865
|
.select(key_cols + [geom_col])
|
|
853
866
|
.join(candidates.select(key_cols).lazy(), on=key_cols, how="semi")
|
|
854
867
|
.collect()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|