Skip to content

Commit c8e884a

Browse files
committed
only get sites with a certain client name
1 parent 9c10d1f commit c8e884a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = ["Programming Language :: Python :: 3"]
1919
dependencies = [
2020
"cryptography >= 42.0.7",
2121
"fastapi >= 0.105.0",
22-
"pvsite-datamodel >= 1.0.40",
22+
"pvsite-datamodel >= 1.0.41",
2323
"pyjwt >= 2.8.0",
2424
"pyproj >= 3.3.0",
2525
"pytz >= 2023.3",

src/india_api/internal/inputs/indiadb/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_predicted_power_production_for_location(
8787

8888
# get site uuid
8989
with self._get_session() as session:
90-
sites = get_sites_by_country(session, country="india")
90+
sites = get_sites_by_country(session, country="india", client_name=location)
9191

9292
# just select wind site and region
9393
sites = [s for s in sites if (s.asset_type == asset_type) and (s.region == location)]
@@ -141,7 +141,7 @@ def get_generation_for_location(
141141

142142
# get site uuid
143143
with self._get_session() as session:
144-
sites = get_sites_by_country(session, country="india")
144+
sites = get_sites_by_country(session, country="india", client_name=location)
145145

146146
# just select wind site
147147
sites = [site for site in sites if site.asset_type == asset_type]

src/india_api/internal/inputs/indiadb/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def sites(db_session):
6565
ml_id=1,
6666
asset_type="pv",
6767
country="india",
68-
region='testID'
68+
region='testID',
69+
client_site_name='ruvnl_pv'
6970
)
7071
db_session.add(site)
7172
sites.append(site)
@@ -79,7 +80,8 @@ def sites(db_session):
7980
ml_id=2,
8081
asset_type="wind",
8182
country="india",
82-
region='testID'
83+
region='testID',
84+
client_site_name = 'ruvnl_wind'
8385
)
8486
db_session.add(site)
8587
sites.append(site)

0 commit comments

Comments
 (0)