openenergyid 0.1.12__tar.gz → 0.1.13__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.

Potentially problematic release.


This version of openenergyid might be problematic. Click here for more details.

Files changed (47) hide show
  1. {openenergyid-0.1.12 → openenergyid-0.1.13}/PKG-INFO +1 -1
  2. {openenergyid-0.1.12 → openenergyid-0.1.13}/demo_energiedelen.ipynb +79 -79
  3. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/__init__.py +1 -1
  4. openenergyid-0.1.13/openenergyid/energysharing/__init__.py +12 -0
  5. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/energysharing/data_formatting.py +0 -3
  6. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/energysharing/models.py +32 -8
  7. openenergyid-0.1.12/openenergyid/energysharing/__init__.py +0 -6
  8. {openenergyid-0.1.12 → openenergyid-0.1.13}/.devcontainer/devcontainer.json +0 -0
  9. {openenergyid-0.1.12 → openenergyid-0.1.13}/.github/workflows/python-publish.yml +0 -0
  10. {openenergyid-0.1.12 → openenergyid-0.1.13}/.github/workflows/ruff.yml +0 -0
  11. {openenergyid-0.1.12 → openenergyid-0.1.13}/.gitignore +0 -0
  12. {openenergyid-0.1.12 → openenergyid-0.1.13}/.pre-commit-config.yaml +0 -0
  13. {openenergyid-0.1.12 → openenergyid-0.1.13}/LICENSE +0 -0
  14. {openenergyid-0.1.12 → openenergyid-0.1.13}/README.md +0 -0
  15. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/da_prices_be.json +0 -0
  16. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/dyntar/demo_dyntar_analysis.html +0 -0
  17. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/dyntar/sample.json +0 -0
  18. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/dyntar/sample_output.json +0 -0
  19. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/energiedelen/Optimaal_1.png +0 -0
  20. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/energiedelen/Optimaal_2.png +0 -0
  21. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/energiedelen/Relatief.png +0 -0
  22. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/energiedelen/Vast.png +0 -0
  23. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/mvlr/sample_gas.json +0 -0
  24. {openenergyid-0.1.12 → openenergyid-0.1.13}/data/mvlr/sample_solar.json +0 -0
  25. {openenergyid-0.1.12 → openenergyid-0.1.13}/demo_dyntar_analysis.ipynb +0 -0
  26. {openenergyid-0.1.12 → openenergyid-0.1.13}/demo_energyid_download.ipynb +0 -0
  27. {openenergyid-0.1.12 → openenergyid-0.1.13}/demo_mvlr.ipynb +0 -0
  28. {openenergyid-0.1.12 → openenergyid-0.1.13}/download_prices.ipynb +0 -0
  29. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/const.py +0 -0
  30. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/dyntar/__init__.py +0 -0
  31. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/dyntar/const.py +0 -0
  32. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/dyntar/main.py +0 -0
  33. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/dyntar/models.py +0 -0
  34. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/energysharing/const.py +0 -0
  35. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/energysharing/main.py +0 -0
  36. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/enums.py +0 -0
  37. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/models.py +0 -0
  38. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/mvlr/__init__.py +0 -0
  39. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/mvlr/helpers.py +0 -0
  40. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/mvlr/main.py +0 -0
  41. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/mvlr/models.py +0 -0
  42. {openenergyid-0.1.12 → openenergyid-0.1.13}/openenergyid/mvlr/mvlr.py +0 -0
  43. {openenergyid-0.1.12 → openenergyid-0.1.13}/pyproject.toml +0 -0
  44. {openenergyid-0.1.12 → openenergyid-0.1.13}/requirements-dev.txt +0 -0
  45. {openenergyid-0.1.12 → openenergyid-0.1.13}/requirements.txt +0 -0
  46. {openenergyid-0.1.12 → openenergyid-0.1.13}/tests/__init__.py +0 -0
  47. {openenergyid-0.1.12 → openenergyid-0.1.13}/tests/data/mvlr/sample.dat +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openenergyid
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: Open Source Python library for energy analytics and simulations
5
5
  Project-URL: Homepage, https://energyid.eu
6
6
  Project-URL: Repository, https://github.com/EnergieID/OpenEnergyID
