# well-routing
Calculate well routing based on IOC rate distribution models "8002 - Rate distribution", flowline models "8110 - FLOWLINE RATE" and manifold models "8200 - MANIFOLD RATE". Also queries a list of known wells, pipes and separators.

Creates a set of Nodes and Edges and converts them to a directed graph structure for pathfinding and optimization.


## Example Usage

The `populate.py` script demonstrates how to use these classes:

```python
from classes import Graph

start_time = "01-Dec-2025"
stop_time = "05-Dec-2025"
chosen_time = "01-Dec-2025 12:00"

g = Graph.get_asset_graph(
            stid_code=asset, start_time=start_time, stop_time=stop_time
        )
G = g.convert_to_networkx(timestamp=pd.to_datetime(chosen_time))

````

## Installation

### Install for use
Install from pypi using ```pip install well-routing```.

### Development
Clone repository ```git clone https://github.com/equinor/well-routing``` and install dependencies using uv ```uv sync```.

## Install with pygraphviz

### Mac 
Typically pygraph application is installed using brew on mac. ```brew install pygraph```.  

``` 
uv sync --all-extras \
    --config-settings=--global-option=build_ext \
    --config-settings=--global-option="-I$(brew --prefix graphviz)/include" \
    --config-settings=--global-option="-L$(brew --prefix graphviz)/lib"
```

### Windows
See install documentation at https://pygraphviz.github.io/documentation/stable/install.html#manual-download.


