From 19b31b460064a6803ddef2355737c4675dedaf8e Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Thu, 12 Mar 2026 15:03:09 +0800 Subject: [PATCH 1/3] fix(spp_graduation): add web_icon to Graduation menu and fix pre-existing README diffs - Added web_icon attribute to Graduation root menu to display the existing openspp-graduation-menu-icons.png icon - Regenerated READMEs for spp_aggregation, spp_metrics_core, and spp_metrics_services to match updated DESCRIPTION.md content --- spp_aggregation/README.rst | 127 +++++++++++----------- spp_graduation/views/graduation_menus.xml | 1 + spp_metrics_core/README.rst | 65 +++++++---- spp_metrics_services/README.rst | 107 ++++++++++-------- 4 files changed, 173 insertions(+), 127 deletions(-) diff --git a/spp_aggregation/README.rst b/spp_aggregation/README.rst index c080ad6b..5c16ba76 100644 --- a/spp_aggregation/README.rst +++ b/spp_aggregation/README.rst @@ -22,84 +22,87 @@ OpenSPP Aggregation Engine |badge1| |badge2| |badge3| -Unified aggregation engine for computing statistics, breakdowns, and -fairness metrics over scoped registrant populations. Supports multiple -scope types (CEL expressions, areas, spatial queries, explicit IDs) with -access control, caching, and privacy enforcement. +Unified aggregation service that all consumers (simulation API, GIS API, +dashboards) use to compute population statistics with demographic +breakdowns and privacy enforcement. Resolves a scope (CEL expression, +area, polygon, explicit IDs) to registrant IDs, computes requested +statistics, applies k-anonymity suppression, and caches results. Key Capabilities ~~~~~~~~~~~~~~~~ -- Define reusable aggregation scopes: CEL expression, area, area tag, - spatial polygon/buffer, or explicit registrant IDs -- Resolve scopes to registrant sets with union and intersection - operations -- Compute statistics (count, Gini) with extensible statistic registry - supporting CEL variables -- Role-based access control with per-user scope type restrictions, - dimension limits, and area constraints -- Result caching with configurable TTL per scope type and automatic - cleanup -- Privacy enforcement via k-anonymity suppression on computed results -- Convenience methods for area-based, expression-based, fairness, and - distribution queries +- Single entry point (``spp.aggregation.service.compute_aggregation``) + for all analytics queries +- Scope resolution: CEL expressions, admin areas, area tags, spatial + polygons/buffers, explicit IDs +- Multi-dimensional breakdown (up to 3 dimensions) using demographic + dimensions +- Result caching with configurable TTL and manual invalidation +- Per-user access rules controlling scope types, dimensions, and + k-anonymity thresholds Key Models ~~~~~~~~~~ -+----------------------------+----------+----------------------------+ -| Model | Type | Description | -+============================+==========+============================+ -| ``spp.aggregation.scope`` | Concrete | Configurable aggregation | -| | | scope definitions | -+----------------------------+----------+----------------------------+ -| ``spp | Concrete | Per-user/group access | -| .aggregation.access.rule`` | | control rules | -+----------------------------+----------+----------------------------+ -| ``spp | Concrete | Persistent cache entries | -| .aggregation.cache.entry`` | | with TTL | -+----------------------------+----------+----------------------------+ -| ``spp.ag | Abstract | Strategy-based scope | -| gregation.scope.resolver`` | | resolution service | -+----------------------------+----------+----------------------------+ -| ``spp.aggregation.cache`` | Abstract | Cache service with TTL and | -| | | cleanup | -+----------------------------+----------+----------------------------+ -| ``spp.aggreg | Abstract | Statistic computation | -| ation.statistic.registry`` | | registry (builtins + CEL) | -+----------------------------+----------+----------------------------+ -| ` | Abstract | Main aggregation entry | -| `spp.aggregation.service`` | | point | -+----------------------------+----------+----------------------------+ ++----------------------------------+----------------------------------+ +| Model | Description | ++==================================+==================================+ +| ``spp.aggregation.scope`` | Defines what to aggregate (CEL, | +| | area, polygon, explicit IDs) | ++----------------------------------+----------------------------------+ +| ``spp.aggregation.access.rule`` | Per-user/group access level, | +| | scope restrictions, k-threshold | ++----------------------------------+----------------------------------+ +| ``spp.aggregation.cache.entry`` | Cached aggregation results | ++----------------------------------+----------------------------------+ +| ``spp.aggregation.service`` | Abstract service: main | +| | aggregation entry point | ++----------------------------------+----------------------------------+ +| `` | Abstract service: resolves | +| spp.aggregation.scope.resolver`` | scopes to registrant IDs | ++----------------------------------+----------------------------------+ +| ``spp. | Abstract service: dispatches | +| aggregation.statistic.registry`` | statistic computation | ++----------------------------------+----------------------------------+ Configuration ~~~~~~~~~~~~~ -- Aggregation scopes: **Settings > Aggregation > Aggregation Scopes** -- Access rules: **Settings > Aggregation > Access Rules** -- Cache cleanup runs daily via scheduled action +After installing: + +1. Navigate to **Settings > Aggregation > Configuration > Scopes** to + define reusable scopes +2. Configure **Access Rules** to set per-user/group privacy levels and + scope restrictions +3. Verify the **Cache Cleanup** scheduled action is active under + **Settings > Technical > Scheduled Actions** + +UI Location +~~~~~~~~~~~ + +- **Menu**: Settings > Aggregation > Configuration > Scopes +- **Menu**: Settings > Aggregation > Configuration > Demographic + Dimensions +- **Menu**: Settings > Aggregation > Configuration > Access Rules Security ~~~~~~~~ -+----------------------------------+----------------------------------+ -| Group | Access | -+==================================+==================================+ -| ``spp_aggr | Read-only access to scopes and | -| egation.group_aggregation_read`` | cache | -+----------------------------------+----------------------------------+ -| ``spp_aggre | Read/write scopes and access | -| gation.group_aggregation_write`` | rules | -+----------------------------------+----------------------------------+ -| ``spp_aggreg | Implied by write group | -| ation.group_aggregation_viewer`` | | -+----------------------------------+----------------------------------+ -| ``spp_aggrega | Implied by viewer group | -| tion.group_aggregation_officer`` | | -+----------------------------------+----------------------------------+ -| ``spp_aggrega | Full access, implied by admin | -| tion.group_aggregation_manager`` | | -+----------------------------------+----------------------------------+ +============================= ============================= +Group Access +============================= ============================= +``group_aggregation_read`` Read scopes and cache entries +``group_aggregation_write`` Full CRUD on scopes and cache +``group_aggregation_manager`` Full CRUD on access rules +============================= ============================= + +Extension Points +~~~~~~~~~~~~~~~~ + +- Add new scope types by extending ``spp.aggregation.scope`` and + ``spp.aggregation.scope.resolver`` +- Register custom statistics via ``spp.aggregation.statistic.registry`` +- Override ``_compute_single_statistic()`` for custom computation logic Dependencies ~~~~~~~~~~~~ diff --git a/spp_graduation/views/graduation_menus.xml b/spp_graduation/views/graduation_menus.xml index e27d34c4..f17e7fc1 100644 --- a/spp_graduation/views/graduation_menus.xml +++ b/spp_graduation/views/graduation_menus.xml @@ -5,6 +5,7 @@ id="menu_graduation_root" name="Graduation" sequence="60" + web_icon="spp_graduation,static/description/openspp-graduation-menu-icons.png" groups="group_spp_graduation_user" /> diff --git a/spp_metrics_core/README.rst b/spp_metrics_core/README.rst index 0c303bfa..bd82c848 100644 --- a/spp_metrics_core/README.rst +++ b/spp_metrics_core/README.rst @@ -22,38 +22,63 @@ OpenSPP Metrics Core |badge1| |badge2| |badge3| -Unified metric foundation providing abstract base models for statistics, -simulations, and reporting across OpenSPP modules. +Shared foundation for all metric types in OpenSPP (statistics, +simulation metrics, and custom domain metrics). Provides an abstract +base model with identity, presentation, and categorization fields, plus +a hierarchical category system. Concrete metric modules inherit from the +base and add their own computation fields. Key Capabilities ~~~~~~~~~~~~~~~~ -- Abstract base model for defining reusable metrics with label, unit, - and decimal precision -- Hierarchical metric categories with unique code constraints -- Category tree with parent-child recursion prevention -- Default metric categories for population, coverage, targeting, and - distribution +- Abstract base model (``spp.metric.base``) with shared identity, + presentation, and metadata fields +- Hierarchical metric category system with unique codes +- Default categories: Demographics, Vulnerability, Programs, Geographic, + Economic, Fairness Key Models ~~~~~~~~~~ -+-------------------------+----------+----------------------------+ -| Model | Type | Description | -+=========================+==========+============================+ -| ``spp.metric.base`` | Abstract | Base fields and logic | -| | | inherited by concrete | -| | | metrics | -+-------------------------+----------+----------------------------+ -| ``spp.metric.category`` | Concrete | Hierarchical grouping of | -| | | metrics by domain | -+-------------------------+----------+----------------------------+ ++-------------------------+-------------------------------------------+ +| Model | Description | ++=========================+===========================================+ +| ``spp.metric.base`` | Abstract model inherited by all concrete | +| | metric types | ++-------------------------+-------------------------------------------+ +| ``spp.metric.category`` | Hierarchical categorization for | +| | organizing metrics | ++-------------------------+-------------------------------------------+ Configuration ~~~~~~~~~~~~~ -No configuration required. Default categories are created via data files -on install. +After installing, default metric categories are created automatically. +Add custom categories via **Settings > Technical > Metric Categories** +or in XML data files. + +UI Location +~~~~~~~~~~~ + +No standalone menu; library module consumed by ``spp_statistic``, +``spp_simulation``, and other metric modules. + +Security +~~~~~~~~ + +===================== ======================= +Group Access +===================== ======================= +``base.group_user`` Read categories +``base.group_system`` Full CRUD on categories +===================== ======================= + +Extension Points +~~~~~~~~~~~~~~~~ + +- Inherit ``spp.metric.base`` to create domain-specific metric models +- Add custom categories via XML data records referencing + ``spp.metric.category`` Dependencies ~~~~~~~~~~~~ diff --git a/spp_metrics_services/README.rst b/spp_metrics_services/README.rst index cfca8970..2e3a284f 100644 --- a/spp_metrics_services/README.rst +++ b/spp_metrics_services/README.rst @@ -22,68 +22,85 @@ OpenSPP Metrics Services |badge1| |badge2| |badge3| -Shared service layer providing demographic dimensions, fairness -analysis, distribution statistics, privacy enforcement, and breakdown -computation for OpenSPP aggregation and reporting modules. +Shared computation services for fairness analysis, distribution +statistics, demographic breakdowns, privacy enforcement, and dimension +caching. These abstract services are consumed by ``spp_aggregation``, +``spp_simulation``, GIS APIs, and dashboards. No standalone UI; provides +only programmatic service models. Key Capabilities ~~~~~~~~~~~~~~~~ -- Define demographic dimensions (gender, age group, disability) as - field-based or CEL expression-based -- Compute fairness metrics with disparity ratios and equity scores -- Calculate distribution statistics including Gini coefficient, Lorenz - curve, percentiles, and standard deviation -- Enforce k-anonymity privacy with complementary suppression to prevent - differencing attacks -- Compute multi-dimensional breakdowns of registrant populations -- Cache dimension evaluations using Odoo ORM cache for performance +- Fairness analysis: compute equity scores and disparity ratios across + demographic dimensions +- Distribution statistics: Gini coefficient, Lorenz curve, percentiles, + descriptive stats +- Demographic breakdowns: multi-dimensional grouping with cached CEL + evaluations +- Privacy enforcement: k-anonymity with complementary suppression to + prevent differencing attacks +- Configurable demographic dimensions: field-based or CEL + expression-based Key Models ~~~~~~~~~~ -+----------------------------+----------+----------------------------+ -| Model | Type | Description | -+============================+==========+============================+ -| ``s | Concrete | Configurable demographic | -| pp.demographic.dimension`` | | dimensions for breakdowns | -+----------------------------+----------+----------------------------+ -| ``spp | Abstract | ORM-cached dimension | -| .metrics.dimension.cache`` | | evaluation service | -+----------------------------+----------+----------------------------+ -| ``spp.metrics.fairness`` | Abstract | Fairness and equity | -| | | analysis service | -+----------------------------+----------+----------------------------+ -| `` | Abstract | Distribution statistics | -| spp.metrics.distribution`` | | (Gini, Lorenz, | -| | | percentiles) | -+----------------------------+----------+----------------------------+ -| ``spp.metrics.privacy`` | Abstract | K-anonymity enforcement | -| | | with complementary | -| | | suppression | -+----------------------------+----------+----------------------------+ -| ``spp.metrics.breakdown`` | Abstract | Multi-dimensional | -| | | population breakdown | -| | | service | -+----------------------------+----------+----------------------------+ ++---------------------------------+-----------------------------------+ +| Model | Description | ++=================================+===================================+ +| ``spp.demographic.dimension`` | Configurable dimension for | +| | breakdowns (field or CEL) | ++---------------------------------+-----------------------------------+ +| ``spp.metrics.fairness`` | Abstract service: equity/parity | +| | analysis | ++---------------------------------+-----------------------------------+ +| ``spp.metrics.distribution`` | Abstract service: distribution | +| | statistics | ++---------------------------------+-----------------------------------+ +| ``spp.metrics.breakdown`` | Abstract service: | +| | multi-dimensional grouping | ++---------------------------------+-----------------------------------+ +| ``spp.metrics.privacy`` | Abstract service: k-anonymity | +| | enforcement | ++---------------------------------+-----------------------------------+ +| ``spp.metrics.dimension.cache`` | Abstract service: dimension | +| | evaluation cache | ++---------------------------------+-----------------------------------+ Configuration ~~~~~~~~~~~~~ -- Demographic dimensions are managed via **Settings > Aggregation > - Demographic Dimensions** -- Default dimensions for gender and age group are created on install -- K-anonymity threshold defaults to 5 (configurable per access rule) +After installing: + +1. Default demographic dimensions (gender, disability, age group) are + created via data file +2. Add custom dimensions at **Settings > Aggregation > Configuration > + Demographic Dimensions** (menu provided by ``spp_aggregation``) + +UI Location +~~~~~~~~~~~ + +No standalone menu; extends existing views. Dimension management UI +provided by ``spp_aggregation``. Security ~~~~~~~~ -===================== ========================================== +===================== =================================== Group Access -===================== ========================================== -``base.group_user`` Read-only access to demographic dimensions -``base.group_system`` Full CRUD access to demographic dimensions -===================== ========================================== +===================== =================================== +``base.group_user`` Read demographic dimensions +``base.group_system`` Full CRUD on demographic dimensions +===================== =================================== + +Extension Points +~~~~~~~~~~~~~~~~ + +- Override ``_analyze_dimension()`` in ``spp.metrics.fairness`` for + custom analysis logic +- Add new dimension types by extending ``spp.demographic.dimension`` +- Override ``enforce()`` in ``spp.metrics.privacy`` for custom + suppression strategies Dependencies ~~~~~~~~~~~~ From e697aaa516b66f88f7d511cb83b8e505399bfbac Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Thu, 12 Mar 2026 15:12:48 +0800 Subject: [PATCH 2/3] fix: align README table column widths with CI Linux output Table column widths differ between macOS and Linux docutils rendering. Adjusted to match CI-generated output exactly. --- spp_aggregation/README.rst | 40 +++++++++++++++---------------- spp_metrics_core/README.rst | 18 +++++++------- spp_metrics_services/README.rst | 42 ++++++++++++++++----------------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/spp_aggregation/README.rst b/spp_aggregation/README.rst index 5c16ba76..8648e962 100644 --- a/spp_aggregation/README.rst +++ b/spp_aggregation/README.rst @@ -44,26 +44,26 @@ Key Capabilities Key Models ~~~~~~~~~~ -+----------------------------------+----------------------------------+ -| Model | Description | -+==================================+==================================+ -| ``spp.aggregation.scope`` | Defines what to aggregate (CEL, | -| | area, polygon, explicit IDs) | -+----------------------------------+----------------------------------+ -| ``spp.aggregation.access.rule`` | Per-user/group access level, | -| | scope restrictions, k-threshold | -+----------------------------------+----------------------------------+ -| ``spp.aggregation.cache.entry`` | Cached aggregation results | -+----------------------------------+----------------------------------+ -| ``spp.aggregation.service`` | Abstract service: main | -| | aggregation entry point | -+----------------------------------+----------------------------------+ -| `` | Abstract service: resolves | -| spp.aggregation.scope.resolver`` | scopes to registrant IDs | -+----------------------------------+----------------------------------+ -| ``spp. | Abstract service: dispatches | -| aggregation.statistic.registry`` | statistic computation | -+----------------------------------+----------------------------------+ ++----------------------------------------+----------------------------------+ +| Model | Description | ++========================================+==================================+ +| ``spp.aggregation.scope`` | Defines what to aggregate (CEL, | +| | area, polygon, explicit IDs) | ++----------------------------------------+----------------------------------+ +| ``spp.aggregation.access.rule`` | Per-user/group access level, | +| | scope restrictions, k-threshold | ++----------------------------------------+----------------------------------+ +| ``spp.aggregation.cache.entry`` | Cached aggregation results | ++----------------------------------------+----------------------------------+ +| ``spp.aggregation.service`` | Abstract service: main | +| | aggregation entry point | ++----------------------------------------+----------------------------------+ +| ``spp.aggregation.scope.resolver`` | Abstract service: resolves | +| | scopes to registrant IDs | ++----------------------------------------+----------------------------------+ +| ``spp.aggregation.statistic.registry`` | Abstract service: dispatches | +| | statistic computation | ++----------------------------------------+----------------------------------+ Configuration ~~~~~~~~~~~~~ diff --git a/spp_metrics_core/README.rst b/spp_metrics_core/README.rst index bd82c848..30fd2ef3 100644 --- a/spp_metrics_core/README.rst +++ b/spp_metrics_core/README.rst @@ -40,15 +40,15 @@ Key Capabilities Key Models ~~~~~~~~~~ -+-------------------------+-------------------------------------------+ -| Model | Description | -+=========================+===========================================+ -| ``spp.metric.base`` | Abstract model inherited by all concrete | -| | metric types | -+-------------------------+-------------------------------------------+ -| ``spp.metric.category`` | Hierarchical categorization for | -| | organizing metrics | -+-------------------------+-------------------------------------------+ ++-------------------------+--------------------------------------------+ +| Model | Description | ++=========================+============================================+ +| ``spp.metric.base`` | Abstract model inherited by all concrete | +| | metric types | ++-------------------------+--------------------------------------------+ +| ``spp.metric.category`` | Hierarchical categorization for organizing | +| | metrics | ++-------------------------+--------------------------------------------+ Configuration ~~~~~~~~~~~~~ diff --git a/spp_metrics_services/README.rst b/spp_metrics_services/README.rst index 2e3a284f..ef2ed5d1 100644 --- a/spp_metrics_services/README.rst +++ b/spp_metrics_services/README.rst @@ -45,27 +45,27 @@ Key Capabilities Key Models ~~~~~~~~~~ -+---------------------------------+-----------------------------------+ -| Model | Description | -+=================================+===================================+ -| ``spp.demographic.dimension`` | Configurable dimension for | -| | breakdowns (field or CEL) | -+---------------------------------+-----------------------------------+ -| ``spp.metrics.fairness`` | Abstract service: equity/parity | -| | analysis | -+---------------------------------+-----------------------------------+ -| ``spp.metrics.distribution`` | Abstract service: distribution | -| | statistics | -+---------------------------------+-----------------------------------+ -| ``spp.metrics.breakdown`` | Abstract service: | -| | multi-dimensional grouping | -+---------------------------------+-----------------------------------+ -| ``spp.metrics.privacy`` | Abstract service: k-anonymity | -| | enforcement | -+---------------------------------+-----------------------------------+ -| ``spp.metrics.dimension.cache`` | Abstract service: dimension | -| | evaluation cache | -+---------------------------------+-----------------------------------+ ++---------------------------------+------------------------------------+ +| Model | Description | ++=================================+====================================+ +| ``spp.demographic.dimension`` | Configurable dimension for | +| | breakdowns (field or CEL) | ++---------------------------------+------------------------------------+ +| ``spp.metrics.fairness`` | Abstract service: equity/parity | +| | analysis | ++---------------------------------+------------------------------------+ +| ``spp.metrics.distribution`` | Abstract service: distribution | +| | statistics | ++---------------------------------+------------------------------------+ +| ``spp.metrics.breakdown`` | Abstract service: | +| | multi-dimensional grouping | ++---------------------------------+------------------------------------+ +| ``spp.metrics.privacy`` | Abstract service: k-anonymity | +| | enforcement | ++---------------------------------+------------------------------------+ +| ``spp.metrics.dimension.cache`` | Abstract service: dimension | +| | evaluation cache | ++---------------------------------+------------------------------------+ Configuration ~~~~~~~~~~~~~ From 7f3f047143faa6fa944cd09a6302e113e9e2194e Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Thu, 12 Mar 2026 15:20:06 +0800 Subject: [PATCH 3/3] chore: add missing README.rst for spp_api_v2_simulation, spp_statistic, spp_statistic_studio These modules have DESCRIPTION.md files but their generated README.rst files were not committed, causing CI check-in step to fail. --- spp_api_v2_simulation/README.rst | 153 +++++++++++++++++++++++++++++++ spp_statistic/README.rst | 140 ++++++++++++++++++++++++++++ spp_statistic_studio/README.rst | 92 +++++++++++++++++++ 3 files changed, 385 insertions(+) create mode 100644 spp_api_v2_simulation/README.rst create mode 100644 spp_statistic/README.rst create mode 100644 spp_statistic_studio/README.rst diff --git a/spp_api_v2_simulation/README.rst b/spp_api_v2_simulation/README.rst new file mode 100644 index 00000000..3200fcd2 --- /dev/null +++ b/spp_api_v2_simulation/README.rst @@ -0,0 +1,153 @@ +====================== +OpenSPP Simulation API +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:341a99619ee4fc6dc0669b84803de47b0cf14405275a60681952e5cf1eb6025f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github + :target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_api_v2_simulation + :alt: OpenSPP/OpenSPP2 + +|badge1| |badge2| |badge3| + +FastAPI-based REST endpoints for simulation scenario management, +execution, comparison, and population aggregation. Provides external +systems (dashboards, mobile apps, third-party tools) programmatic access +to the simulation and analytics engine. + +Key Capabilities +~~~~~~~~~~~~~~~~ + +- CRUD operations on simulation scenarios with entitlement rules +- Execute simulations and retrieve run results (distribution, fairness, + geographic data) +- Compare multiple simulation runs side-by-side with overlap analysis +- Compute population aggregation with demographic breakdowns via the + aggregation engine +- List available demographic dimensions and scenario templates +- Convert simulation scenarios to real programs + +API Endpoints +~~~~~~~~~~~~~ + ++--------+-----------------------------+-----------------------------+ +| Method | Path | Description | ++========+=============================+=============================+ +| GET | ``/simulation/scenarios`` | List scenarios | ++--------+-----------------------------+-----------------------------+ +| POST | ``/simulation/scenarios`` | Create scenario | ++--------+-----------------------------+-----------------------------+ +| GET | ``/ | Get scenario details | +| | simulation/scenarios/{id}`` | | ++--------+-----------------------------+-----------------------------+ +| PUT | ``/ | Update draft scenario | +| | simulation/scenarios/{id}`` | | ++--------+-----------------------------+-----------------------------+ +| DELETE | ``/ | Archive scenario | +| | simulation/scenarios/{id}`` | | ++--------+-----------------------------+-----------------------------+ +| POST | ``/simula | Mark scenario ready | +| | tion/scenarios/{id}/ready`` | | ++--------+-----------------------------+-----------------------------+ +| POST | ``/simu | Execute simulation | +| | lation/scenarios/{id}/run`` | | ++--------+-----------------------------+-----------------------------+ +| POST | ``/simulation/scenario | Convert to program | +| | s/{id}/convert-to-program`` | | ++--------+-----------------------------+-----------------------------+ +| GET | ``/simulation/runs`` | List runs | ++--------+-----------------------------+-----------------------------+ +| GET | ``/simulation/runs/{id}`` | Get run with optional | +| | | details | ++--------+-----------------------------+-----------------------------+ +| POST | ``/simulation/comparisons`` | Create run comparison | ++--------+-----------------------------+-----------------------------+ +| GET | ``/si | Get comparison | +| | mulation/comparisons/{id}`` | | ++--------+-----------------------------+-----------------------------+ +| GET | ``/simulation/templates`` | List scenario templates | ++--------+-----------------------------+-----------------------------+ +| POST | ``/aggregation/compute`` | Compute population | +| | | aggregation | ++--------+-----------------------------+-----------------------------+ +| GET | ``/aggregation/dimensions`` | List demographic dimensions | ++--------+-----------------------------+-----------------------------+ + +OAuth Scopes +~~~~~~~~~~~~ + +====================== ==================================== +Scope Operations +====================== ==================================== +``simulation:read`` List/get scenarios, runs, templates +``simulation:write`` Create/update/archive scenarios +``simulation:execute`` Run simulations +``simulation:convert`` Convert scenario to program +``aggregation:read`` Compute aggregation, list dimensions +====================== ==================================== + +UI Location +~~~~~~~~~~~ + +No standalone menu; API-only module. + +Dependencies +~~~~~~~~~~~~ + +``spp_api_v2``, ``spp_simulation``, ``spp_aggregation`` + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* OpenSPP.org + +Maintainers +----------- + +.. |maintainer-jeremi| image:: https://github.com/jeremi.png?size=40px + :target: https://github.com/jeremi + :alt: jeremi +.. |maintainer-gonzalesedwin1123| image:: https://github.com/gonzalesedwin1123.png?size=40px + :target: https://github.com/gonzalesedwin1123 + :alt: gonzalesedwin1123 +.. |maintainer-reichie020212| image:: https://github.com/reichie020212.png?size=40px + :target: https://github.com/reichie020212 + :alt: reichie020212 + +Current maintainers: + +|maintainer-jeremi| |maintainer-gonzalesedwin1123| |maintainer-reichie020212| + +This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. + +You are welcome to contribute. \ No newline at end of file diff --git a/spp_statistic/README.rst b/spp_statistic/README.rst new file mode 100644 index 00000000..488bcd24 --- /dev/null +++ b/spp_statistic/README.rst @@ -0,0 +1,140 @@ +================== +OpenSPP Statistics +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7a18b540da680b64fe34c40ba13b6177cd957e3ccb919034b0fafdfa74d4339f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github + :target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_statistic + :alt: OpenSPP/OpenSPP2 + +|badge1| |badge2| |badge3| + +Publishable statistics layer that connects CEL variables to presentation +contexts (GIS maps, dashboards, APIs, reports). Each statistic wraps a +CEL variable with format, privacy thresholds, and per-context overrides +so a single computation can be published in multiple places with +different labels and suppression rules. + +Key Capabilities +~~~~~~~~~~~~~~~~ + +- Bind a CEL variable to one or more publication channels (GIS, + dashboard, API, report) +- Apply k-anonymity small-cell suppression with configurable thresholds + per context +- Override labels, formats, icons, and color thresholds for each + publication context +- Query published statistics by context and category +- Serialize statistics to dictionaries for API and UI consumption + +Key Models +~~~~~~~~~~ + ++---------------------------+-----------------------------------------+ +| Model | Description | ++===========================+=========================================+ +| ``spp.statistic`` | A publishable statistic linked to a CEL | +| | variable | ++---------------------------+-----------------------------------------+ +| ``spp.statistic.context`` | Per-context presentation and privacy | +| | overrides | ++---------------------------+-----------------------------------------+ + +Configuration +~~~~~~~~~~~~~ + +After installing: + +1. Create statistics via the Studio UI (requires + ``spp_statistic_studio``) or programmatically +2. Link each statistic to an active CEL variable +3. Enable publication flags (``is_published_gis``, + ``is_published_dashboard``, etc.) +4. Optionally add context-specific overrides for label, format, and + suppression threshold + +UI Location +~~~~~~~~~~~ + +No standalone menu; configuration UI is provided by +``spp_statistic_studio``. + +Security +~~~~~~~~ + +================================ ========= +Group Access +================================ ========= +``base.group_user`` Read +``spp_security.group_spp_admin`` Full CRUD +================================ ========= + +Extension Points +~~~~~~~~~~~~~~~~ + +- Override ``apply_suppression()`` to implement custom privacy rules +- Override ``get_context_config()`` to add context-specific logic +- Inherit ``spp.statistic`` to add domain-specific publication flags + +Dependencies +~~~~~~~~~~~~ + +``spp_cel_domain``, ``spp_metrics_core``, ``spp_security`` + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* OpenSPP.org + +Maintainers +----------- + +.. |maintainer-jeremi| image:: https://github.com/jeremi.png?size=40px + :target: https://github.com/jeremi + :alt: jeremi +.. |maintainer-gonzalesedwin1123| image:: https://github.com/gonzalesedwin1123.png?size=40px + :target: https://github.com/gonzalesedwin1123 + :alt: gonzalesedwin1123 + +Current maintainers: + +|maintainer-jeremi| |maintainer-gonzalesedwin1123| + +This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. + +You are welcome to contribute. \ No newline at end of file diff --git a/spp_statistic_studio/README.rst b/spp_statistic_studio/README.rst new file mode 100644 index 00000000..7c50c68a --- /dev/null +++ b/spp_statistic_studio/README.rst @@ -0,0 +1,92 @@ +========================= +OpenSPP Statistics Studio +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:89544c4d97fc4199ac6b8872bc737c9ef0ee2e07cc353b94bedf6c382620716b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github + :target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_statistic_studio + :alt: OpenSPP/OpenSPP2 + +|badge1| |badge2| |badge3| + +Bridge module that exposes statistics configuration in the Studio +no-code UI. Auto-installs when both ``spp_statistic`` and ``spp_studio`` +are present. Adds tree/form views for statistics and metric categories +under the Studio settings menu. + +Key Capabilities +~~~~~~~~~~~~~~~~ + +- Manage statistics (create, edit, archive) through Studio forms +- Manage metric categories through Studio forms +- Grants Studio managers full CRUD on statistics, contexts, and + categories + +Key Models +~~~~~~~~~~ + +No new models. Provides views and menu entries for ``spp.statistic``, +``spp.statistic.context``, and ``spp.metric.category``. + +UI Location +~~~~~~~~~~~ + +- **Menu**: Studio > Settings > Statistics > All Statistics +- **Menu**: Studio > Settings > Statistics > Categories + +Security +~~~~~~~~ + +=================================== ========= +Group Access +=================================== ========= +``spp_studio.group_studio_manager`` Full CRUD +=================================== ========= + +Dependencies +~~~~~~~~~~~~ + +``spp_statistic``, ``spp_studio`` + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* OpenSPP.org + +Maintainers +----------- + +This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. + +You are welcome to contribute. \ No newline at end of file