-
-
Notifications
You must be signed in to change notification settings - Fork 5
Nl blend region #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PavanRaghavendraKulkarni
wants to merge
21
commits into
main
Choose a base branch
from
nl_blend_region
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+250
−57
Open
Nl blend region #166
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e11b5e8
renamed forecaster name from blend to nl_blend
PavanRaghavendraKulkarni 8de9294
nl_blend_adjuster
PavanRaghavendraKulkarni 16e2bb8
lint error
PavanRaghavendraKulkarni ffe67b9
fix: add missing trailing newline to config.yaml
PavanRaghavendraKulkarni 8159188
Merge branch 'main' into nl_blend_adjuster
PavanRaghavendraKulkarni 1eeba51
added unit test cases
PavanRaghavendraKulkarni ab439a7
description enhancement
PavanRaghavendraKulkarni 8de06a9
test: update test_run_blend_app_success to verify double execution of…
PavanRaghavendraKulkarni eabf121
suggested changes
PavanRaghavendraKulkarni f4260b0
comment fixes
PavanRaghavendraKulkarni d5281d3
lint fixes
PavanRaghavendraKulkarni 86bb11f
use actual instead of makup removed redududnat tests
PavanRaghavendraKulkarni 9a86a68
lint fixes
PavanRaghavendraKulkarni 4d834cb
refactorting of blend app and test for rename columns
PavanRaghavendraKulkarni e9d316c
suggested fixes
PavanRaghavendraKulkarni e82788f
feat: implement regional blend pipeline using distinct candidate mode…
PavanRaghavendraKulkarni 508289c
lint fixes
PavanRaghavendraKulkarni aec5e31
Merge branch 'main' into nl_blend_region
PavanRaghavendraKulkarni 1e8d85b
filter by state ratther than prefix
PavanRaghavendraKulkarni e56f236
lint
PavanRaghavendraKulkarni 836b1e1
fix tests
PavanRaghavendraKulkarni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
| import logging | ||
| import os | ||
| import random | ||
| import time | ||
| from importlib.metadata import version | ||
| from uuid import uuid4 | ||
|
|
||
| import numpy as np | ||
|
|
@@ -24,6 +26,7 @@ | |
| LocationSQL, | ||
| ) | ||
| from sqlalchemy import create_engine | ||
| from testcontainers.core.container import DockerContainer | ||
| from testcontainers.postgres import PostgresContainer | ||
|
|
||
| from site_forecast_app.data.gencast import get_latest_6hr_init_time | ||
|
|
@@ -627,3 +630,33 @@ def small_satellite_data(tmp_path_factory, init_timestamp): | |
| def use_satellite(): | ||
| """Set use satellite env var""" | ||
| os.environ["USE_SATELLITE"] = "true" | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def dp_address(): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how come you need this now? I thought you mocked most things out? |
||
| """ | ||
| Fixture to spin up a PostgreSQL container and Data Platform container for each test module. | ||
| Yields (host, port) for the Data Platform server. | ||
| """ | ||
|
|
||
| with PostgresContainer( | ||
| f"ghcr.io/openclimatefix/data-platform-pgdb:{version('dp_sdk')}", | ||
| username="postgres", | ||
| password="postgres", # noqa: S106 | ||
| dbname="postgres", | ||
| env={"POSTGRES_HOST": "db"}, | ||
| ) as postgres: | ||
| database_url = postgres.get_connection_url() | ||
| database_url = database_url.replace("postgresql+psycopg2", "postgres") | ||
| database_url = database_url.replace("localhost", "host.docker.internal") | ||
|
|
||
| with DockerContainer( | ||
| image=f"ghcr.io/openclimatefix/data-platform:{version('dp_sdk')}", | ||
| env={"DATABASE_URL": database_url}, | ||
| ports=[50051], | ||
| ) as data_platform_server: | ||
| time.sleep(1) # Give some time for the server to start | ||
|
|
||
| port = data_platform_server.get_exposed_port(50051) | ||
| host = data_platform_server.get_container_host_ip() | ||
| yield host, port | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've move
dp.LocationType.STATEinto the config, as for other countries, models this wont be the case