@@ -27,7 +27,7 @@
27
27
  "outputs": [],
28
28
  "source": [
29
29
  "from openenergyid import TimeDataFrame\n",
30
- "from openenergyid.energysharing import EnergySharingInput, EnergySharingOutput, calculate, CalculationMethod"
30
+ "from openenergyid.energysharing import EnergySharingInput, EnergySharingOutput, calculate, CalculationMethod, KeyInput"
31
31
  ]
32
32
  },
33
33
  {
@@ -388,10 +388,10 @@
388
388
  "input = EnergySharingInput.model_construct(\n",
389
389
  " gross_injection=TimeDataFrame.from_pandas(gross_injection),\n",
390
390
  " gross_offtake=TimeDataFrame.from_pandas(gross_offtake),\n",
391
- " key=TimeDataFrame.from_pandas(key),\n",
391
+ " key=KeyInput.from_pandas(key)\n",
392
392
  ")\n",
393
393
  "\n",
394
- "df = input.data_frame()"
394
+ "df = input.to_pandas()"
395
395
  ]
396
396
  },
397
397
  {
@@ -448,7 +448,7 @@
448
448
  " </thead>\n",
449
449
  " <tbody>\n",
450
450
  " <tr>\n",
451
- " <th>2024-01-01 12:00:00+01:00</th>\n",
451
+ " <th>2024-01-01 11:00:00+00:00</th>\n",
452
452
  " <td>70</td>\n",
453
453
  " <td>10</td>\n",
454
454
  " <td>20</td>\n",
@@ -469,7 +469,7 @@
469
469
  " <td>0.225</td>\n",
470
470
  " </tr>\n",
471
471
  " <tr>\n",
472
- " <th>2024-01-01 12:15:00+01:00</th>\n",
472
+ " <th>2024-01-01 11:15:00+00:00</th>\n",
473
473
  " <td>20</td>\n",
474
474
  " <td>10</td>\n",
475
475
  " <td>30</td>\n",
@@ -490,7 +490,7 @@
490
490
  " <td>0.225</td>\n",
491
491
  " </tr>\n",
492
492
  " <tr>\n",
493
- " <th>2024-01-01 12:30:00+01:00</th>\n",
493
+ " <th>2024-01-01 11:30:00+00:00</th>\n",
494
494
  " <td>100</td>\n",
495
495
  " <td>10</td>\n",
496
496
  " <td>40</td>\n",
@@ -511,7 +511,7 @@
511
511
  " <td>0.225</td>\n",
512
512
  " </tr>\n",
513
513
  " <tr>\n",
514
- " <th>2024-01-01 12:45:00+01:00</th>\n",
514
+ " <th>2024-01-01 11:45:00+00:00</th>\n",
515
515
  " <td>0</td>\n",
516
516
  " <td>10</td>\n",
517
517
  " <td>50</td>\n",
@@ -538,24 +538,24 @@
538
538
  "text/plain": [
539
539
  " Gross Injection Gross Offtake \\\n",
540
540
  " P1 P2 P3 P4 P5 P6 P1 P2 \n",
541
- "2024-01-01 12:00:00+01:00 70 10 20 0 0 0 0 30 \n",
542
- "2024-01-01 12:15:00+01:00 20 10 30 0 0 0 0 20 \n",
543
- "2024-01-01 12:30:00+01:00 100 10 40 0 0 0 0 10 \n",
544
- "2024-01-01 12:45:00+01:00 0 10 50 0 0 0 0 0 \n",
541
+ "2024-01-01 11:00:00+00:00 70 10 20 0 0 0 0 30 \n",
542
+ "2024-01-01 11:15:00+00:00 20 10 30 0 0 0 0 20 \n",
543
+ "2024-01-01 11:30:00+00:00 100 10 40 0 0 0 0 10 \n",
544
+ "2024-01-01 11:45:00+00:00 0 10 50 0 0 0 0 0 \n",
545
545
  "\n",
546
546
  " Key \\\n",
547
547
  " P3 P4 P5 P6 P1 P2 P3 P4 P5 \n",
548
- "2024-01-01 12:00:00+01:00 22 30 18 20 0.0 0.1 0.225 0.225 0.225 \n",
549
- "2024-01-01 12:15:00+01:00 20 25 17 22 0.0 0.1 0.225 0.225 0.225 \n",
550
- "2024-01-01 12:30:00+01:00 30 35 19 24 0.0 0.1 0.225 0.225 0.225 \n",
551
- "2024-01-01 12:45:00+01:00 40 10 25 26 0.0 0.1 0.225 0.225 0.225 \n",
548
+ "2024-01-01 11:00:00+00:00 22 30 18 20 0.0 0.1 0.225 0.225 0.225 \n",
549
+ "2024-01-01 11:15:00+00:00 20 25 17 22 0.0 0.1 0.225 0.225 0.225 \n",
550
+ "2024-01-01 11:30:00+00:00 30 35 19 24 0.0 0.1 0.225 0.225 0.225 \n",
551
+ "2024-01-01 11:45:00+00:00 40 10 25 26 0.0 0.1 0.225 0.225 0.225 \n",
552
552
  "\n",
553
553
  " \n",
554
554
  " P6 \n",
555
- "2024-01-01 12:00:00+01:00 0.225 \n",
556
- "2024-01-01 12:15:00+01:00 0.225 \n",
557
- "2024-01-01 12:30:00+01:00 0.225 \n",
558
- "2024-01-01 12:45:00+01:00 0.225 "
555
+ "2024-01-01 11:00:00+00:00 0.225 \n",
556
+ "2024-01-01 11:15:00+00:00 0.225 \n",
557
+ "2024-01-01 11:30:00+00:00 0.225 \n",
558
+ "2024-01-01 11:45:00+00:00 0.225 "
559
559
  ]
560
560
  },
561
561
  "execution_count": 9,
@@ -630,7 +630,7 @@
630
630
  " </thead>\n",
631
631
  " <tbody>\n",
632
632
  " <tr>\n",
633
- " <th>2024-01-01 12:00:00+01:00</th>\n",
633
+ " <th>2024-01-01 11:00:00+00:00</th>\n",
634
634
  " <td>4.9</td>\n",
635
635
  " <td>1.70</td>\n",
636
636
  " <td>5.90</td>\n",
@@ -651,7 +651,7 @@
651
651
  " <td>20.0</td>\n",
652
652
  " </tr>\n",
653
653
  " <tr>\n",
654
- " <th>2024-01-01 12:15:00+01:00</th>\n",
654
+ " <th>2024-01-01 11:15:00+00:00</th>\n",
655
655
  " <td>0.0</td>\n",
656
656
  " <td>1.00</td>\n",
657
657
  " <td>6.75</td>\n",
@@ -672,7 +672,7 @@
672
672
  " <td>13.5</td>\n",
673
673
  " </tr>\n",
674
674
  " <tr>\n",
675
- " <th>2024-01-01 12:30:00+01:00</th>\n",
675
+ " <th>2024-01-01 11:30:00+00:00</th>\n",
676
676
  " <td>19.0</td>\n",
677
677
  " <td>2.90</td>\n",
678
678
  " <td>16.60</td>\n",
@@ -693,7 +693,7 @@
693
693
  " <td>24.0</td>\n",
694
694
  " </tr>\n",
695
695
  " <tr>\n",
696
- " <th>2024-01-01 12:45:00+01:00</th>\n",
696
+ " <th>2024-01-01 11:45:00+00:00</th>\n",
697
697
  " <td>0.0</td>\n",
698
698
  " <td>2.42</td>\n",
699
699
  " <td>18.33</td>\n",
@@ -720,24 +720,24 @@
720
720
  "text/plain": [
721
721
  " Net Injection \\\n",
722
722
  " P1 P2 P3 P4 P5 P6 \n",
723
- "2024-01-01 12:00:00+01:00 4.9 1.70 5.90 0.0 0.0 0.0 \n",
724
- "2024-01-01 12:15:00+01:00 0.0 1.00 6.75 0.0 0.0 0.0 \n",
725
- "2024-01-01 12:30:00+01:00 19.0 2.90 16.60 0.0 0.0 0.0 \n",
726
- "2024-01-01 12:45:00+01:00 0.0 2.42 18.33 0.0 0.0 0.0 \n",
723
+ "2024-01-01 11:00:00+00:00 4.9 1.70 5.90 0.0 0.0 0.0 \n",
724
+ "2024-01-01 11:15:00+00:00 0.0 1.00 6.75 0.0 0.0 0.0 \n",
725
+ "2024-01-01 11:30:00+00:00 19.0 2.90 16.60 0.0 0.0 0.0 \n",
726
+ "2024-01-01 11:45:00+00:00 0.0 2.42 18.33 0.0 0.0 0.0 \n",
727
727
  "\n",
728
728
  " Net Offtake \\\n",
729
729
  " P1 P2 P3 P4 P5 P6 \n",
730
- "2024-01-01 12:00:00+01:00 0.0 21.0 4.00 7.50 0.0 0.0 \n",
731
- "2024-01-01 12:15:00+01:00 0.0 15.0 13.25 11.50 3.5 8.5 \n",
732
- "2024-01-01 12:30:00+01:00 0.0 0.0 5.25 1.25 0.0 0.0 \n",
733
- "2024-01-01 12:45:00+01:00 0.0 0.0 37.75 0.00 11.5 12.5 \n",
730
+ "2024-01-01 11:00:00+00:00 0.0 21.0 4.00 7.50 0.0 0.0 \n",
731
+ "2024-01-01 11:15:00+00:00 0.0 15.0 13.25 11.50 3.5 8.5 \n",
732
+ "2024-01-01 11:30:00+00:00 0.0 0.0 5.25 1.25 0.0 0.0 \n",
733
+ "2024-01-01 11:45:00+00:00 0.0 0.0 37.75 0.00 11.5 12.5 \n",
734
734
  "\n",
735
735
  " Shared Energy \n",
736
736
  " P1 P2 P3 P4 P5 P6 \n",
737
- "2024-01-01 12:00:00+01:00 0.0 9.0 18.00 22.50 18.0 20.0 \n",
738
- "2024-01-01 12:15:00+01:00 0.0 5.0 6.75 13.50 13.5 13.5 \n",
739
- "2024-01-01 12:30:00+01:00 0.0 10.0 24.75 33.75 19.0 24.0 \n",
740
- "2024-01-01 12:45:00+01:00 0.0 0.0 2.25 10.00 13.5 13.5 "
737
+ "2024-01-01 11:00:00+00:00 0.0 9.0 18.00 22.50 18.0 20.0 \n",
738
+ "2024-01-01 11:15:00+00:00 0.0 5.0 6.75 13.50 13.5 13.5 \n",
739
+ "2024-01-01 11:30:00+00:00 0.0 10.0 24.75 33.75 19.0 24.0 \n",
740
+ "2024-01-01 11:45:00+00:00 0.0 0.0 2.25 10.00 13.5 13.5 "
741
741
  ]
742
742
  },
743
743
  "execution_count": 10,
@@ -812,7 +812,7 @@
812
812
  " </thead>\n",
813
813
  " <tbody>\n",
814
814
  " <tr>\n",
815
- " <th>2024-01-01 12:00:00+01:00</th>\n",
815
+ " <th>2024-01-01 11:00:00+00:00</th>\n",
816
816
  " <td>7.08</td>\n",
817
817
  " <td>1.01</td>\n",
818
818
  " <td>2.02</td>\n",
@@ -833,7 +833,7 @@
833
833
  " <td>20.00</td>\n",
834
834
  " </tr>\n",
835
835
  " <tr>\n",
836
- " <th>2024-01-01 12:15:00+01:00</th>\n",
836
+ " <th>2024-01-01 11:15:00+00:00</th>\n",
837
837
  " <td>0.00</td>\n",
838
838
  " <td>0.00</td>\n",
839
839
  " <td>-0.00</td>\n",
@@ -854,7 +854,7 @@
854
854
  " <td>15.71</td>\n",
855
855
  " </tr>\n",
856
856
  " <tr>\n",
857
- " <th>2024-01-01 12:30:00+01:00</th>\n",
857
+ " <th>2024-01-01 11:30:00+00:00</th>\n",
858
858
  " <td>24.67</td>\n",
859
859
  " <td>2.47</td>\n",
860
860
  " <td>9.87</td>\n",
@@ -875,7 +875,7 @@
875
875
  " <td>24.00</td>\n",
876
876
  " </tr>\n",
877
877
  " <tr>\n",
878
- " <th>2024-01-01 12:45:00+01:00</th>\n",
878
+ " <th>2024-01-01 11:45:00+00:00</th>\n",
879
879
  " <td>0.00</td>\n",
880
880
  " <td>2.24</td>\n",
881
881
  " <td>11.22</td>\n",
@@ -902,24 +902,24 @@
902
902
  "text/plain": [
903
903
  " Net Injection \\\n",
904
904
  " P1 P2 P3 P4 P5 P6 \n",
905
- "2024-01-01 12:00:00+01:00 7.08 1.01 2.02 0.0 0.0 0.0 \n",
906
- "2024-01-01 12:15:00+01:00 0.00 0.00 -0.00 0.0 0.0 0.0 \n",
907
- "2024-01-01 12:30:00+01:00 24.67 2.47 9.87 0.0 0.0 0.0 \n",
908
- "2024-01-01 12:45:00+01:00 0.00 2.24 11.22 0.0 0.0 0.0 \n",
905
+ "2024-01-01 11:00:00+00:00 7.08 1.01 2.02 0.0 0.0 0.0 \n",
906
+ "2024-01-01 11:15:00+00:00 0.00 0.00 -0.00 0.0 0.0 0.0 \n",
907
+ "2024-01-01 11:30:00+00:00 24.67 2.47 9.87 0.0 0.0 0.0 \n",
908
+ "2024-01-01 11:45:00+00:00 0.00 2.24 11.22 0.0 0.0 0.0 \n",
909
909
  "\n",
910
910
  " Net Offtake \\\n",
911
911
  " P1 P2 P3 P4 P5 P6 \n",
912
- "2024-01-01 12:00:00+01:00 0.0 20.42 3.75 5.94 0.00 0.00 \n",
913
- "2024-01-01 12:15:00+01:00 0.0 14.13 13.00 9.29 1.29 6.29 \n",
914
- "2024-01-01 12:30:00+01:00 0.0 0.00 5.00 0.00 0.00 0.00 \n",
915
- "2024-01-01 12:45:00+01:00 0.0 0.00 37.50 0.00 7.98 8.98 \n",
912
+ "2024-01-01 11:00:00+00:00 0.0 20.42 3.75 5.94 0.00 0.00 \n",
913
+ "2024-01-01 11:15:00+00:00 0.0 14.13 13.00 9.29 1.29 6.29 \n",
914
+ "2024-01-01 11:30:00+00:00 0.0 0.00 5.00 0.00 0.00 0.00 \n",
915
+ "2024-01-01 11:45:00+00:00 0.0 0.00 37.50 0.00 7.98 8.98 \n",
916
916
  "\n",
917
917
  " Shared Energy \n",
918
918
  " P1 P2 P3 P4 P5 P6 \n",
919
- "2024-01-01 12:00:00+01:00 0.0 9.58 18.25 24.06 18.00 20.00 \n",
920
- "2024-01-01 12:15:00+01:00 0.0 5.87 7.00 15.71 15.71 15.71 \n",
921
- "2024-01-01 12:30:00+01:00 0.0 10.00 25.00 35.00 19.00 24.00 \n",
922
- "2024-01-01 12:45:00+01:00 0.0 0.00 2.50 10.00 17.02 17.02 "
919
+ "2024-01-01 11:00:00+00:00 0.0 9.58 18.25 24.06 18.00 20.00 \n",
920
+ "2024-01-01 11:15:00+00:00 0.0 5.87 7.00 15.71 15.71 15.71 \n",
921
+ "2024-01-01 11:30:00+00:00 0.0 10.00 25.00 35.00 19.00 24.00 \n",
922
+ "2024-01-01 11:45:00+00:00 0.0 0.00 2.50 10.00 17.02 17.02 "
923
923
  ]
924
924
  },
925
925
  "execution_count": 11,
@@ -1000,7 +1000,7 @@
1000
1000
  " </thead>\n",
1001
1001
  " <tbody>\n",
1002
1002
  " <tr>\n",
1003
- " <th>2024-01-01 12:00:00+01:00</th>\n",
1003
+ " <th>2024-01-01 11:00:00+00:00</th>\n",
1004
1004
  " <td>0.00</td>\n",
1005
1005
  " <td>0.00</td>\n",
1006
1006
  " <td>0.00</td>\n",
@@ -1021,7 +1021,7 @@
1021
1021
  " <td>20.00</td>\n",
1022
1022
  " </tr>\n",
1023
1023
  " <tr>\n",
1024
- " <th>2024-01-01 12:15:00+01:00</th>\n",
1024
+ " <th>2024-01-01 11:15:00+00:00</th>\n",
1025
1025
  " <td>0.00</td>\n",
1026
1026
  " <td>0.00</td>\n",
1027
1027
  " <td>0.00</td>\n",
@@ -1042,7 +1042,7 @@
1042
1042
  " <td>15.71</td>\n",
1043
1043
  " </tr>\n",
1044
1044
  " <tr>\n",
1045
- " <th>2024-01-01 12:30:00+01:00</th>\n",
1045
+ " <th>2024-01-01 11:30:00+00:00</th>\n",
1046
1046
  " <td>14.76</td>\n",
1047
1047
  " <td>1.48</td>\n",
1048
1048
  " <td>15.77</td>\n",
@@ -1063,7 +1063,7 @@
1063
1063
  " <td>24.00</td>\n",
1064
1064
  " </tr>\n",
1065
1065
  " <tr>\n",
1066
- " <th>2024-01-01 12:45:00+01:00</th>\n",
1066
+ " <th>2024-01-01 11:45:00+00:00</th>\n",
1067
1067
  " <td>0.00</td>\n",
1068
1068
  " <td>0.00</td>\n",
1069
1069
  " <td>0.00</td>\n",
@@ -1090,24 +1090,24 @@
1090
1090
  "text/plain": [
1091
1091
  " Net Injection \\\n",
1092
1092
  " P1 P2 P3 P4 P5 P6 \n",
1093
- "2024-01-01 12:00:00+01:00 0.00 0.00 0.00 0.0 0.0 0.0 \n",
1094
- "2024-01-01 12:15:00+01:00 0.00 0.00 0.00 0.0 0.0 0.0 \n",
1095
- "2024-01-01 12:30:00+01:00 14.76 1.48 15.77 0.0 0.0 0.0 \n",
1096
- "2024-01-01 12:45:00+01:00 0.00 0.00 0.00 0.0 0.0 0.0 \n",
1093
+ "2024-01-01 11:00:00+00:00 0.00 0.00 0.00 0.0 0.0 0.0 \n",
1094
+ "2024-01-01 11:15:00+00:00 0.00 0.00 0.00 0.0 0.0 0.0 \n",
1095
+ "2024-01-01 11:30:00+00:00 14.76 1.48 15.77 0.0 0.0 0.0 \n",
1096
+ "2024-01-01 11:45:00+00:00 0.00 0.00 0.00 0.0 0.0 0.0 \n",
1097
1097
  "\n",
1098
1098
  " Net Offtake \\\n",
1099
1099
  " P1 P2 P3 P4 P5 P6 \n",
1100
- "2024-01-01 12:00:00+01:00 0.0 18.51 0.35 1.14 0.00 0.00 \n",
1101
- "2024-01-01 12:15:00+01:00 0.0 14.13 13.00 9.29 1.29 6.29 \n",
1102
- "2024-01-01 12:30:00+01:00 0.0 0.00 0.00 0.00 0.00 0.00 \n",
1103
- "2024-01-01 12:45:00+01:00 0.0 0.00 36.75 0.00 1.62 2.62 \n",
1100
+ "2024-01-01 11:00:00+00:00 0.0 18.51 0.35 1.14 0.00 0.00 \n",
1101
+ "2024-01-01 11:15:00+00:00 0.0 14.13 13.00 9.29 1.29 6.29 \n",
1102
+ "2024-01-01 11:30:00+00:00 0.0 0.00 0.00 0.00 0.00 0.00 \n",
1103
+ "2024-01-01 11:45:00+00:00 0.0 0.00 36.75 0.00 1.62 2.62 \n",
1104
1104
  "\n",
1105
1105
  " Shared Energy \n",
1106
1106
  " P1 P2 P3 P4 P5 P6 \n",
1107
- "2024-01-01 12:00:00+01:00 0.0 11.49 21.65 28.86 18.00 20.00 \n",
1108
- "2024-01-01 12:15:00+01:00 0.0 5.87 7.00 15.71 15.71 15.71 \n",
1109
- "2024-01-01 12:30:00+01:00 0.0 10.00 30.00 35.00 19.00 24.00 \n",
1110
- "2024-01-01 12:45:00+01:00 0.0 0.00 3.25 10.00 23.38 23.38 "
1107
+ "2024-01-01 11:00:00+00:00 0.0 11.49 21.65 28.86 18.00 20.00 \n",
1108
+ "2024-01-01 11:15:00+00:00 0.0 5.87 7.00 15.71 15.71 15.71 \n",
1109
+ "2024-01-01 11:30:00+00:00 0.0 10.00 30.00 35.00 19.00 24.00 \n",
1110
+ "2024-01-01 11:45:00+00:00 0.0 0.00 3.25 10.00 23.38 23.38 "
1111
1111
  ]
1112
1112
  },
1113
1113
  "execution_count": 12,
@@ -1156,10 +1156,10 @@
1156
1156
  "{\n",
1157
1157
  " \"netInjection\": {\n",
1158
1158
  " \"index\": [\n",
1159
- " \"2024-01-01T12:00:00+01:00\",\n",
1160
- " \"2024-01-01T12:15:00+01:00\",\n",
1161
- " \"2024-01-01T12:30:00+01:00\",\n",
1162
- " \"2024-01-01T12:45:00+01:00\"\n",
1159
+ " \"2024-01-01T11:00:00Z\",\n",
1160
+ " \"2024-01-01T11:15:00Z\",\n",
1161
+ " \"2024-01-01T11:30:00Z\",\n",
1162
+ " \"2024-01-01T11:45:00Z\"\n",
1163
1163
  " ],\n",
1164
1164
  " \"columns\": [\n",
1165
1165
  " \"P1\",\n",
@@ -1206,10 +1206,10 @@
1206
1206
  " },\n",
1207
1207
  " \"netOfftake\": {\n",
1208
1208
  " \"index\": [\n",
1209
- " \"2024-01-01T12:00:00+01:00\",\n",
1210
- " \"2024-01-01T12:15:00+01:00\",\n",
1211
- " \"2024-01-01T12:30:00+01:00\",\n",
1212
- " \"2024-01-01T12:45:00+01:00\"\n",
1209
+ " \"2024-01-01T11:00:00Z\",\n",
1210
+ " \"2024-01-01T11:15:00Z\",\n",
1211
+ " \"2024-01-01T11:30:00Z\",\n",
1212
+ " \"2024-01-01T11:45:00Z\"\n",
1213
1213
  " ],\n",
1214
1214
  " \"columns\": [\n",
1215
1215
  " \"P1\",\n",
@@ -1256,10 +1256,10 @@
1256
1256
  " },\n",
1257
1257
  " \"sharedEnergy\": {\n",
1258
1258
  " \"index\": [\n",
1259
- " \"2024-01-01T12:00:00+01:00\",\n",
1260
- " \"2024-01-01T12:15:00+01:00\",\n",
1261
- " \"2024-01-01T12:30:00+01:00\",\n",
1262
- " \"2024-01-01T12:45:00+01:00\"\n",
1259
+ " \"2024-01-01T11:00:00Z\",\n",
1260
+ " \"2024-01-01T11:15:00Z\",\n",
1261
+ " \"2024-01-01T11:30:00Z\",\n",
1262
+ " \"2024-01-01T11:45:00Z\"\n",
1263
1263
  " ],\n",
1264
1264
  " \"columns\": [\n",
1265
1265
  " \"P1\",\n",
@@ -1,6 +1,6 @@
1
1
  """Open Energy ID Python SDK."""
