forked from ames-market/psst
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
From case2.m output dict:
dict_keys(['version', 'baseMVA', 'bus', 'gen', 'branch', 'gencost', 'order', 'et', 'success', 'iterations', 'getdoc'])
{'version': '2',
'baseMVA': 100.0,
'bus': array([[ 1.00000000e+00, 3.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00, 1.00000000e+00, 0.00000000e+00,
3.45000000e+02, 1.00000000e+00, 1.10000000e+00,
9.00000000e-01],
[ 2.00000000e+00, 1.00000000e+00, 2.50000000e+00,
1.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00, 9.99498967e-01, -7.16556448e-02,
3.45000000e+02, 1.00000000e+00, 1.10000000e+00,
9.00000000e-01]]),
'gen': array([[ 1. , 2.5 , 1.00362863, 300. ,
-300. , 1. , 100. , 1. ,
15. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. ,
0. ]]),
'branch': array([[ 1.00000000e+00, 2.00000000e+00, 0.00000000e+00,
5.00000000e-02, 0.00000000e+00, 2.50000000e+02,
2.50000000e+02, 2.50000000e+02, 0.00000000e+00,
0.00000000e+00, 1.00000000e+00, -3.60000000e+02,
3.60000000e+02, 2.50000000e+00, 1.00362863e+00,
-2.50000000e+00, -9.99999997e-01]]),
'gencost': array([[ 2., 1500., 0., 3., 0., 5., 0.]]),
'order': {'bus': {'e2i': <Compressed Sparse Column sparse array of dtype 'float64'
with 2 stored elements and shape (2, 1)>,
'i2e': array([[1.],
[2.]]),
'status': {'on': array([[1.],
[2.]]),
'off': array([], shape=(0, 1), dtype=float64)}},
'gen': {'e2i': 1.0, 'i2e': 1.0, 'status': {'on': 1.0, 'off': []}},
'branch': {'status': {'on': 1.0, 'off': []}},
'state': 'e',
'int': {'bus': array([[ 1.00000000e+00, 3.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00, 1.00000000e+00, 0.00000000e+00,
3.45000000e+02, 1.00000000e+00, 1.10000000e+00,
9.00000000e-01],
[ 2.00000000e+00, 1.00000000e+00, 2.50000000e+00,
1.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00, 9.99498967e-01, -7.16556448e-02,
3.45000000e+02, 1.00000000e+00, 1.10000000e+00,
9.00000000e-01]]),
'branch': array([[ 1.00000000e+00, 2.00000000e+00, 0.00000000e+00,
5.00000000e-02, 0.00000000e+00, 2.50000000e+02,
2.50000000e+02, 2.50000000e+02, 0.00000000e+00,
0.00000000e+00, 1.00000000e+00, -3.60000000e+02,
3.60000000e+02, 2.50000000e+00, 1.00362863e+00,
-2.50000000e+00, -9.99999997e-01]]),
'gen': array([[ 1. , 2.5 , 1.00362863, 300. ,
-300. , 1. , 100. , 1. ,
15. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. ,
0. ]])}},
'et': 0.05357098579406738,
'success': 1,
'iterations': 2.0,
'getdoc': {}}
The easier part is to include 'et', 'success', 'iterations'. As it serve as info, for export, place it on:
pd.DataFrame(
data={
"INFO": {
"version": getattr(self, "version", None),
"baseMVA": getattr(self, "baseMVA", None),
}
}
).to_csv(os.path.join(path, f"{prefix}info{suffix}.csv"))But the code need to be refactored to only add the keys when it is not None for 'et', 'success', 'iterations'.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels