fpowerkit 0.4.2__tar.gz → 0.5.0__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 (36) hide show
  1. fpowerkit-0.5.0/LICENSE +29 -0
  2. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/PKG-INFO +2 -5
  3. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/README.md +12 -2
  4. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/__init__.py +4 -0
  5. fpowerkit-0.5.0/fpowerkit/comb.py +28 -0
  6. fpowerkit-0.5.0/fpowerkit/fpowerkit.md +5211 -0
  7. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/island.py +5 -5
  8. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/solbase.py +32 -16
  9. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/solcmb.py +11 -5
  10. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/solcvx.py +3 -1
  11. fpowerkit-0.5.0/fpowerkit/soldc.py +116 -0
  12. fpowerkit-0.5.0/fpowerkit/soldcopf.py +184 -0
  13. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/soldist.py +6 -2
  14. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/solldf.py +11 -2
  15. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/solldf2.py +5 -3
  16. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/solnt.py +38 -20
  17. fpowerkit-0.5.0/fpowerkit/solpq.py +282 -0
  18. fpowerkit-0.5.0/fpowerkit/solsw.py +266 -0
  19. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/pyproject.toml +2 -7
  20. fpowerkit-0.4.2/LICENSE +0 -165
  21. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/.gitignore +0 -0
  22. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/desc.md +0 -0
  23. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/bus.py +0 -0
  24. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/cases.py +0 -0
  25. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/ess.py +0 -0
  26. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/gen.py +0 -0
  27. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/grid.py +0 -0
  28. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/line.py +0 -0
  29. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/lpwrapper.py +0 -0
  30. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/pvwind.py +0 -0
  31. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/soldss.py +0 -0
  32. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/fpowerkit/utils.py +0 -0
  33. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/main.py +0 -0
  34. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/test.py +0 -0
  35. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/test314t.py +0 -0
  36. {fpowerkit-0.4.2 → fpowerkit-0.5.0}/test_cmb.py +0 -0
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, fmy-xfk
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,13 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fpowerkit
3
- Version: 0.4.2
3
+ Version: 0.5.0
4
4
  Summary: A PDN solver with multiple solutions.
5
5
  Author: fmy-xfk
6
- License-Expression: MIT
6
+ License-Expression: BSD-3-Clause
7
7
  License-File: LICENSE
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Programming Language :: Python :: 3
11
8
  Requires-Python: >=3.8
12
9
  Requires-Dist: feasytools>=0.0.21
13
10
  Requires-Dist: numpy>=1.19.0
@@ -1,6 +1,10 @@
1
- # FPowerKit 配电网运算组件
1
+ # FPowerKit 电网运算组件
2
2
  **本仓库已上线PyPI**,您可以通过`pip install fpowerkit`直接以Python包的形式安装使用本仓库的代码!
3
3
 
4
+ ## 许可证变更
5
+
6
+ 为避免商用上的困难,自从2026年6月6日起发布的版本,改为BSD-3-Clause协议。之前发布的版本保持原有的协议不变。
7
+
4
8
  ## 安装
5
9
  不同的体验所需的安装命令有所不同:
6
10
 
@@ -15,9 +19,15 @@
15
19
  二次开发请使用完整版体验。
16
20
 
17
21
  ## 简介
18
- - FPowerKit是一个配电网求解组件,它包含电网的描述(含母线、发电机、线路、光伏、风机和储能等)和多种内置和外部求解方案:
22
+ - FPowerKit是一个电网求解组件,它包含电网的描述(含母线、发电机、线路、光伏、风机和储能等)和多种内置和外部求解方案:
19
23
  + (内置) 改进DistFlow配电网最优潮流 ([原理介绍](docs/principle.md))
24
+ + (内置) LinDistFlow配电网最优潮流 (支持cvxpy,scipy两种实现)
20
25
  + (内置) Newton-Raphson潮流计算
26
+ + (内置) PQ解耦法潮流计算
27
+ + (内置) 直流潮流计算
28
+ + (内置) 直流最优潮流计算
29
+ + (内置) 支持线路开断优化的直流最优潮流计算
30
+ + (内置) 自定义目标函数的最优化求解
21
31
  + (外接) OpenDSS配电网潮流计算
22
32
  + 最优潮流+潮流计算核验的混合方案
23
33
  - 对于最优潮流模型,优化目标为“发电成本最小”。发电成本模型为二次函数$f(x)=ax^2+bx+c$或者一次函数$f(x)=bx+c$。
@@ -14,4 +14,8 @@ from .soldss import *
14
14
  from .solldf import *
15
15
  from .solldf2 import *
16
16
  from .solnt import *
17
+ from .soldc import *
18
+ from .soldcopf import *
19
+ from .solpq import *
20
+ from .solsw import *
17
21
  from .utils import *
@@ -0,0 +1,28 @@
1
+ import os
2
+ import pathlib
3
+
4
+ def combine_py_files_to_md(root_dir, output_md):
5
+ """
6
+ Combines all .py files in the root directory and its subdirectories into a single Markdown file.
7
+ Each .py file is represented as a section with a header and a code block.
8
+ """
9
+ with open(output_md, 'w', encoding='utf-8') as md_file:
10
+ for py_file in pathlib.Path(root_dir).rglob('*.py'):
11
+ relative_path = py_file.relative_to(root_dir)
12
+ if relative_path.name == pathlib.Path(__file__).name:
13
+ continue
14
+ md_file.write(f"## {relative_path}\n\n")
15
+ md_file.write("```python\n")
16
+ try:
17
+ with open(py_file, 'r', encoding='utf-8') as f:
18
+ content = f.read()
19
+ md_file.write(content)
20
+ except Exception as e:
21
+ md_file.write(f"# Error reading file: {e}\n")
22
+ md_file.write("\n```\n\n")
23
+
24
+ if __name__ == "__main__":
25
+ current_dir = os.path.dirname(os.path.abspath(__file__))
26
+ output_file = os.path.join(current_dir, "fpowerkit.md")
27
+ combine_py_files_to_md(current_dir, output_file)
28
+ print(f"Combined Markdown file created at: {output_file}")