pandahub 0.3.7__zip → 0.3.9__zip
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.
- {pandahub-0.3.7 → pandahub-0.3.9}/CHANGELOG.md +10 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/PKG-INFO +1 -1
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/net.py +3 -2
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/variants.py +4 -7
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/PandaHub.py +248 -185
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub.egg-info/PKG-INFO +1 -1
- {pandahub-0.3.7 → pandahub-0.3.9}/pyproject.toml +1 -1
- {pandahub-0.3.7 → pandahub-0.3.9}/test/performance_test.py +8 -8
- {pandahub-0.3.7 → pandahub-0.3.9}/test/test_networks.py +12 -12
- {pandahub-0.3.7 → pandahub-0.3.9}/test/test_projects.py +2 -2
- {pandahub-0.3.7 → pandahub-0.3.9}/CONTRIBUTING.rst +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/LICENSE +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/MANIFEST.in +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/README.md +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/dependencies.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/internal/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/internal/db.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/internal/schemas.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/internal/settings.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/internal/toolbox.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/internal/users.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/main.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/auth.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/projects.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/timeseries.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/api/routers/users.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/database_toolbox.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/datatypes.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/mongodb_indexes.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/timeseries/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/timeseries/data_sources/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/timeseries/data_sources/mongo_data.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub/lib/timeseries/output_writer_mongodb.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub.egg-info/SOURCES.txt +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub.egg-info/dependency_links.txt +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub.egg-info/requires.txt +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/pandahub.egg-info/top_level.txt +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/requirements.txt +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/setup.cfg +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/setup.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/test/__init__.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/test/conftest.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/test/test_client.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/test/test_timeseries.py +0 -0
- {pandahub-0.3.7 → pandahub-0.3.9}/tutorials/config.py +0 -0
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [0.3.9]
|
|
4
|
+
|
|
5
|
+
- BREAKING: inserting multiple networks with the same name does not represent an error anymore, networks are only unique by their net_id (_id field of the collection)
|
|
6
|
+
- BREAKING: passing net_id as str will not remap to the project name internally but look up on the _id field
|
|
7
|
+
- IMPROVED: fix race condition when calling write_network_to_db without net_id
|
|
8
|
+
|
|
9
|
+
## [0.3.8]
|
|
10
|
+
|
|
11
|
+
- BREAKING: specifying variant as list will raise an error instead of a deprecation warning
|
|
12
|
+
|
|
3
13
|
## [0.3.7]
|
|
4
14
|
|
|
5
15
|
- FIXED: changes introduced in 0.3.6 removed all dependencies from the project
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pandahub
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: Data hub for pandapower and pandapipes networks based on MongoDB
|
|
5
5
|
Author-email: Jan Ulffers <jan.ulffers@iee.fraunhofer.de>, Leon Thurner <leon.thurner@retoflow.de>, Jannis Kupka <jannis.kupka@retoflow.de>, Mike Vogt <mike.vogt@iee.fraunhofer.de>, Joschka Thurner <joschka.thurner@retoflow.de>, Alexander Scheidler <alexander.scheidler@iee.fraunhofer.de>
|
|
6
6
|
License: Copyright (c) 2022 by University of Kassel, Fraunhofer Institute for Energy Economics
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Optional, Any
|
|
2
2
|
|
|
3
3
|
import pandapower as pp
|
|
4
|
+
import pandapipes as pps
|
|
4
5
|
from fastapi import APIRouter, Depends
|
|
5
6
|
from pydantic import BaseModel
|
|
6
7
|
|
|
@@ -25,7 +26,7 @@ class GetNetFromDB(BaseModel):
|
|
|
25
26
|
|
|
26
27
|
@router.post("/get_net_from_db")
|
|
27
28
|
def get_net_from_db(data: GetNetFromDB, ph=Depends(pandahub)):
|
|
28
|
-
net = ph.
|
|
29
|
+
net = ph.get_network_by_name(**data.model_dump())
|
|
29
30
|
return pp.to_json(net)
|
|
30
31
|
|
|
31
32
|
|
|
@@ -49,7 +50,7 @@ def write_network_to_db(data: WriteNetwork, ph=Depends(pandahub)):
|
|
|
49
50
|
|
|
50
51
|
class BaseCRUDModel(BaseModel):
|
|
51
52
|
project_id: str
|
|
52
|
-
|
|
53
|
+
net_id: int | str
|
|
53
54
|
element_type: str
|
|
54
55
|
|
|
55
56
|
class GetNetValueModel(BaseCRUDModel):
|
|
@@ -17,7 +17,7 @@ router = APIRouter(
|
|
|
17
17
|
|
|
18
18
|
class GetVariantsModel(BaseModel):
|
|
19
19
|
project_id: str
|
|
20
|
-
net_id: int
|
|
20
|
+
net_id: int | str
|
|
21
21
|
|
|
22
22
|
@router.post("/get_variants")
|
|
23
23
|
def get_variants(data: GetVariantsModel, ph=Depends(pandahub)):
|
|
@@ -25,10 +25,7 @@ def get_variants(data: GetVariantsModel, ph=Depends(pandahub)):
|
|
|
25
25
|
variants_collection = ph.get_project_database("variant")
|
|
26
26
|
|
|
27
27
|
variants = variants_collection.find({"net_id": data.net_id}, projection={"_id": 0})
|
|
28
|
-
|
|
29
|
-
for var in variants:
|
|
30
|
-
response[var.pop("index")] = var
|
|
31
|
-
return response
|
|
28
|
+
return {variant.pop("index"): variant for variant in variants}
|
|
32
29
|
|
|
33
30
|
|
|
34
31
|
class CreateVariantModel(BaseModel):
|
|
@@ -43,7 +40,7 @@ def create_variant(data: CreateVariantModel, ph=Depends(pandahub)):
|
|
|
43
40
|
|
|
44
41
|
class DeleteVariantModel(BaseModel):
|
|
45
42
|
project_id: str
|
|
46
|
-
net_id: int
|
|
43
|
+
net_id: int | str
|
|
47
44
|
index: int
|
|
48
45
|
|
|
49
46
|
@router.post("/delete_variant")
|
|
@@ -54,7 +51,7 @@ def delete_variant(data: DeleteVariantModel, ph=Depends(pandahub)):
|
|
|
54
51
|
|
|
55
52
|
class UpdateVariantModel(BaseModel):
|
|
56
53
|
project_id: str
|
|
57
|
-
net_id: int
|
|
54
|
+
net_id: int | str
|
|
58
55
|
index: int
|
|
59
56
|
data: dict
|
|
60
57
|
|