Skip to content

Commit

Permalink
only get sites with a certain client name
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Oct 24, 2024
1 parent 9c10d1f commit c8e884a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = ["Programming Language :: Python :: 3"]
dependencies = [
"cryptography >= 42.0.7",
"fastapi >= 0.105.0",
"pvsite-datamodel >= 1.0.40",
"pvsite-datamodel >= 1.0.41",
"pyjwt >= 2.8.0",
"pyproj >= 3.3.0",
"pytz >= 2023.3",
Expand Down
4 changes: 2 additions & 2 deletions src/india_api/internal/inputs/indiadb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_predicted_power_production_for_location(

# get site uuid
with self._get_session() as session:
sites = get_sites_by_country(session, country="india")
sites = get_sites_by_country(session, country="india", client_name=location)

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

# get site uuid
with self._get_session() as session:
sites = get_sites_by_country(session, country="india")
sites = get_sites_by_country(session, country="india", client_name=location)

# just select wind site
sites = [site for site in sites if site.asset_type == asset_type]
Expand Down
6 changes: 4 additions & 2 deletions src/india_api/internal/inputs/indiadb/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def sites(db_session):
ml_id=1,
asset_type="pv",
country="india",
region='testID'
region='testID',
client_site_name='ruvnl_pv'
)
db_session.add(site)
sites.append(site)
Expand All @@ -79,7 +80,8 @@ def sites(db_session):
ml_id=2,
asset_type="wind",
country="india",
region='testID'
region='testID',
client_site_name = 'ruvnl_wind'
)
db_session.add(site)
sites.append(site)
Expand Down

0 comments on commit c8e884a

Please sign in to comment.