Skip to content

Commit 5ad88f8

Browse files
authored
updated method names; check for update -> opt-in (#118)
* updated method names; check for update -> opt-in * switched from poetry to uv (#120)
1 parent 92270f6 commit 5ad88f8

17 files changed

+2770
-2661
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ RUN apt-get update && apt-get install -y \
1313
ENV PYTHONDONTWRITEBYTECODE=1 \
1414
PYTHONUNBUFFERED=1
1515

16-
RUN curl -sSL https://install.python-poetry.org | python3 - \
17-
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry
16+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
17+
&& mv /root/.cargo/bin/uv /usr/local/bin/uv
1818

19-
COPY pyproject.toml poetry.lock ./
19+
COPY pyproject.toml uv.lock ./
2020

21-
RUN poetry config virtualenvs.create false \
22-
&& poetry install --no-root --no-interaction --no-ansi --only=docs
21+
RUN uv sync --extra docs --frozen
2322

2423
# Default command
2524
CMD [ "bash" ]

.github/workflows/deploy-docs.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set Up Python
3333
uses: actions/setup-python@v4
3434
with:
35-
python-version: '3.x'
35+
python-version: "3.x"
3636

3737
- name: Set Cache ID
3838
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
@@ -45,16 +45,13 @@ jobs:
4545
restore-keys: |
4646
mkdocs-material-
4747
48-
- name: Install Poetry
48+
- name: Install uv
4949
run: |
50-
curl -sSL https://install.python-poetry.org | python3 -
51-
ln -s /root/.local/bin/poetry /usr/local/bin/poetry
52-
53-
- name: Configure Poetry
54-
run: poetry config virtualenvs.create false
50+
curl -LsSf https://astral.sh/uv/install.sh | sh
51+
echo "$HOME/.local/bin" >> $GITHUB_PATH
5552
5653
- name: Install Dependencies
57-
run: poetry install --no-root --no-interaction --no-ansi --only=docs
54+
run: uv sync --extra docs --frozen
5855

5956
- name: Deploy to GitHub Pages
6057
env:

README.md

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ dotnet build
4343

4444
---
4545
## Configuration
46-
Before using the SDK, you need to set your Solcast API key as an environment variable. You can register for an API key at Solcast Toolkit.
46+
47+
Before using the SDK, you need to set your Solcast API key as an environment variable. You can register for an API key at [Solcast Toolkit](https://toolkit.solcast.com.au/).
4748

4849
To set the API key in your environment:
4950

@@ -65,7 +66,7 @@ export SOLCAST_API_KEY="{your_api_key}"
6566
using Solcast.Clients;
6667

6768
var liveClient = new LiveClient();
68-
var response = await liveClient.GetRadiationAndWeather(
69+
var response = await liveClient.GetLiveRadiationAndWeather(
6970
latitude: -33.856784,
7071
longitude: 151.215297,
7172
outputParameters: ["air_temp", "dni", "ghi"]
@@ -80,7 +81,7 @@ Console.WriteLine(response.RawResponse);
8081
using Solcast.Clients;
8182

8283
var forecastClient = new ForecastClient();
83-
var response = await forecastClient.GetForecast(
84+
var response = await forecastClient.GetForecastRadiationAndWeather(
8485
latitude: -33.856784,
8586
longitude: 151.215297,
8687
outputParameters: ["air_temp", "dni", "ghi"]
@@ -92,7 +93,7 @@ var response = await forecastClient.GetForecast(
9293
using Solcast.Clients;
9394

9495
var historicClient = new HistoricClient();
95-
var response = await historicClient.GetRadiationAndWeather(
96+
var response = await historicClient.GetHistoricRadiationAndWeather(
9697
latitude: -33.856784,
9798
longitude: 151.215297,
9899
start: "2022-01-01T00:00",
@@ -105,7 +106,7 @@ var response = await historicClient.GetRadiationAndWeather(
105106
using Solcast.Clients;
106107

107108
var tmyClient = new TmyClient();
108-
var response = await tmyClient.GetRadiationAndWeather(
109+
var response = await tmyClient.GetTmyRadiationAndWeather(
109110
latitude: -33.856784,
110111
longitude: 151.215297,
111112
);
@@ -116,7 +117,7 @@ var response = await tmyClient.GetRadiationAndWeather(
116117
using Solcast.Clients;
117118

118119
var aggregationClient = new AggregationClient();
119-
var response = await aggregationClient.GetForecastAggregation(
120+
var response = await aggregationClient.GetForecastAggregations(
120121
collectionId: "country_total",
121122
aggregationId: "it_total",
122123
outputParameters: ["percentage", "pv_estimate"],
@@ -128,60 +129,65 @@ var response = await aggregationClient.GetForecastAggregation(
128129
```csharp
129130
using Solcast.Clients;
130131

131-
var pvClient = new PvPowerSitesClient();
132-
var response = await pvClient.ListPvPowerSites();
132+
var pvClient = new PvPowerSiteClient();
133+
var response = await pvClient.GetPvPowerSites();
133134
```
134135

135136
#### Getting metadata of a specific PV Power Site:
136137
```csharp
137138
using Solcast.Clients;
138139

139-
var pvClient = new PvPowerSitesClient();
140+
var pvClient = new PvPowerSiteClient();
140141
var response = await pvClient.GetPvPowerSite("ba75-e17a-7374-95ed");
141142
```
142143

143144
## API Methods
144145
### LiveClient
145-
- `GetRadiationAndWeather`: Retrieves live solar radiation and weather data.
146-
- `GetAdvancedPvPower`: Retrieves advanced PV power live data.
147-
- `GetRooftopPvPower`: Retrieves live rooftop PV power data based on location and other parameters.
146+
- `GetLiveRadiationAndWeather`: Retrieves live solar radiation and weather data.
147+
- `GetLiveAdvancedPvPower`: Retrieves advanced PV power live data.
148+
- `GetLiveRooftopPvPower`: Retrieves live rooftop PV power data based on location and other parameters.
148149
### ForecastClient
149-
- `GetForecast`: Retrieves forecast solar radiation and weather data for up to 14 days ahead.
150-
- `GetRadiationAndWeather`: Retrieves forecast radiation and weather data for a specified location.
151-
- `GetAdvancedPvPower`: Retrieves advanced PV power forecasts with customizable options.
152-
- `GetRooftopPvPower`: Retrieves rooftop PV power forecast data based on location and other parameters.
150+
- `GetForecastRadiationAndWeather`: Retrieves irradiance and weather forecasts for the requested location from the present up to 14 days ahead
151+
- `GetForecastAdvancedPvPower`: Retrieves advanced PV power forecasts with customizable options.
152+
- `GetForecastRooftopPvPower`: Retrieves rooftop PV power forecast data based on location and other parameters.
153153
### HistoricClient
154-
- `GetRadiationAndWeather`: Retrieves historic solar radiation and weather data for a specified time range.
155-
- `GetAdvancedPvPower`: Retrieves advanced PV power historical data.
156-
- `GetRooftopPvPower`: Retrieves rooftop PV power historical data.
154+
- `GetHistoricRadiationAndWeather`: Retrieves historic solar radiation and weather data for a specified time range.
155+
- `GetHistoricAdvancedPvPower`: Retrieves advanced PV power historical data.
156+
- `GetHistoricRooftopPvPower`: Retrieves rooftop PV power historical data.
157157
### TmyClient
158-
- `GetRadiationAndWeather`: Retrieves TMY irradiance and weather data for a specified location.
159-
- `GetAdvancedPvPower`: Retrieves advanced PV power TMY data.
160-
- `GetRooftopPvPower`: Retrieves TMY rooftop PV power data.
158+
- `GetTmyRadiationAndWeather`: Retrieves TMY irradiance and weather data for a specified location.
159+
- `GetTmyAdvancedPvPower`: Retrieves advanced PV power TMY data.
160+
- `GetTmyRooftopPvPower`: Retrieves TMY rooftop PV power data.
161161
### AggregationClient
162-
- `GetLiveAggregation`: Retrieves live grid aggregation data for up to 7 days.
163-
- `GetForecastAggregation`: Retrieves forecast grid aggregation data for up to 7 days.
164-
### PvPowerSitesClient
162+
- `GetLiveAggregations`: Retrieves live grid aggregation data for up to 7 days.
163+
- `GetForecastAggregations`: Retrieves forecast grid aggregation data for up to 7 days.
164+
### PvPowerSiteClient
165165
- `GetPvPowerSites`: Retrieves a list of all available PV power sites.
166166
- `GetPvPowerSite`: Retrieves metadata for a specific PV power site by its resource ID.
167167
- `PostPvPowerSite`: Creates a new PV Power Site for use with advanced PV power model.
168168
- `PatchPvPowerSite`: Partially updates the specifications of an existing PV power site.
169169
- `PutPvPowerSite`: Overwrites an existing PV power site specifications.
170170
- `DeletePvPowerSite`: Deletes an existing PV power site.
171171

172-
## Optional: Suppressing SDK Update Checks
173-
To suppress the SDK's automatic update check, set the SUPPRESS_SDK_UPDATE_CHECK environment variable to true:
172+
## Optional: Enabling SDK Update Checks
173+
By default, the SDK does not check for updates during runtime. To enable automatic update checking, you can pass `true` for the `checkForUpdates` parameter when creating client instances:
174+
175+
```csharp
176+
var liveClient = new LiveClient(checkForUpdates: true);
177+
```
178+
179+
Alternatively, to enable update checking automatically for all client instances, set the CHECK_SDK_UPDATE environment variable to true:
174180

175181
Windows PowerShell:
176182
```powershell
177-
$env:SUPPRESS_SDK_UPDATE_CHECK = "true"
183+
$env:CHECK_SDK_UPDATE = "true"
178184
```
179185

180186
Linux/macOS:
181187
```bash
182-
export SUPPRESS_SDK_UPDATE_CHECK="true"
188+
export CHECK_SDK_UPDATE="true"
183189
```
184-
When this flag is set, the SDK will skip checking for new versions during runtime. This is particularly useful automated environments where update messages are not necessary.
190+
When this flag is set, the SDK will automatically check for new versions during runtime regardless of the `checkForUpdates` parameter value.
185191

186192
## Contributing
187193
We welcome contributions to this SDK! If you'd like to contribute, please submit a Pull Request or open an issue with any suggestions or bug reports.

0 commit comments

Comments
 (0)