Skip to content

Commit

Permalink
Merge pull request #31 from Solcast/feature/pv_sites_example_notebook
Browse files Browse the repository at this point in the history
Feature/pv sites example notebook
  • Loading branch information
michaelf-solcast authored Feb 28, 2024
2 parents 3856cde + 01c482b commit a98ff77
Show file tree
Hide file tree
Showing 6 changed files with 531 additions and 44 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [1.2.2] - 2024-02-28

- Add example notebook showing use of `pv_power_sites` module
- Bug fix for handling Response Code 204 (valid no content)

## [1.2.1] - 2024-02-12

- Remove `to_pandas` method from `pv_power_sites` responses
Expand Down
478 changes: 478 additions & 0 deletions docs/notebooks/4.1 Setting up and Using PV Sites.ipynb

Large diffs are not rendered by default.

87 changes: 45 additions & 42 deletions docs/pv_power_sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,48 @@ res = pv_power_sites.get_pv_power_site('ba75-e17a-7374-95ed')

res.to_dict()
```
{'resource_id': 'ba75-e17a-7374-95ed',
'name': 'Test Site: Sydney Opera House',
'latitude': -33.856784,
'longitude': 151.215297,
'capacity': 10,
'capacity_dc': 15,
'azimuth': 0,
'tilt': 30.22,
'tracking_type': 'horizontal_single_axis',
'install_date': '2021-07-01T00:00:00.0000000Z',
'module_type': 'poly-si',
'ground_coverage_ratio': 0.47,
'derating_temp_module': 0.0039,
'derating_age_system': 0.0059,
'derating_other_system': 0.07,
'inverter_peak_efficiency': 0.985,
'tracker_axis_azimuth': 0,
'tracker_max_rotation_angle': 60,
'tracker_back_tracking': True,
'tracker_smart_tracking': False,
'terrain_slope': 0,
'terrain_azimuth': 0,
'dust_soiling_average': [0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015],
'bifacial_system': False,
'site_ground_albedo': 0.25,
'bifaciality_factor': 0.7,
'pvrow_height': 1.5,
'pvrow_width': 2,
'is_unmetered': True,
'confirmed_metadata': '2023-12-19T07:18:21.2378120Z'}

```
{
'resource_id': 'ba75-e17a-7374-95ed',
'name': 'Test Site: Sydney Opera House',
'latitude': -33.856784,
'longitude': 151.215297,
'capacity': 10,
'capacity_dc': 15,
'azimuth': 0,
'tilt': 30.22,
'tracking_type': 'horizontal_single_axis',
'install_date': '2021-07-01T00:00:00.0000000Z',
'module_type': 'poly-si',
'ground_coverage_ratio': 0.47,
'derating_temp_module': 0.0039,
'derating_age_system': 0.0059,
'derating_other_system': 0.07,
'inverter_peak_efficiency': 0.985,
'tracker_axis_azimuth': 0,
'tracker_max_rotation_angle': 60,
'tracker_back_tracking': True,
'tracker_smart_tracking': False,
'terrain_slope': 0,
'terrain_azimuth': 0,
'dust_soiling_average': [0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015,
0.015],
'bifacial_system': False,
'site_ground_albedo': 0.25,
'bifaciality_factor': 0.7,
'pvrow_height': 1.5,
'pvrow_width': 2,
'is_unmetered': True,
'confirmed_metadata': '2023-12-19T07:18:21.2378120Z'
}
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ nav:
- '3.2 Comparing to Measurements [GHI]: Quality Controlling and Gap Filling Measurements with Solcast Actuals': 'notebooks/3.2 Comparing to Measurements [GHI] - Quality Controlling and Gap Filling Measurements with Solcast Actuals.ipynb'
- '3.2b Comparing to Measurements [GTI]: Quality Controlling and Gap Filling Measurements with Solcast Actuals': 'notebooks/3.2b Comparing to Measurements [GTI] - Quality Controlling and Gap Filling Measurements with Solcast Actuals.ipynb'
- '3.3 Comparing to Measurements: Accuracy Metrics': 'notebooks/3.3 Comparing to Measurements - Accuracy Metrics.ipynb'
- '4.1 Advanced PV Power: Setting up and Using PV Sites': 'notebooks/4.1 Setting up and Using PV Sites.ipynb'
- data:
- '3.1_sample_measurements.csv': 'notebooks/data/3.1_sample_measurements.csv'
- '3.2_sample_measurements.csv': 'notebooks/data/3.2_sample_measurements.csv'
Expand Down
2 changes: 1 addition & 1 deletion solcast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.2.2"
__version__ = "1.2.3"

from . import api, forecast, historic, live, tmy, unmetered_locations, urls

Expand Down
2 changes: 1 addition & 1 deletion solcast/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __repr__(self):
return f"status code={self.code}, url={self.url}, method={self.method}"

def to_dict(self):
if self.code != 200:
if self.code not in [200, 204]:
raise Exception(self.exception)
if self.code == 204: # Case of valid no content
return dict()
Expand Down

0 comments on commit a98ff77

Please sign in to comment.