pyconvexity 0.3.8.post7__py3-none-any.whl → 0.4.1__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 (48) hide show
  1. pyconvexity/__init__.py +87 -46
  2. pyconvexity/_version.py +1 -1
  3. pyconvexity/core/__init__.py +3 -5
  4. pyconvexity/core/database.py +111 -103
  5. pyconvexity/core/errors.py +16 -10
  6. pyconvexity/core/types.py +61 -54
  7. pyconvexity/data/__init__.py +0 -1
  8. pyconvexity/data/loaders/cache.py +65 -64
  9. pyconvexity/data/schema/01_core_schema.sql +134 -234
  10. pyconvexity/data/schema/02_data_metadata.sql +38 -168
  11. pyconvexity/data/schema/03_validation_data.sql +327 -264
  12. pyconvexity/data/sources/gem.py +169 -139
  13. pyconvexity/io/__init__.py +4 -10
  14. pyconvexity/io/excel_exporter.py +694 -480
  15. pyconvexity/io/excel_importer.py +817 -545
  16. pyconvexity/io/netcdf_exporter.py +66 -61
  17. pyconvexity/io/netcdf_importer.py +850 -619
  18. pyconvexity/models/__init__.py +109 -59
  19. pyconvexity/models/attributes.py +197 -178
  20. pyconvexity/models/carriers.py +70 -67
  21. pyconvexity/models/components.py +260 -236
  22. pyconvexity/models/network.py +202 -284
  23. pyconvexity/models/results.py +65 -55
  24. pyconvexity/models/scenarios.py +58 -88
  25. pyconvexity/solvers/__init__.py +5 -5
  26. pyconvexity/solvers/pypsa/__init__.py +3 -3
  27. pyconvexity/solvers/pypsa/api.py +150 -134
  28. pyconvexity/solvers/pypsa/batch_loader.py +165 -162
  29. pyconvexity/solvers/pypsa/builder.py +390 -291
  30. pyconvexity/solvers/pypsa/constraints.py +184 -162
  31. pyconvexity/solvers/pypsa/solver.py +968 -666
  32. pyconvexity/solvers/pypsa/storage.py +1377 -671
  33. pyconvexity/timeseries.py +63 -60
  34. pyconvexity/validation/__init__.py +14 -6
  35. pyconvexity/validation/rules.py +95 -84
  36. pyconvexity-0.4.1.dist-info/METADATA +46 -0
  37. pyconvexity-0.4.1.dist-info/RECORD +42 -0
  38. pyconvexity/data/__pycache__/__init__.cpython-313.pyc +0 -0
  39. pyconvexity/data/loaders/__pycache__/__init__.cpython-313.pyc +0 -0
  40. pyconvexity/data/loaders/__pycache__/cache.cpython-313.pyc +0 -0
  41. pyconvexity/data/schema/04_scenario_schema.sql +0 -122
  42. pyconvexity/data/schema/migrate_add_geometries.sql +0 -73
  43. pyconvexity/data/sources/__pycache__/__init__.cpython-313.pyc +0 -0
  44. pyconvexity/data/sources/__pycache__/gem.cpython-313.pyc +0 -0
  45. pyconvexity-0.3.8.post7.dist-info/METADATA +0 -138
  46. pyconvexity-0.3.8.post7.dist-info/RECORD +0 -49
  47. {pyconvexity-0.3.8.post7.dist-info → pyconvexity-0.4.1.dist-info}/WHEEL +0 -0
  48. {pyconvexity-0.3.8.post7.dist-info → pyconvexity-0.4.1.dist-info}/top_level.txt +0 -0
@@ -1,138 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pyconvexity
3
- Version: 0.3.8.post7
4
- Summary: Python library for energy system modeling and optimization with PyPSA
5
- Author-email: Convexity Team <info@convexity.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/bayesian-energy/convexity-js
8
- Project-URL: Repository, https://github.com/bayesian-energy/convexity-js
9
- Project-URL: Issues, https://github.com/bayesian-energy/convexity-js/issues
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Topic :: Scientific/Engineering
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- Requires-Dist: pandas>=1.5.0
22
- Requires-Dist: numpy>=1.21.0
23
- Requires-Dist: pyarrow>=10.0.0
24
- Provides-Extra: pypsa
25
- Requires-Dist: pypsa>=0.25.0; extra == "pypsa"
26
- Requires-Dist: networkx; extra == "pypsa"
27
- Requires-Dist: scipy; extra == "pypsa"
28
- Requires-Dist: xarray; extra == "pypsa"
29
- Provides-Extra: excel
30
- Requires-Dist: openpyxl>=3.0.0; extra == "excel"
31
- Requires-Dist: xlsxwriter>=3.0.0; extra == "excel"
32
- Provides-Extra: netcdf
33
- Requires-Dist: netcdf4>=1.6.0; extra == "netcdf"
34
- Requires-Dist: xarray>=2022.3.0; extra == "netcdf"
35
- Provides-Extra: data
36
- Requires-Dist: country-converter>=1.0.0; extra == "data"
37
- Requires-Dist: pyyaml>=6.0.0; extra == "data"
38
- Provides-Extra: dev
39
- Requires-Dist: pytest>=7.0.0; extra == "dev"
40
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
41
- Requires-Dist: black>=22.0.0; extra == "dev"
42
- Requires-Dist: isort>=5.10.0; extra == "dev"
43
- Requires-Dist: mypy>=1.0.0; extra == "dev"
44
- Requires-Dist: pre-commit>=2.20.0; extra == "dev"
45
- Provides-Extra: all
46
- Requires-Dist: pyconvexity[data,excel,netcdf,pypsa]; extra == "all"
47
-
48
- # PyConvexity
49
-
50
- **Energy system modeling library for optimization and analysis.**
51
-
52
- PyConvexity provides the core functionality of the [Convexity](https://github.com/bayesian-energy/convexity-js) desktop application as a reusable, pip-installable Python library.
53
-
54
- ## Installation
55
-
56
- ```bash
57
- pip install pyconvexity
58
- ```
59
-
60
- ## Quick Start
61
-
62
- ```python
63
- import pyconvexity as px
64
-
65
- # Create a new energy system model database
66
- px.create_database_with_schema("my_model.db")
67
-
68
- # Create a network
69
- with px.database_context("my_model.db") as conn:
70
- network_req = px.CreateNetworkRequest(
71
- name="My Energy Network",
72
- description="Example renewable energy system",
73
- start_time="2024-01-01 00:00:00",
74
- end_time="2024-01-02 00:00:00",
75
- time_resolution="H"
76
- )
77
- network_id = px.create_network(conn, network_req)
78
-
79
- # Create carriers (energy types)
80
- ac_carrier = px.create_carrier(conn, network_id, "AC")
81
-
82
- # Create components
83
- bus_id = px.create_component(
84
- conn, network_id, "BUS", "Main Bus",
85
- latitude=40.7128, longitude=-74.0060,
86
- carrier_id=ac_carrier
87
- )
88
-
89
- # Set component attributes
90
- px.set_static_attribute(conn, bus_id, "v_nom", px.StaticValue(230.0))
91
-
92
- conn.commit()
93
-
94
- print(f"✅ Created network {network_id} with bus {bus_id}")
95
- ```
96
-
97
- ## Features
98
-
99
- - **Database Management**: SQLite-based energy system model storage
100
- - **Component Modeling**: Buses, generators, loads, lines, storage, etc.
101
- - **Time Series Support**: Efficient storage and retrieval of temporal data
102
- - **Validation**: Built-in validation rules for energy system components
103
- - **PyPSA Integration**: Compatible with PyPSA energy system modeling
104
- - **Type Safety**: Full type hints and data validation
105
-
106
- ## Core Concepts
107
-
108
- ### Networks
109
- Energy system models organized as networks with time periods and carriers.
110
-
111
- ### Components
112
- Physical and virtual elements: buses, generators, loads, transmission lines, storage units, etc.
113
-
114
- ### Attributes
115
- Component properties that can be static values or time series data.
116
-
117
- ### Scenarios
118
- Different parameter sets for the same network topology.
119
-
120
- ## Documentation
121
-
122
- - **Full Documentation**: [Convexity Documentation](https://github.com/bayesian-energy/convexity-js)
123
- - **API Reference**: See docstrings in the code
124
- - **Examples**: Check the `examples/` directory
125
-
126
- ## Development
127
-
128
- PyConvexity is developed as part of the [Convexity](https://github.com/bayesian-energy/convexity-js) project by [Bayesian Energy](https://bayesianenergy.com).
129
-
130
- ## License
131
-
132
- MIT License - see [LICENSE](https://github.com/bayesian-energy/convexity-js/blob/main/LICENSE) file for details.
133
-
134
- ## Related Projects
135
-
136
- - **[Convexity](https://github.com/bayesian-energy/convexity-js)**: Desktop application for energy system modeling
137
- - **[PyPSA](https://pypsa.org/)**: Python for Power System Analysis
138
- - **[Linopy](https://linopy.readthedocs.io/)**: Linear optimization with Python
@@ -1,49 +0,0 @@
1
- pyconvexity/__init__.py,sha256=eiAFroO4n-z8F0jTLpJgBIO7vtSxu9ovu3G2N-qqpUo,4783
2
- pyconvexity/_version.py,sha256=TT4-Unz31te2wVt1PTzfm8_E_k8zxoNBZUtkxDpvnl0,27
3
- pyconvexity/timeseries.py,sha256=4p1Tdpa1otqDvCq2zppA4tw660sF_XWb8Xobib-cCms,11340
4
- pyconvexity/core/__init__.py,sha256=MgVa5rrRWIi2w1UI1P4leiBntvHeeOPv0Thm0DEXBHo,1209
5
- pyconvexity/core/database.py,sha256=M02q4UkJqAPeTXuwng9I7kHm16reJ7eq7wccWxnhE5I,15227
6
- pyconvexity/core/errors.py,sha256=HhrrOOEBJrzyB56_pmqh3NWvX6uHqWWNkdE5XM16rYI,2881
7
- pyconvexity/core/types.py,sha256=LkB49qklA-9ObI0br0IazfVxvWvYzQrYMdwzrqqAMYQ,11335
8
- pyconvexity/data/README.md,sha256=-tyDHVjqzfWbVvgM4yYYx8cysmgvFXI6plVQNxSHBmo,3156
9
- pyconvexity/data/__init__.py,sha256=BrgC3LGSlReLbC0EpM6UxywwUHxRvts379CvZFE0qWU,514
10
- pyconvexity/data/__pycache__/__init__.cpython-313.pyc,sha256=F2XXlQZlN5aoFmi7Ar1B3RW-DZjIUqp81fr3zNsPxpY,617
11
- pyconvexity/data/loaders/__init__.py,sha256=6xPtOmH2n1mNby7ZjA-2Mk9F48Q246RNsyMnCnJ6gwA,60
12
- pyconvexity/data/loaders/cache.py,sha256=nnz8bV3slSehOT0alexFga9tM1XoJqWHBGqaXvz132U,7299
13
- pyconvexity/data/loaders/__pycache__/__init__.cpython-313.pyc,sha256=AuT3aXy3v5gssxdD1_CBaKqNAVmDt6GBwFSyAe3jHow,265
14
- pyconvexity/data/loaders/__pycache__/cache.cpython-313.pyc,sha256=9_xMQN6AciMzbzhCmWAzvEKRXfRINmfRsO8Dyg0_CUQ,9804
15
- pyconvexity/data/schema/01_core_schema.sql,sha256=2kkEevAhXJtNnC-wca2bnyw0m11mjheh4g9MPZpwBAc,20865
16
- pyconvexity/data/schema/02_data_metadata.sql,sha256=oOfwa3PLY2_8rxKDD4cpDeqP5I_PdahcF8m6cSKStJM,10732
17
- pyconvexity/data/schema/03_validation_data.sql,sha256=1rKFi9y6jQ2OnfH32jnIKnZ5WtB8eG43hz0OVJhwn3w,58325
18
- pyconvexity/data/schema/04_scenario_schema.sql,sha256=sL4PySJNHIthXsnoJ2T5pdXUbpAi94ld0XGuU8LwNuQ,4641
19
- pyconvexity/data/schema/migrate_add_geometries.sql,sha256=ljTz2ZIvfRkHCjJiUbZJr7PvUxPv3UeLl3ADb9U7dWc,2710
20
- pyconvexity/data/sources/__init__.py,sha256=Dn6_oS7wB-vLjMj2YeXlmIl6hNjACbicimSabKxIWnc,108
21
- pyconvexity/data/sources/gem.py,sha256=Ft2pAYsWe1V9poRge2Q4xdNt15XkG-USSR0XR9KFmsY,14935
22
- pyconvexity/data/sources/__pycache__/__init__.cpython-313.pyc,sha256=9x5FyLxmTE5ZRaEFNSF375KBd_rDLY6pGHGSWPpcxxA,313
23
- pyconvexity/data/sources/__pycache__/gem.cpython-313.pyc,sha256=VA7v6miTbKJcSMwKElsRKwuyGP3ek95O3ALa133Lx_U,14476
24
- pyconvexity/io/__init__.py,sha256=glGzXBRGHROrTS8xe-RTGyRQUgsaksafxXVt9GpW63E,803
25
- pyconvexity/io/excel_exporter.py,sha256=pjgvTs5vq9K61mNOVutEzaH5Zx4FgrDG4Xc_YmXhE5o,48483
26
- pyconvexity/io/excel_importer.py,sha256=M7YcBqKUVzOMoR5HN-v8M2UnZgHRfhqgXBMUVD10-IQ,56898
27
- pyconvexity/io/netcdf_exporter.py,sha256=AMM-uXBj8sh86n5m57aZ6S7LulAyIx_HM-eM-26BrWQ,7428
28
- pyconvexity/io/netcdf_importer.py,sha256=nv4CYYqnbCBeznwCU_JGBMTbg-BGNpXKlsqbu2R8fTU,72152
29
- pyconvexity/models/__init__.py,sha256=2HMICM5WX1h0MzxGHkKwUrsc5Tm1-P1Yl_PA0OFmyFI,4309
30
- pyconvexity/models/attributes.py,sha256=LTvYF0hl56HeLjS8ZVocZWLhbLRTNhmZ5gUKxf93eSE,18254
31
- pyconvexity/models/carriers.py,sha256=-nmasYvsaUeYPY1B0QdzfF_eph2HUFb5n3KF3CFd-YI,3700
32
- pyconvexity/models/components.py,sha256=wWRdX6vErZrQhhLTnHBLDOnkmLjbHY2e9J9ITZJi3F8,18287
33
- pyconvexity/models/network.py,sha256=2oEZOeVotyAs-SJl-b73zJKzSBvJEa6n1ryM0wV-Nko,14762
34
- pyconvexity/models/results.py,sha256=zEbrFj7ReEBnKJz_Kpf__HfIuHoVsZvLpMoL4RobCYE,4030
35
- pyconvexity/models/scenarios.py,sha256=6pTfMusCQ6bwPUUFR_Wi1PUk3ZgCwG21uoTy667mZaM,3928
36
- pyconvexity/solvers/__init__.py,sha256=zoVf6T2Tmyj2XOeiVbEvaIMOX584orqCz1q9t1oXy0M,674
37
- pyconvexity/solvers/pypsa/__init__.py,sha256=KZqYDo7CvwB-5Kp784xxxtdn5kRcmn3gGSRlaQdDA4c,554
38
- pyconvexity/solvers/pypsa/api.py,sha256=si2VAvotQKk-hcNtT3bIWV0CE4EzSER94mxehPFm7M8,18015
39
- pyconvexity/solvers/pypsa/batch_loader.py,sha256=eQb8B11akQYtH3aK93WAOoXEI-ktk4imATw9gaYDNR4,13547
40
- pyconvexity/solvers/pypsa/builder.py,sha256=WrimcBvG4mNFLTrLq7131Ku0AXY_0oRKxfI81ywc5Cs,24460
41
- pyconvexity/solvers/pypsa/constraints.py,sha256=qosBSNe0pr4va4dMmQFM-ifJCNGAkhS1R2gerNmhaiQ,16266
42
- pyconvexity/solvers/pypsa/solver.py,sha256=7jaksRKMaQuFYWb7Pl7rw7Pu0kO5DPysQX2JtWdUbBc,72074
43
- pyconvexity/solvers/pypsa/storage.py,sha256=T-0qEryiEy_8G4KiscPoiiWvTPd_OGqpLczW0_Xm85E,87331
44
- pyconvexity/validation/__init__.py,sha256=_6SVqXkaDFqmagub_O064Zm_QIdBrOra-Gvvbo9vM4I,549
45
- pyconvexity/validation/rules.py,sha256=6Kak12BVfUpjmgB5B7Wre55eGc5e1dvIdFca-vN-IFI,9296
46
- pyconvexity-0.3.8.post7.dist-info/METADATA,sha256=pABuFQ8YuN_H4j8ATRJqO4QjBuYRB-RRVyPDNJxdLOI,4886
47
- pyconvexity-0.3.8.post7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
48
- pyconvexity-0.3.8.post7.dist-info/top_level.txt,sha256=wFPEDXVaebR3JO5Tt3HNse-ws5aROCcxEco15d6j64s,12
49
- pyconvexity-0.3.8.post7.dist-info/RECORD,,