Python package for building graph dataset from GDM system.
Project description
Welcome to Graph Dataset Repo
Installation
Use following commands to install
pip install gridai
Available commands
Use following command to see available commands.
gridai --help
You will see something like this.
Usage: gridai [OPTIONS] COMMAND [ARGS]...
Entry point
Options:
--help Show this message and exit.
Commands:
generate-dataset Command line function to generate geojsons from...
generate-stats Function to dump stats around the dataset.
How to create a dataset ?
The command generate-dataset
can convert all opendss models available in the parent folder by recursively searching for all valid opendss models.
gridai generate-dataset -j <system-json-path>
This will create a sqlite db file stroing all training data in pytorch.data.Data
format.
How to use the dataset ?
>>> from torch_geometric.data import SQLiteDatabase
>>> db = SQLiteDatabase(path="dataset.sqlite",name="data_table")
>>> len(db)
51
>>> db[0]
Data(x=[3], edge_index=[2, 2], edge_attr=[2])
Getting NodeObject and EdgeObject
You can use following snippet to convert node attributes back to an instance of
DistNodeAttrs
and edge attributes back to an DistEdgeAttrs
.
>>> from torch_geometric.data import SQLiteDatabase
>>> from gridai.interfaces import DistNodeAttrs, DistEdgeAttrs
>>> from rich import print
>>> db = SQLiteDatabase(path="dataset.sqlite",name="data_table")
>>> print(DistNodeAttrs.from_array(db[0].x[0]))
DistNodeAttrs(
node_type=<NodeType.LOAD: 2>,
active_demand_kw=5.726587772369385,
reactive_demand_kw=1.691259503364563,
active_generation_kw=0.0,
reactive_generation_kw=0.0,
phase_type=<PhaseType.NS1S2: 11>,
kv_level=0.1200888529419899
)
>>> print(DistEdgeAttrs.from_array(db[0].edge_attr[0]))
DistEdgeAttrs(
capacity_kva=25.0,
edge_type=<DistEdgeType.TRANSFORMER: 1>,
length_miles=0.0
)
Plotting the dataset
You can use following command to plot the dataset.
>>> from gridai.plot_dataset import plot_dataset
>>> from torch_geometric.data import SQLiteDatabase
>>> db = SQLiteDatabase(path="dataset.sqlite",name="data_table")
>>> plot_dataset(db[0])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gridai-1.1.0.tar.gz
.
File metadata
- Download URL: gridai-1.1.0.tar.gz
- Upload date:
- Size: 347.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dd8767435d4e30b2d36b706fd41ad8d6c6881a0c40ce8275bf02a97ee94e35e |
|
MD5 | a7805a73547135b6ccdebc7794509c87 |
|
BLAKE2b-256 | ba79227f8b5068a55b989ea4c0ad133cd23f15ae4f359e26ab2793b63b6f6a8c |
Provenance
The following attestation bundles were made for gridai-1.1.0.tar.gz
:
Publisher:
publish.yml
on NREL-Distribution-Suites/gridai
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
gridai-1.1.0.tar.gz
- Subject digest:
6dd8767435d4e30b2d36b706fd41ad8d6c6881a0c40ce8275bf02a97ee94e35e
- Sigstore transparency entry: 150888209
- Sigstore integration time:
- Predicate type:
File details
Details for the file gridai-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: gridai-1.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6d3305a67a61fd681d8bb451add88c5cc5aeb50a2f05476d45bef17d8cf3b94 |
|
MD5 | 2b2415dd56e2f33944cfb4b6ea2d3ddd |
|
BLAKE2b-256 | 7c03807b91922814a17d2fff856884dfbc9ed5f20bb42028b1a27a3e3165f751 |
Provenance
The following attestation bundles were made for gridai-1.1.0-py3-none-any.whl
:
Publisher:
publish.yml
on NREL-Distribution-Suites/gridai
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
gridai-1.1.0-py3-none-any.whl
- Subject digest:
c6d3305a67a61fd681d8bb451add88c5cc5aeb50a2f05476d45bef17d8cf3b94
- Sigstore transparency entry: 150888210
- Sigstore integration time:
- Predicate type: