Metadata-Version: 2.4
Name: graphari
Version: 2.0.1
Summary: Municipal GPU/CPU graphs and reproducible epidemic forecasting in Mexico
Author: Hector Alessandro Milan
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/AlessandroMilan/Graph-ARI
Project-URL: Repository, https://github.com/AlessandroMilan/Graph-ARI
Project-URL: Issues, https://github.com/AlessandroMilan/Graph-ARI/issues
Project-URL: Documentation, https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/README.md
Keywords: graph,cugraph,geospatial,epidemiology,mexico,climate,forecasting,pytorch
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: networkx>=3.0
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Provides-Extra: gpu-cu12
Requires-Dist: cugraph-cu12==26.10.*; extra == "gpu-cu12"
Requires-Dist: cudf-cu12==26.10.*; extra == "gpu-cu12"
Requires-Dist: cupy-cuda12x[ctk]!=14.1.0,<15,>=14.0.1; extra == "gpu-cu12"
Requires-Dist: cuda-core<1.3,>=1.2; extra == "gpu-cu12"
Provides-Extra: gpu-cu13
Requires-Dist: cugraph-cu13==26.10.*; extra == "gpu-cu13"
Requires-Dist: cudf-cu13==26.10.*; extra == "gpu-cu13"
Requires-Dist: cupy-cuda13x[ctk]!=14.1.0,<15,>=14.0.1; extra == "gpu-cu13"
Provides-Extra: notebook
Requires-Dist: matplotlib>=3.7; extra == "notebook"
Requires-Dist: nbclient>=0.10; extra == "notebook"
Requires-Dist: nbformat>=5.10; extra == "notebook"
Requires-Dist: ipykernel>=6; extra == "notebook"
Requires-Dist: ipywidgets<9,>=8; extra == "notebook"
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: build>=1.2; extra == "test"
Provides-Extra: training
Requires-Dist: torch<3,>=2.10; extra == "training"
Requires-Dist: torch-geometric<3,>=2.6; extra == "training"
Dynamic: license-file

# Graph-ARI

Graph-ARI (`graphari`) provides weekly mortality and climate data for Mexico,
municipal graphs, and seven neural networks behind one training API. Explore
2,478 municipalities, train at municipality/state/national level, or reproduce
the supplied forecast comparisons without training a model.

