fpowerkit 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/PKG-INFO +17 -5
  2. fpowerkit-0.2.2/README.md +62 -0
  3. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/soldist.py +5 -2
  4. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/soldss.py +4 -1
  5. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/solgcal.py +4 -1
  6. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit.egg-info/PKG-INFO +17 -5
  7. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit.egg-info/requires.txt +0 -2
  8. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/setup.py +2 -2
  9. fpowerkit-0.2.1/README.md +0 -44
  10. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/LICENSE +0 -0
  11. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/__init__.py +0 -0
  12. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/bus.py +0 -0
  13. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/cases.py +0 -0
  14. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/ess.py +0 -0
  15. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/gen.py +0 -0
  16. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/grid.py +0 -0
  17. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/line.py +0 -0
  18. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/pvwind.py +0 -0
  19. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/solbase.py +0 -0
  20. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/solcmb.py +0 -0
  21. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/solnt.py +0 -0
  22. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit/utils.py +0 -0
  23. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit.egg-info/SOURCES.txt +0 -0
  24. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit.egg-info/dependency_links.txt +0 -0
  25. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/fpowerkit.egg-info/top_level.txt +0 -0
  26. {fpowerkit-0.2.1 → fpowerkit-0.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fpowerkit
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Distflow PDN solver based on Gurobi.
5
5
  Author: fmy_xfk
6
6
  Classifier: Programming Language :: Python :: 3
@@ -10,9 +10,7 @@ Requires-Python: >=3.8
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: feasytools>=0.0.21
13
- Requires-Dist: cvxpy>=1.0
14
13
  Requires-Dist: numpy>=1.20.0
15
- Requires-Dist: ecos
16
14
  Dynamic: author
17
15
  Dynamic: classifier
18
16
  Dynamic: description
@@ -25,13 +23,27 @@ Dynamic: summary
25
23
 
26
24
  This is a package designed for power distribution network solving.
27
25
 
26
+ This package is affiliated to V2Sim, an open-aource microscopic V2G simulation platform in urban power and transportation network. If you are using the modified DistFlow model in this package, please cite the [paper](https://ieeexplore.ieee.org/document/10970754):
27
+
28
+ ```
29
+ @ARTICLE{10970754,
30
+ author={Qian, Tao and Fang, Mingyu and Hu, Qinran and Shao, Chengcheng and Zheng, Junyi},
31
+ journal={IEEE Transactions on Smart Grid},
32
+ title={V2Sim: An Open-Source Microscopic V2G Simulation Platform in Urban Power and Transportation Network},
33
+ year={2025},
34
+ pages={1-1},
35
+ keywords={Vehicle-to-grid;Partial discharges;Microscopy;Batteries;Planning;Discharges (electric);Optimization;Vehicle dynamics;Transportation;Roads;EV charging load simulation;microscopic EV behavior;Vehicle-to-grid;charging station fault sensing},
36
+ doi={10.1109/TSG.2025.3560976}}
37
+
38
+ ```
39
+
28
40
  There are 3 modes for this package to work:
29
41
 
30
42
  - Optimal power flow (OPF): Use cvxpy to solve the optimal power flow and determine the output of the generators.
31
43
 
32
- - Power flow calculation: Use OpenDSS or Netwon-Raphson method to solve the power flow with given generator ouputs.
44
+ - Power flow calculation: Use OpenDSS/GridCal/Inner Newton-Raphson method to solve the power flow.
33
45
 
34
- - Hybrid: Use OPF to determine the initial value, and then use OpenDSS or Newton method to perform accurate calculation.
46
+ - Hybrid: Use OPF to determine the initial value, and then use OpenDSS/GridCal/Inner Newton-Raphson to perform accurate calculation.
35
47
 
36
48
  Since this package is still under development, the API is unstable and may be changed anytime.
37
49
 
@@ -0,0 +1,62 @@
1
+ # FPowerKit 配电网运算组件
2
+ **本仓库已上线PyPI**,您可以通过`pip install fpowerkit`直接以Python包的形式安装使用本仓库的代码!
3
+
4
+ 这个项目是[V2Sim](https://gitee.com/fmy_xfk/v2sim)的附属项目。V2Sim的论文请见如下链接
5
+
6
+ - 正式版:https://ieeexplore.ieee.org/document/10970754
7
+
8
+ - 早期版本:https://arxiv.org/abs/2412.09808
9
+
10
+ 如果你正在使用本项目中的**改进配电网DistFlow模型**,请引用[V2Sim正式版论文](https://ieeexplore.ieee.org/document/10970754):
11
+
12
+ ```
13
+ @ARTICLE{10970754,
14
+ author={Qian, Tao and Fang, Mingyu and Hu, Qinran and Shao, Chengcheng and Zheng, Junyi},
15
+ journal={IEEE Transactions on Smart Grid},
16
+ title={V2Sim: An Open-Source Microscopic V2G Simulation Platform in Urban Power and Transportation Network},
17
+ year={2025},
18
+ pages={1-1},
19
+ keywords={Vehicle-to-grid;Partial discharges;Microscopy;Batteries;Planning;Discharges (electric);Optimization;Vehicle dynamics;Transportation;Roads;EV charging load simulation;microscopic EV behavior;Vehicle-to-grid;charging station fault sensing},
20
+ doi={10.1109/TSG.2025.3560976}}
21
+
22
+ ```
23
+
24
+ IEEE33和IEEE69节点的配网数据从公开渠道收集。除配网数据以外,本仓库代码均遵循LGPL3.0协议使用。
25
+
26
+ ## 简介
27
+ - 依赖于feasytools和numpy: `pip install feasytools numpy`(请自行安装Gurobi并申请许可证)
28
+ - 包含电网的描述(含母线、发电机、线路、光伏、风机和储能等)和改进配电网DistFlow模型求解。
29
+ - 优化目标为“发电成本最小”。发电成本模型为二次函数$f(x)=ax^2+bx+c$或者一次函数$f(x)=bx+c$。
30
+ - 内含IEEE 33节点配电网和IEEE 69节点配电网,可通过以下方式快速创建:
31
+ ```py
32
+ from fpowerkit import PDNCases
33
+ grid_obj33 = PDNCases.IEEE33()
34
+ grid_obj69 = PDNCases.IEEE69()
35
+ ```
36
+
37
+ ## 使用
38
+
39
+ 克隆本仓库,并输入以下命令开始求解:
40
+
41
+ ```bash
42
+ python main.py -g cases/33base.xml
43
+ ```
44
+
45
+ 请注意上述命令不适用于pip安装的版本。
46
+
47
+ `33base`描述了IEEE 33节点配电网模型。换成`3nodes`则是一个极简版3节点辐射形配电网模型,结构如下:
48
+
49
+ ```
50
+ G0 G1
51
+ | |
52
+ B0->B1->B2
53
+ | |
54
+ L1 L2
55
+ ```
56
+
57
+ 您也换成自己的配电网文件来求解,例如`python main.py -g path/to/your_case.xml`
58
+
59
+ ## 配电网文件格式
60
+ [XML格式](docs/xml_file.md)
61
+
62
+ ZIP格式已经不再支持。
@@ -212,8 +212,11 @@ class DistFlowSolver(SolverBase):
212
212
  P[i,j]: Line active power
213
213
  Q[i,j]: Line reactive power
214
214
  '''
215
- import cvxpy as cp
216
- from cvxpy import Variable as Var
215
+ try:
216
+ import cvxpy as cp
217
+ from cvxpy import Variable as Var
218
+ except ImportError:
219
+ raise ImportError("cvxpy or ecos is not installed. Please install them using 'pip install cvxpy ecos'")
217
220
  cons:list[cp.Constraint] = []
218
221
  # Create GEN vars
219
222
  pg0: 'dict[str, VF]' = {}
@@ -4,7 +4,10 @@ class OpenDSSSolver(SolverBase):
4
4
  def __init__(self, grid:Grid, eps:float = 1e-6, max_iter:int = 1000, *,
5
5
  default_saveto:str = DEFAULT_SAVETO, source_bus:str, init_t:int = 0):
6
6
  super().__init__(grid, eps, max_iter, default_saveto = default_saveto)
7
- from py_dss_interface import DSS
7
+ try:
8
+ from py_dss_interface import DSS
9
+ except ImportError:
10
+ raise ImportError("py_dss_interface or OpenDSS is not installed. Please install OpenDSS first and then py_dss_interface using 'pip install py_dss_interface'")
8
11
  self._g = grid
9
12
  t = init_t
10
13
  d = DSS()
@@ -4,7 +4,10 @@ from .solbase import *
4
4
  class GridCalSolver(SolverBase):
5
5
  def __init__(self, grid:Grid, eps:float = 1e-6, max_iter:int = 1000, *, default_saveto:str = DEFAULT_SAVETO,
6
6
  slack_bus:str, slack_gen:str = "", init_t:int = 0):
7
- import GridCalEngine as gce
7
+ try:
8
+ import GridCalEngine as gce
9
+ except ImportError:
10
+ raise ImportError("GridCalEngine is not installed. Please install it using 'pip install GridCalEngine'")
8
11
  super().__init__(grid, eps, max_iter, default_saveto = default_saveto)
9
12
  self.max_iter = max_iter
10
13
  self._g = grid
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fpowerkit
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Distflow PDN solver based on Gurobi.
5
5
  Author: fmy_xfk
6
6
  Classifier: Programming Language :: Python :: 3
@@ -10,9 +10,7 @@ Requires-Python: >=3.8
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: feasytools>=0.0.21
13
- Requires-Dist: cvxpy>=1.0
14
13
  Requires-Dist: numpy>=1.20.0
15
- Requires-Dist: ecos
16
14
  Dynamic: author
17
15
  Dynamic: classifier
18
16
  Dynamic: description
@@ -25,13 +23,27 @@ Dynamic: summary
25
23
 
26
24
  This is a package designed for power distribution network solving.
27
25
 
26
+ This package is affiliated to V2Sim, an open-aource microscopic V2G simulation platform in urban power and transportation network. If you are using the modified DistFlow model in this package, please cite the [paper](https://ieeexplore.ieee.org/document/10970754):
27
+
28
+ ```
29
+ @ARTICLE{10970754,
30
+ author={Qian, Tao and Fang, Mingyu and Hu, Qinran and Shao, Chengcheng and Zheng, Junyi},
31
+ journal={IEEE Transactions on Smart Grid},
32
+ title={V2Sim: An Open-Source Microscopic V2G Simulation Platform in Urban Power and Transportation Network},
33
+ year={2025},
34
+ pages={1-1},
35
+ keywords={Vehicle-to-grid;Partial discharges;Microscopy;Batteries;Planning;Discharges (electric);Optimization;Vehicle dynamics;Transportation;Roads;EV charging load simulation;microscopic EV behavior;Vehicle-to-grid;charging station fault sensing},
36
+ doi={10.1109/TSG.2025.3560976}}
37
+
38
+ ```
39
+
28
40
  There are 3 modes for this package to work:
29
41
 
30
42
  - Optimal power flow (OPF): Use cvxpy to solve the optimal power flow and determine the output of the generators.
31
43
 
32
- - Power flow calculation: Use OpenDSS or Netwon-Raphson method to solve the power flow with given generator ouputs.
44
+ - Power flow calculation: Use OpenDSS/GridCal/Inner Newton-Raphson method to solve the power flow.
33
45
 
34
- - Hybrid: Use OPF to determine the initial value, and then use OpenDSS or Newton method to perform accurate calculation.
46
+ - Hybrid: Use OPF to determine the initial value, and then use OpenDSS/GridCal/Inner Newton-Raphson to perform accurate calculation.
35
47
 
36
48
  Since this package is still under development, the API is unstable and may be changed anytime.
37
49
 
@@ -1,4 +1,2 @@
1
1
  feasytools>=0.0.21
2
- cvxpy>=1.0
3
2
  numpy>=1.20.0
4
- ecos
@@ -5,7 +5,7 @@ with open("desc.md", "r", encoding="utf8") as f:
5
5
 
6
6
  setup(
7
7
  name="fpowerkit",
8
- version="0.2.1",
8
+ version="0.2.2",
9
9
  author="fmy_xfk",
10
10
  packages=find_packages(),
11
11
  description="A Distflow PDN solver based on Gurobi.",
@@ -17,5 +17,5 @@ setup(
17
17
  "Operating System :: OS Independent",
18
18
  ],
19
19
  python_requires=">=3.8",
20
- install_requires=["feasytools>=0.0.21", "cvxpy>=1.0", "numpy>=1.20.0", "ecos"],
20
+ install_requires=["feasytools>=0.0.21", "numpy>=1.20.0"],
21
21
  )
fpowerkit-0.2.1/README.md DELETED
@@ -1,44 +0,0 @@
1
- # FPowerKit 配电网运算组件
2
- **本仓库已上线PyPI**,您可以通过`pip install fpowerkit`直接以Python包的形式安装使用本仓库的代码!
3
-
4
- 这个项目是[V2Sim](https://gitee.com/fmy_xfk/v2sim)的附属项目。V2Sim的论文请见arXiv: https://arxiv.org/abs/2412.09808
5
-
6
- IEEE33和IEEE69节点的配网数据从公开渠道收集。除配网数据以外,本仓库代码均遵循LGPL3.0协议使用。
7
-
8
- ## 简介
9
- - 依赖于feasytools和gurobipy: `pip install feasytools gurobipy`(请自行安装Gurobi并申请许可证)
10
- - 包含电网的描述(含母线、发电机、线路等)和采用Gurobi的配电网DistFlow模型求解。
11
- - 优化目标为“发电成本最小”。发电成本模型为二次函数$f(x)=ax^2+bx+c$。
12
- - 内含IEEE 33节点配电网和IEEE 69节点配电网,可通过以下方式快速创建:
13
- ```py
14
- from fpowerkit import PDNCases
15
- grid_obj33 = PDNCases.IEEE33()
16
- grid_obj69 = PDNCases.IEEE69()
17
- ```
18
-
19
- ## 使用
20
-
21
- 克隆本仓库,并输入以下命令开始求解:
22
-
23
- ```bash
24
- python main.py -g cases/33base.xml
25
- ```
26
-
27
- 请注意上述命令不适用于pip安装的版本。
28
-
29
- `33base`描述了IEEE 33节点配电网模型。换成`3nodes`则是一个极简版3节点辐射形配电网模型,结构如下:
30
-
31
- ```
32
- G0 G1
33
- | |
34
- B0->B1->B2
35
- | |
36
- L1 L2
37
- ```
38
-
39
- 您也换成自己的配电网文件来求解,例如`python main.py -g path/to/your_zipfile.zip`
40
-
41
- ## 配电网文件格式
42
- [XML格式](docs/xml_file.md)
43
-
44
- ZIP格式已经不再支持。
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes