Skip to content

Commit

Permalink
test: Use unmodified entsoe model
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkleiven committed Feb 14, 2024
1 parent 1b68709 commit f637142
Show file tree
Hide file tree
Showing 11 changed files with 39,983 additions and 48,355 deletions.
1 change: 1 addition & 0 deletions cimsparql/adaptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def add_dtypes(self) -> None:
"SvPowerFlow.p": XSD.float,
".open": XSD.boolean,
".connected": XSD.boolean,
".nominalVoltage": XSD.float,
}
for s, predicate, o, g in self.graph.quads():
with suppress(StopIteration):
Expand Down
5 changes: 5 additions & 0 deletions tests/data/small/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Model info

Model extracted from

SmallGrid/BusBranch/CGMES_v2.4.15_SmallGridTestConfiguration_BaseCase_Complete_v3.0.0
12,066 changes: 12,066 additions & 0 deletions tests/data/small/SmallGridTestConfiguration_BC_DL_v3.0.0.xml

Large diffs are not rendered by default.

15,253 changes: 15,253 additions & 0 deletions tests/data/small/SmallGridTestConfiguration_BC_EQ_v3.0.0.xml

Large diffs are not rendered by default.

6,500 changes: 6,500 additions & 0 deletions tests/data/small/SmallGridTestConfiguration_BC_GL_v3.0.0.xml

Large diffs are not rendered by default.

2,504 changes: 2,504 additions & 0 deletions tests/data/small/SmallGridTestConfiguration_BC_SSH_v3.0.0.xml

Large diffs are not rendered by default.

1,514 changes: 1,514 additions & 0 deletions tests/data/small/SmallGridTestConfiguration_BC_SV_v3.0.0.xml

Large diffs are not rendered by default.

2,130 changes: 2,130 additions & 0 deletions tests/data/small/SmallGridTestConfiguration_BC_TP_v3.0.0.xml

Large diffs are not rendered by default.

43,329 changes: 0 additions & 43,329 deletions tests/data/smallgrid_eq.nq

This file was deleted.

5,023 changes: 0 additions & 5,023 deletions tests/data/smallgrid_tpsvssh.nq

This file was deleted.

13 changes: 10 additions & 3 deletions tests/t_utils/entsoe_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,21 @@ def bg_http(url: str, name: str) -> GraphDBClient:
return new_repo_blazegraph(url, name, "http")

model = None
test_folder = Path(__file__).parent.parent / "data"
test_folder = Path(__file__).parent.parent / "data/small"
try:
adaptor = XmlModelAdaptor.from_folder(test_folder)
adaptor.adapt()
init_func = t_common.init_repo_rdf4j if api == RestApi.RDF4J else bg_http
tpsvssh_client = init_func(url, "smallgrid_tpsvssh")
tpsvssh_client.upload_rdf(test_folder / "smallgrid_tpsvssh.nq", "n-quads")
tpsvssh_ctx = adaptor.tpsvssh_contexts()
tpsvssh_client.upload_rdf(adaptor.nq_bytes(tpsvssh_ctx), "n-quads")

remaining = adaptor.nq_bytes(
[ctx for ctx in adaptor.graph.contexts() if ctx not in tpsvssh_ctx]
)

eq_client = init_func(url, "smallgrid_eq")
eq_client.upload_rdf(test_folder / "smallgrid_eq.nq", "n-quads")
eq_client.upload_rdf(remaining, "n-quads")

m_cfg = ModelConfig(
system_state_repo=tpsvssh_client.service_cfg.url,
Expand Down

0 comments on commit f637142

Please sign in to comment.