Skip to content

Commit

Permalink
added description to the endpoints in the openapi.json
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-solcast committed Nov 13, 2024
1 parent 5f1bc01 commit f6d05fe
Show file tree
Hide file tree
Showing 9 changed files with 482 additions and 156 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ TestResults/
.vscode/launch.json
.env
venv
public/
/tmp/
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,31 @@ var response = await pvClient.GetPvPowerSite("ba75-e17a-7374-95ed");
## API Methods
### LiveClient
- `GetRadiationAndWeather`: Retrieves live solar radiation and weather data.
- `GetAdvancedPvPower`: Retrieves advanced PV power live data.
- `GetRooftopPvPower`: Retrieves live rooftop PV power data based on location and other parameters.
### ForecastClient
- `GetForecast`: Retrieves forecast solar radiation and weather data for up to 14 days ahead.
- `GetRadiationAndWeather`: Retrieves forecast radiation and weather data for a specified location.
- `GetAdvancedPvPower`: Retrieves advanced PV power forecasts with customizable options.
- `GetRooftopPvPower`: Retrieves rooftop PV power forecast data based on location and other parameters.
### HistoricClient
- `GetRadiationAndWeather`: Retrieves historic solar radiation and weather data.
- `GetRadiationAndWeather`: Retrieves historic solar radiation and weather data for a specified time range.
- `GetAdvancedPvPower`: Retrieves advanced PV power historical data.
- `GetRooftopPvPower`: Retrieves rooftop PV power historical data.
### TmyClient
- `GetRadiationAndWeather`: Retrieves TMY (Typical Meteorological Year) irradiance and weather data.
- `GetRooftopPvPower`: Retrieves TMY rooftop PV power estimated actuals.
- `GetRadiationAndWeather`: Retrieves TMY irradiance and weather data for a specified location.
- `GetAdvancedPvPower`: Retrieves advanced PV power TMY data.
- `GetRooftopPvPower`: Retrieves TMY rooftop PV power data.
### AggregationClient
- `GetLiveAggregation`: Retrieves live grid aggregation data for up to 7 days.
- `GetForecastAggregation`: Retrieves forecast grid aggregation data for up to 7 days.
### PvPowerSitesClient
- `ListPvPowerSites`: Retrieves a list of available PV Power Sites.
- `GetPvPowerSite`: Retrieves metadata for a specific PV Power Site.
- `CreatePvPowerSite`: Creates a new PV Power Site for use with advanced solar power modeling.
- `PatchPvPowerSite`: Partially updates the metadata for an existing PV Power Site.
- `UpdatePvPowerSite`: Overwrites the metadata for an existing PV Power Site.
- `DeletePvPowerSite`: Deletes an existing PV Power Site.
- `GetPvPowerSites`: Retrieves a list of all available PV power sites.
- `GetPvPowerSite`: Retrieves metadata for a specific PV power site by its resource ID.
- `PostPvPowerSite`: Creates a new PV Power Site for use with advanced PV power model.
- `PatchPvPowerSite`: Partially updates the specifications of an existing PV power site.
- `PutPvPowerSite`: Overwrites an existing PV power site specifications.
- `DeletePvPowerSite`: Deletes an existing PV power site.


## Contributing
Expand All @@ -168,6 +176,11 @@ To generate the sdk from the openapi specs run:
python3 generate_sdk_csharp.py
```

To generate the documentation run:
```bash
python3 generate_sdk_docs.py [--use-cache]
```

## Running Tests
To run the tests, use the following command:
```bash
Expand Down
39 changes: 0 additions & 39 deletions docs/aggregations.md

This file was deleted.

16 changes: 8 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Welcome to Solcast

A simple C# SDK that wraps [Solcast's API](https://docs.solcast.com.au/).
C# SDK that wraps [Solcast's API](https://docs.solcast.com.au/).

## Install

Expand Down Expand Up @@ -55,14 +55,14 @@ For more detailed documentation, visit the following pages:

| Module | API Docs |
|------------------|------------------------------------------|
| `live` | [Solcast.Clients.LiveClient](live.md) |
| `historic` | [Solcast.Clients.HistoricClient](historic.md) |
| `forecast` | [Solcast.Clients.ForecastClient](forecast.md) |
| `tmy` | [Solcast.Clients.TmyClient](tmy.md) |
| `pv_power_sites` | [Solcast.Clients.PvPowerSitesClient](pv_power_sites.md) |
| `aggregations` | [Solcast.Clients.AggregationClient](aggregations.md) |
| `Live` | [Solcast.Clients.LiveClient](live.md) |
| `Historic` | [Solcast.Clients.HistoricClient](historic.md) |
| `Forecast` | [Solcast.Clients.ForecastClient](forecast.md) |
| `TMY` | [Solcast.Clients.TmyClient](tmy.md) |
| `PV Power Sites` | [Solcast.Clients.PvPowerSiteClient](pvpowersite.md) |
| `Aggregations` | [Solcast.Clients.AggregationClient](aggregation.md) |


## API Documentation
For more detailed information about the Solcast API, please visit the official API documentation.
For more detailed information about the Solcast API, please visit the official [API documentation](http://docs.solcast.com.au).

10 changes: 5 additions & 5 deletions docs/notebooks/1.1 Getting Data - Historic Solar Radiation.ipynb

Large diffs are not rendered by default.

88 changes: 0 additions & 88 deletions docs/pv_power_sites.md

This file was deleted.

10 changes: 6 additions & 4 deletions generate_sdk_csharp.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def generate_csharp_method_with_usings(endpoint, method, parameters, spec, respo
# Generate XML comments for the method
method_description = spec.get('paths', {}).get(endpoint, {}).get(method, {}).get('description', "")
xml_comment = generate_xml_comment(method_description)
param_comments = "\n\n"
param_comments = "\n"
for param in parameters:
param_name = to_camel_case(param['name'])
param_description = param.get('description', "")
Expand Down Expand Up @@ -406,10 +406,12 @@ def generate_solcast_urls_class_from_spec(endpoint_details):


def generate_xml_comment(description):
"""Generate an XML comment from a description string."""
"""Generate an XML comment from a multi-line description string with each line prefixed by ///."""
if description:
return f"\n /// <summary>\n /// {description}\n /// </summary>\n"
return ""
# Split the description into lines and prefix each with "///"
comment_lines = "\n".join(f" /// {line}" for line in description.splitlines())
return f"\n\n /// <summary>\n{comment_lines}\n /// </summary>"
return "\n"


# Generate Models for Requests and Responses
Expand Down
Loading

0 comments on commit f6d05fe

Please sign in to comment.