powfacpy 0.4.2__py2.py3-none-any.whl

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 (64) hide show
  1. powfacpy/__init__.py +15 -0
  2. powfacpy/applications/__init__.py +0 -0
  3. powfacpy/applications/application_base.py +21 -0
  4. powfacpy/applications/caching.py +23 -0
  5. powfacpy/applications/database - Copy.py +768 -0
  6. powfacpy/applications/database.py +420 -0
  7. powfacpy/applications/dynamic_model_docs.py +35 -0
  8. powfacpy/applications/dynamic_simulation.py +377 -0
  9. powfacpy/applications/model_exchange.py +219 -0
  10. powfacpy/applications/networks.py +125 -0
  11. powfacpy/applications/pandapower_interface.py +342 -0
  12. powfacpy/applications/pandas_interface.py +91 -0
  13. powfacpy/applications/parameter_studies.py +460 -0
  14. powfacpy/applications/plots.py +947 -0
  15. powfacpy/applications/results.py +642 -0
  16. powfacpy/applications/static_calc.py +47 -0
  17. powfacpy/applications/study_cases.py +735 -0
  18. powfacpy/applications/topology.py +255 -0
  19. powfacpy/base/__init__.py +0 -0
  20. powfacpy/base/active_project.py +980 -0
  21. powfacpy/base/base.py +80 -0
  22. powfacpy/base/folder.py +1559 -0
  23. powfacpy/base/functional.py +33 -0
  24. powfacpy/base/string_manipulation.py +264 -0
  25. powfacpy/deprecated/active_project_interface.py +635 -0
  26. powfacpy/deprecated/case_studies.py +719 -0
  27. powfacpy/deprecated/database_interface.py +152 -0
  28. powfacpy/deprecated/dyn_sim_interface.py +328 -0
  29. powfacpy/deprecated/folders_interface.py +1360 -0
  30. powfacpy/deprecated/model_exchange_interfaces.py +224 -0
  31. powfacpy/deprecated/network_interface.py +103 -0
  32. powfacpy/deprecated/plot_interface.py +837 -0
  33. powfacpy/deprecated/results_interface.py +509 -0
  34. powfacpy/deprecated/script_interface.py +315 -0
  35. powfacpy/engineering_helpers.py +29 -0
  36. powfacpy/exceptions.py +139 -0
  37. powfacpy/pf_class_protocols.py +4 -0
  38. powfacpy/pf_classes/__init__.py +0 -0
  39. powfacpy/pf_classes/blk/definition.py +211 -0
  40. powfacpy/pf_classes/blk/slot.py +77 -0
  41. powfacpy/pf_classes/elm/__init__.py +0 -0
  42. powfacpy/pf_classes/elm/area.py +64 -0
  43. powfacpy/pf_classes/elm/boundary.py +144 -0
  44. powfacpy/pf_classes/elm/comp.py +85 -0
  45. powfacpy/pf_classes/elm/dsl.py +53 -0
  46. powfacpy/pf_classes/elm/elm_base.py +50 -0
  47. powfacpy/pf_classes/elm/file.py +149 -0
  48. powfacpy/pf_classes/elm/grouping_base.py +84 -0
  49. powfacpy/pf_classes/elm/sym.py +140 -0
  50. powfacpy/pf_classes/elm/term.py +93 -0
  51. powfacpy/pf_classes/elm/zone.py +64 -0
  52. powfacpy/pf_classes/protocol_generator.py +304 -0
  53. powfacpy/pf_classes/protocols.py +41876 -0
  54. powfacpy/pf_classes/set/__init__.py +0 -0
  55. powfacpy/pf_classes/set/colscheme.py +42 -0
  56. powfacpy/pf_classes/sta/__init__.py +0 -0
  57. powfacpy/pf_classes/sta/pll.py +31 -0
  58. powfacpy/pf_elm_objects.py +412 -0
  59. powfacpy/result_variables.py +50298 -0
  60. powfacpy/result_variables_parser.py +158 -0
  61. powfacpy-0.4.2.dist-info/METADATA +50 -0
  62. powfacpy-0.4.2.dist-info/RECORD +64 -0
  63. powfacpy-0.4.2.dist-info/WHEEL +5 -0
  64. powfacpy-0.4.2.dist-info/licenses/LICENSE +19 -0
powfacpy/__init__.py ADDED
@@ -0,0 +1,15 @@
1
+ """Wrapper for the native API of PowerFactory.
2
+ """
3
+
4
+ from .deprecated.folders_interface import *
5
+ from .deprecated.active_project_interface import *
6
+ from .deprecated.dyn_sim_interface import *
7
+ from .deprecated.plot_interface import *
8
+ from .deprecated.case_studies import *
9
+ from .deprecated.network_interface import *
10
+ from .deprecated.results_interface import *
11
+ from .deprecated.script_interface import *
12
+ from .deprecated.database_interface import *
13
+ from .deprecated.model_exchange_interfaces import *
14
+
15
+ from .base.active_project import ActiveProject, ActiveProjectCached
File without changes
@@ -0,0 +1,21 @@
1
+ from powfacpy.base.active_project import ActiveProjectCached, ActiveProject
2
+ from powfacpy.pf_class_protocols import PFApp
3
+
4
+
5
+ class ApplicationBase:
6
+ """Base class for applications. Allows to create versions with
7
+ - ActiveProjectCached (recommended when only one project stays active)
8
+ - or ActiveProject (recommended when the active project may change)
9
+ """
10
+
11
+ def __init__(
12
+ self, pf_app: PFApp | None | bool = False, cached: bool = False
13
+ ) -> None:
14
+ if cached:
15
+ self.act_prj: ActiveProjectCached = ActiveProjectCached(pf_app)
16
+ else:
17
+ self.act_prj: ActiveProject = ActiveProject(pf_app)
18
+
19
+ @property
20
+ def app(self):
21
+ return self.act_prj.__class__.app
@@ -0,0 +1,23 @@
1
+ """Module to cache attributes and methods of PF objects to improve performance.
2
+ """
3
+
4
+ from powfacpy.pf_classes.protocols import PFGeneral
5
+
6
+
7
+ def cache_attr(obj: PFGeneral, attr: str):
8
+ obj.__dict__[attr] = obj.__getattr__(attr)
9
+
10
+
11
+ def cache_attrs(obj: PFGeneral, attrs: list[str]):
12
+ for attr in attrs:
13
+ obj.__dict__[attr] = obj.__getattr__(attr)
14
+
15
+
16
+ def cache_method(obj: PFGeneral, method: str):
17
+ return_val = getattr(obj, method)()
18
+ obj.__dict__[method] = lambda: return_val
19
+
20
+
21
+ def cache_methods(obj: PFGeneral, methods: list[str]):
22
+ for method in methods:
23
+ cache_method(obj, method)