core-lens 0.1.dev153__tar.gz → 0.1.dev155__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.dev153 → core_lens-0.1.dev155}/PKG-INFO +1 -1
- core_lens-0.1.dev155/src/core_lens/__main__.py +36 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/_version.py +2 -2
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/namespaces/stats.py +9 -3
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_main.py +5 -1
- core_lens-0.1.dev153/src/core_lens/__main__.py +0 -14
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/ISSUE_TEMPLATE/blank-proposal.yaml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/ISSUE_TEMPLATE/bug-report.yaml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/ISSUE_TEMPLATE/feature-request.yaml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/pull_request_template.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/workflows/ci.yml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/workflows/gh-pages.yml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/workflows/pre-release.yml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.github/workflows/release.yml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.gitignore +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.gitmessage +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.pre-commit-config.yaml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/.python-version +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/CONTRIBUTING.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/LICENSE +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/README.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/SKILLS.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/README.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_aoi.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_export.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_polars_utils.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_result.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_schema.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_season.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_spatial.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/bench_view.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/benchmarks/run_all.sh +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/Makefile +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/make.bat +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/concepts.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/conf.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/export.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/index.rst +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/intro.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/logging.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/plots.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/plugins.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/queries.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/quickstart.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/docs/source/stats.md +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/examples/demo_mws.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/examples/demo_tehsil.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/hooks/mypy.sh +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/hooks/no-parquet-outside-fixtures.sh +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/hooks/pytest.sh +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/pyproject.toml +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/aoi.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/entity.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/namespaces/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/namespaces/plot.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/result.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/base/view.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/entities/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/entities/mws.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/entities/tehsil.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/entities/waterbody.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/export/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/export/formats.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/py.typed +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/schema/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/schema/detection.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/schema/profile.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/utils/__init__.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/utils/paths.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/utils/polars_utils.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/utils/season.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/src/core_lens/utils/spatial.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/fixtures/generate_fixtures.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/conftest.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_aoi.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_entities.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_entity.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_export.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_plot.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_polars_utils.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_profile.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_result.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_schema_detection.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_schema_profile.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_season.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_season_config.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_spatial.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_stats.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/tests/unit/test_view.py +0 -0
- {core_lens-0.1.dev153 → core_lens-0.1.dev155}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-lens
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.dev155
|
|
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
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from . import __version__
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def hello() -> str:
|
|
5
|
+
hello_str = """Hello from core-lens!
|
|
6
|
+
|
|
7
|
+
The following primary capabilities are available:
|
|
8
|
+
- AoI: Construct Area of Interest queries (e.g., `AoI(district="Godda")`)
|
|
9
|
+
- Result: Lazy evaluation and computation graph materialisation
|
|
10
|
+
|
|
11
|
+
Analytics (via `result.stats`):
|
|
12
|
+
- anomaly(): Timeseries and cross-sectional anomaly detection
|
|
13
|
+
- change(): Absolute, percentage, and trend changes over time
|
|
14
|
+
- similarity(): Multi-feature similarity search across entities
|
|
15
|
+
- test(): Statistical hypothesis testing
|
|
16
|
+
- correlate(): Feature correlation analysis
|
|
17
|
+
|
|
18
|
+
Visualisation (via `result.plot`):
|
|
19
|
+
- choropleth(): Interactive Lonboard spatial mapping
|
|
20
|
+
- timeseries(): Temporal data visualisation
|
|
21
|
+
- scatter(): Scatter plots for variable comparison
|
|
22
|
+
- distribution(): Histograms and density plots
|
|
23
|
+
- correlation(): Correlation heatmaps between variables
|
|
24
|
+
- heatmap(): 2D density/binned heatmaps
|
|
25
|
+
- matrix(): Scatter matrix/pair plots
|
|
26
|
+
"""
|
|
27
|
+
return hello_str
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def version() -> str:
|
|
31
|
+
return str(__version__)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if __name__ == "__main__":
|
|
35
|
+
print(hello())
|
|
36
|
+
print(f"Version: {version()}")
|
|
@@ -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.dev155'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev155')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -489,18 +489,24 @@ class StatsNamespace:
|
|
|
489
489
|
)
|
|
490
490
|
|
|
491
491
|
if method in (ChangeMethod.ABSOLUTE, ChangeMethod.PERCENTAGE):
|
|
492
|
+
join_keys = [key]
|
|
493
|
+
if "season" in df.columns:
|
|
494
|
+
join_keys.append("season")
|
|
495
|
+
|
|
492
496
|
from_df = (
|
|
493
497
|
df.filter(pl.col(year_col) == from_period)
|
|
494
|
-
.select([
|
|
498
|
+
.select(join_keys + [column])
|
|
495
499
|
.rename({column: "value_from"})
|
|
496
500
|
)
|
|
497
501
|
to_df = (
|
|
498
502
|
df.filter(pl.col(year_col) == to_period)
|
|
499
|
-
.select([
|
|
503
|
+
.select(join_keys + [column])
|
|
500
504
|
.rename({column: "value_to"})
|
|
501
505
|
)
|
|
502
|
-
joined = from_df.join(to_df, on=
|
|
506
|
+
joined = from_df.join(to_df, on=join_keys, how="inner").with_columns(
|
|
503
507
|
[
|
|
508
|
+
pl.lit(from_period).alias("year_from").cast(pl.Int32),
|
|
509
|
+
pl.lit(to_period).alias("year_to").cast(pl.Int32),
|
|
504
510
|
(pl.col("value_to") - pl.col("value_from")).alias("change"),
|
|
505
511
|
(
|
|
506
512
|
(pl.col("value_to") - pl.col("value_from"))
|
|
@@ -8,7 +8,11 @@ def test_version() -> None:
|
|
|
8
8
|
def test_hello() -> None:
|
|
9
9
|
from core_lens.__main__ import hello
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
msg = hello()
|
|
12
|
+
assert msg.startswith("Hello from core-lens!")
|
|
13
|
+
assert "AoI: Construct Area of Interest queries" in msg
|
|
14
|
+
assert "Analytics (via `result.stats`):" in msg
|
|
15
|
+
assert "Visualisation (via `result.plot`):" in msg
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
def test_version_type() -> None:
|
|
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
|