Skip to content

Commit

Permalink
BDS query first from local object storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilgo committed Sep 25, 2024
1 parent 2cc4e33 commit f93ffe8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions emf/model_retriever/model_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

from emf.common.config_parser import parse_app_properties
from emf.common.integrations import elastic, opdm, minio_api
from emf.common.integrations.object_storage import models
from emf.common.converters import opdm_metadata_to_json
from emf.loadflow_tool.merge import latest_boundary
from emf.loadflow_tool.model_validator.validator import validate_model
from emf.loadflow_tool.helper import load_opdm_data

Expand Down Expand Up @@ -83,9 +85,16 @@ def handle(self, opdm_objects: dict, **kwargs):

class HandlerModelsStat:

def __init__(self):
self.opdm_service = opdm.OPDM()

def handle(self, opdm_objects: List[dict], **kwargs):

# Get the latest boundary set for validation
latest_boundary = self.opdm_service.get_latest_boundary() # TODO - get BDS from ELK+MINIO
latest_boundary = models.get_latest_boundary()

if not latest_boundary:
latest_boundary = self.opdm_service.get_latest_boundary()

# Extract statistics
for opdm_object in opdm_objects:
Expand All @@ -106,8 +115,12 @@ def __init__(self):
self.opdm_service = opdm.OPDM()

def handle(self, opdm_objects: List[dict], **kwargs):

# Get the latest boundary set for validation
latest_boundary = self.opdm_service.get_latest_boundary()
latest_boundary = models.get_latest_boundary()

if not latest_boundary:
latest_boundary = self.opdm_service.get_latest_boundary()

logger.info(f"Validation parameters used: {VALIDATION_LOAD_FLOW_SETTINGS}")

Expand Down

0 comments on commit f93ffe8

Please sign in to comment.