2
2
 
3
- __version__ = "0.1.12"
3
+ __version__ = "0.1.13"
4
4
 
5
5
  from .enums import Granularity
6
6
  from .models import TimeDataFrame, TimeSeries
@@ -0,0 +1,12 @@
1
+ """Energy Sharing package."""
2
+
3
+ from .main import calculate
4
+ from .models import CalculationMethod, EnergySharingInput, EnergySharingOutput, KeyInput
5
+
6
+ __all__ = [
7
+ "calculate",
8
+ "CalculationMethod",
9
+ "EnergySharingInput",
10
+ "EnergySharingOutput",
11
+ "KeyInput",
12
+ ]
@@ -22,9 +22,6 @@ def create_multi_index_input_frame(
22
22
 
23
23
  df = pd.concat([gross_injection, gross_offtake, key], axis=1)
24
24
 
25
- # Do a check that the sum of the keys per timestamp is 1
26
- assert df[KEY].dropna(how="all").sum(axis=1).round(2).eq(1).all()
27
-
28
25
  return df
29
26
 
30
27
 
@@ -1,9 +1,9 @@
1
1
  """Data models for energy sharing."""
2
2
 
3
3
  from enum import Enum
4
- from typing import Annotated
4
+ from typing import Annotated, Any
5
5
 
6
- from pydantic import BaseModel, Field
6
+ from pydantic import BaseModel, Field, confloat
7
7
  import pandas as pd
8
8
 
9
9
  from openenergyid import TimeDataFrame
@@ -19,22 +19,46 @@ class CalculationMethod(Enum):
19
19
  OPTIMAL = "Optimal"
20
20
 
21
21
 
22
+ class KeyInput(TimeDataFrame):
23
+ """Energy Sharing Keys."""
24
+
25
+ data: Annotated[
26
+ list[list[confloat(ge=0.0, le=1.0)]], # type: ignore
27
+ Field(
28
+ description="Key data, column per participant. "
29
+ "Must be between 0 and 1. "
30
+ "Each row must sum to 1."
31
+ ),
32
+ ]
33
+
34
+ def model_post_init(self, __context: Any) -> None:
35
+ """Post-initialization validation."""
36
+ for row in self.data:
37
+ if round(sum(row), 6) != 1:
38
+ raise ValueError("Each row must sum to 1.")
39
+ return super().model_post_init(__context)
40
+
41
+
22
42
  class EnergySharingInput(BaseModel):
23
43
  """Input data for energy sharing."""
24
44
 
25
- gross_injection: Annotated[TimeDataFrame, Field(alias="grossInjection")]
26
- gross_offtake: Annotated[TimeDataFrame, Field(alias="grossOfftake")]
27
- key: Annotated[TimeDataFrame, Field(alias="key")]
28
- timezone: str = Field(alias="timeZone", default="Europe/Brussels")
45
+ gross_injection: Annotated[
46
+ TimeDataFrame,
47
+ Field(alias="grossInjection", description="Gross injection data, column per participant"),
48
+ ]
49
+ gross_offtake: Annotated[
50
+ TimeDataFrame,
51
+ Field(alias="grossOfftake", description="Gross offtake data, column per participant"),
52
+ ]
53
+ key: KeyInput
29
54
 
30
- def data_frame(self) -> pd.DataFrame:
55
+ def to_pandas(self) -> pd.DataFrame:
31
56
  """Return the data as a combined DataFrame"""
32
57
  df = create_multi_index_input_frame(
33
58
  gross_injection=self.gross_injection.to_pandas(),
34
59
  gross_offtake=self.gross_offtake.to_pandas(),
35
60
  key=self.key.to_pandas(),
36
61
  )
37
- df = df.tz_convert(self.timezone)
38
62
  return df
39
63
 
40
64
 
@@ -1,6 +0,0 @@
1
- """Energy Sharing package."""
2
-
3
- from .main import calculate
4
- from .models import CalculationMethod, EnergySharingInput, EnergySharingOutput
5
-
6
- __all__ = ["calculate", "CalculationMethod", "EnergySharingInput", "EnergySharingOutput"]
File without changes
File without changes
File without changes