**Start here:** [Reader guide](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/README.md) ·
[API reference](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/api/README.md) · [Notebook index](https://github.com/AlessandroMilan/Graph-ARI/blob/main/notebooks/README.md)

## Choose a reading path

| I want to… | Read | Run |
| --- | --- | --- |
| Understand the data and graphs | [Data and graphs](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/data-and-graphs.md) | [Visualize](https://github.com/AlessandroMilan/Graph-ARI/blob/main/notebooks/visualize.ipynb) |
| Train and use a neural network | [Training](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/training.md) | [Seven model notebooks](https://github.com/AlessandroMilan/Graph-ARI/blob/main/notebooks/README.md) |
| Reproduce manuscript tables and figures | [Reproducibility](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/reproducibility.md) | [Saved results](https://github.com/AlessandroMilan/Graph-ARI/blob/main/notebooks/reproduce_results.ipynb) |

For a first visit, follow the [six chapters in order](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/README.md#chapters).

## Install Graph-ARI 2.0.1

```bash
python -m pip install "graphari==2.0.1"
# For neural-network training and notebook execution:
python -m pip install "graphari[training,notebook]==2.0.1"
```

Version 2 adds the graph wrapper, optional native cuGraph operations, and the
unified forecasting API. Read the [release notes](https://github.com/AlessandroMilan/Graph-ARI/blob/main/CHANGELOG.md) for migration
from version 1.

For the saved forecast archive, all notebooks, and editable development,
use a full source checkout:

```bash
git clone https://github.com/AlessandroMilan/Graph-ARI.git
cd Graph-ARI
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[notebook]'
```

Python 3.10+ supports the base package. Python 3.12 is the tested environment.
The base installation works on CPU without PyTorch or NVIDIA libraries. See
[getting started](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/getting-started.md) for Windows activation, training,
optional GPU support, and interactive JupyterLab installation. The `notebook`
extra supplies execution tools; it does not install JupyterLab.

## A first graph

```python
import graphari as ga

graph = ga.build_graph(week="2025/53", backend="networkx")
features, municipality_ids = ga.get_node_feature_matrix(graph)
edge_index = ga.get_edge_index(graph, municipality_ids)
print(graph.number_of_nodes(), graph.number_of_edges())  # 2478 7203
print(features.shape, edge_index.shape)                  # (2478, 5) (2, 14406)
```

The [Graph wrapper](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/api/graphs.md#graph) supports inspection, subgraphs,
ego networks, and conversion. Native NVIDIA cuGraph topology is optional;
NetworkX supplies the CPU backend. PyTorch training devices are independent
of graph-backend selection.

## A first forecast

Install the [training dependencies](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/getting-started.md#training). Then all
seven models use the same interface:

```python
import graphari as ga

options = ga.LoadDefaults("GCN Conv", "State", "H", 12)
model = ga.Forecaster(**options).fit()
print(model.forecast())  # 12 future leads × 32 states
print(model.evaluate())  # Held-out consensus metrics, rounded to 2 decimals.
```

This preset allows up to 250 epochs. Begin with a
[short training check](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/training.md#start-with-a-short-run) before a full run.
H includes weather; MOH omits it. Available models are Dense, LSTM, GCN Conv,
GraphSAGE, ASTGCN, Graph-ARI (Graph WaveNet), and TCN.

## Reproduce saved results

From the repository root after installing `.[notebook]`:

```bash
python scripts/validate_results.py --results-dir results/reproducibility-reader
```

This scores the [210 saved forecasts](https://github.com/AlessandroMilan/Graph-ARI/blob/main/forecasts/README.md), verifies all 30
observation tables against bundled data, and generates numerical tables plus
seven PDF/600 dpi PNG figures. It needs neither training dependencies nor a GPU.
The [reproducibility chapter](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/reproducibility.md) maps outputs to manuscript
tables and figures and explains comparison rules and limitations.

## Repository map

| Directory | Contents |
| --- | --- |
| [docs](https://github.com/AlessandroMilan/Graph-ARI/blob/main/docs/README.md) | Ordered guide and public API reference |
| [graphari](https://github.com/AlessandroMilan/Graph-ARI/tree/main/graphari/) | Package and [bundled input CSVs](https://github.com/AlessandroMilan/Graph-ARI/blob/main/graphari/data/README.md) |
| [notebooks](https://github.com/AlessandroMilan/Graph-ARI/blob/main/notebooks/README.md) | Data walkthrough, results reproduction, seven training notebooks |
| [forecasts](https://github.com/AlessandroMilan/Graph-ARI/blob/main/forecasts/README.md) | 240 original CSVs: 210 forecasts and 30 observations, about 953 MB |
| [scripts](https://github.com/AlessandroMilan/Graph-ARI/blob/main/scripts/README.md) | Fresh-kernel notebook validators |
| [tests](https://github.com/AlessandroMilan/Graph-ARI/tree/main/tests/) | Data, backend, training, evaluation, and reporting checks |

Training inputs ship with the wheel. Saved forecasts, guides, and notebooks are
available in the repository and source distribution. Generated results and local
build artifacts are ignored by Git.

See [validation commands](https://github.com/AlessandroMilan/Graph-ARI/blob/main/scripts/README.md) and the tested
[CUDA training environment](https://github.com/AlessandroMilan/Graph-ARI/blob/main/requirements-training-cu129.txt).
Report problems through [GitHub Issues](https://github.com/AlessandroMilan/Graph-ARI/issues).
Code is licensed under [GPL-3.0-or-later](https://github.com/AlessandroMilan/Graph-ARI/blob/main/LICENSE).
