Skip to content

Commit 6d0229d

Browse files
authored
Merge pull request #50 from GF-D6/main
Add soiling endpoints to SDK
2 parents 6ac3f79 + dd20e4d commit 6d0229d

20 files changed

Lines changed: 537 additions & 138 deletions

.github/workflows/docs.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
name: Docs
2+
23
on:
34
push:
45
branches:
5-
- master
6+
- master
67
- main
8+
79
permissions:
810
contents: write
11+
912
jobs:
1013
deploy:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-python@v4
16+
- uses: actions/checkout@v4
17+
18+
- uses: astral-sh/setup-uv@v4
1519
with:
16-
python-version: 3.x
17-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
18-
- uses: actions/cache@v3
20+
python-version: "3.11"
21+
22+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
23+
24+
- uses: actions/cache@v4
1925
with:
20-
key: mkdocs-material-${{ env.cache_id }}
21-
path: .cache
26+
key: uv-mkdocs-material-${{ env.cache_id }}
27+
path: ~/.cache/uv
2228
restore-keys: |
23-
mkdocs-material-
24-
- run: pip install .[docs]
25-
- run: mkdocs gh-deploy --force
29+
uv-mkdocs-material-
30+
31+
- run: uv sync --group docs
32+
33+
- run: uv run mkdocs gh-deploy --force

.github/workflows/publish-to-pypi.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,33 @@ name: Publish 📦 to PyPI
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
build-and-publish:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v5
1414

15-
- name: Install pypa/build
16-
run: >-
17-
python3 -m
18-
pip install
19-
build
20-
--user
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
2117

2218
- name: Build a binary wheel and a source tarball
2319
run: >-
24-
python3 -m
20+
uv
2521
build
2622
--sdist
2723
--wheel
28-
--outdir dist/
29-
.
30-
# - name: Publish distribution 📦 to Test PyPI
31-
# uses: pypa/gh-action-pypi-publish@release/v1
32-
# with:
33-
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
34-
# repository-url: https://test.pypi.org/legacy/
24+
--out-dir dist/
25+
# - name: Publish distribution 📦 to Test PyPI
26+
# uses: pypa/gh-action-pypi-publish@release/v1
27+
# with:
28+
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
29+
# repository-url: https://test.pypi.org/legacy/
3530
- name: Publish distribution 📦 to PyPI
3631
if: startsWith(github.ref, 'refs/tags')
3732
uses: pypa/gh-action-pypi-publish@release/v1
3833
with:
39-
password: ${{ secrets.PYPI_API_TOKEN }}
34+
password: ${{ secrets.PYPI_API_TOKEN }}
35+

.github/workflows/test.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
os: ['ubuntu-latest', 'macos-13', 'windows-latest']
9+
os: ["ubuntu-latest", "macos-14", "windows-latest"]
1010
python-version: ["3.8", "3.11"]
1111
runs-on: ${{ matrix.os }}
12+
1213
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v4
16-
with:
17-
python-version: ${{ matrix.python-version }}
18-
- name: Install dependencies
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
18+
19+
- name: Install dependencies with uv
1920
run: |
20-
python -m pip install --upgrade pip
21-
pip install .[all]
21+
uv python install ${{ matrix.python-version }}
22+
uv sync --python ${{ matrix.python-version }} --extra all --all-groups
23+
2224
- name: Test with pytest
2325
env:
2426
SOLCAST_API_KEY: ${{ secrets.SOLCAST_API_KEY }}
2527
run: |
26-
pytest tests
28+
uv run --python ${{ matrix.python-version }} --group test pytest tests

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
public
2+
dist
3+
uv.lock
4+
.python-version
25
.idea
36
*.ipynb_checkpoints
47
.pytest_cache

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"python.testing.pytestArgs": ["tests"],
3+
"python.testing.unittestEnabled": false,
4+
"python.testing.pytestEnabled": true
5+
}

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Changelog
22

3-
## [1.3.0] - 2024-07-10
3+
## [1.3.1] - 2025-11-19
4+
5+
- Add the `Kimber` and `HSU` to live, forecast, and historic module
46

5-
- Add the `aggregations` module. No tests as we are yet to expose unmetered aggregations.
7+
## [1.3.0] - 2024-07-10
68

9+
- Add the `aggregations` module. No tests as we are yet to expose unmetered aggregations.
710

811
## [1.2.5] - 2024-07-05
912

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@
1111
**Documentation**: <a href="https://solcast.github.io/solcast-api-python-sdk/" target="_blank">https://solcast.github.io/solcast-api-python-sdk/ </a>
1212

1313
## Install
14+
1415
```commandline
1516
pip install solcast
1617
```
17-
or from source:
18+
19+
or from source:
20+
1821
```commandline
1922
git clone https://github.com/Solcast/solcast-api-python-sdk.git
2023
cd solcast-api-python-sdk
2124
pip install .
2225
```
2326

2427
The vanilla version doesn't have any dependency. For full functionality,
25-
for example for getting the data into `DataFrames`, and for development, use the `[all]` tag:
28+
for example for getting the data into `DataFrames`, and for development, use the `[all]` tag:
29+
2630
```commandline
2731
pip install .[all] for the dev libs
2832
```
@@ -39,15 +43,32 @@ df = live.radiation_and_weather(
3943
).to_pandas()
4044
```
4145

42-
Don't forget to set your [account Api Key](https://toolkit.solcast.com.au/register) with:
43-
```export SOLCAST_API_KEY={your commercial api_key}```
46+
Don't forget to set your [account Api Key](https://toolkit.solcast.com.au/register) with:
47+
`export SOLCAST_API_KEY={your commercial api_key}`
4448

4549
---
4650

4751
## Contributing
48-
Tests are run against the Solcast API, you will need an API key to run them.
52+
53+
Tests are run against the Solcast API, you will need an API key to run them.
4954
They are executed on `unmetered locations` and as such won't consume your requests.
5055

5156
```commandline
5257
pytest tests
5358
```
59+
60+
### Formatters and Linters
61+
62+
| Language | Formatter/Linter |
63+
| -------- | ---------------- |
64+
| `yaml` | `yamlls` |
65+
| `toml` | `taplo` |
66+
| `python` | `black` |
67+
68+
### Recommended Python Development Version
69+
70+
Develop on the oldest supported `Python` version.
71+
72+
```bash
73+
uv python pin 3.8
74+
```

pyproject.toml

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ build-backend = "hatchling.build"
66
name = "solcast"
77
description = "a simple Python SDK for the Solcast API"
88
readme = "README.md"
9-
requires-python = ">=3.7"
9+
requires-python = ">=3.8"
1010
license = "Apache-2.0"
1111
classifiers = [
12-
"Intended Audience :: Information Technology",
13-
"Operating System :: OS Independent",
14-
"Programming Language :: Python :: 3",
15-
"Programming Language :: Python",
16-
"Topic :: Internet",
17-
"Topic :: Software Development :: Libraries :: Python Modules",
18-
"Topic :: Software Development :: Libraries",
19-
"Topic :: Software Development",
20-
"Topic :: Scientific/Engineering",
21-
"Typing :: Typed",
22-
"Development Status :: 4 - Beta",
23-
"Intended Audience :: Developers",
24-
"License :: OSI Approved :: Apache Software License",
25-
"Programming Language :: Python :: 3 :: Only",
26-
"Programming Language :: Python :: 3.7",
27-
"Programming Language :: Python :: 3.8",
28-
"Programming Language :: Python :: 3.9",
29-
"Programming Language :: Python :: 3.10",
30-
"Programming Language :: Python :: 3.11",
12+
"Intended Audience :: Information Technology",
13+
"Operating System :: OS Independent",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python",
16+
"Topic :: Internet",
17+
"Topic :: Software Development :: Libraries :: Python Modules",
18+
"Topic :: Software Development :: Libraries",
19+
"Topic :: Software Development",
20+
"Topic :: Scientific/Engineering",
21+
"Typing :: Typed",
22+
"Development Status :: 4 - Beta",
23+
"Intended Audience :: Developers",
24+
"License :: OSI Approved :: Apache Software License",
25+
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.7",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
3131
]
3232

3333
dynamic = ["version"]
@@ -38,21 +38,7 @@ Documentation = "https://solcast.github.io/solcast-api-python-sdk"
3838
Repository = "https://github.com/Solcast/solcast-api-python-sdk"
3939

4040
[project.optional-dependencies]
41-
docs = [
42-
"pytest",
43-
"mkdocs",
44-
"mkdocs-material",
45-
"mkdocstrings[python]==0.25",
46-
"mkdocs-jupyter",
47-
"kaleido"
48-
]
49-
all = [
50-
"notebook",
51-
"matplotlib",
52-
"pandas",
53-
"black",
54-
"solcast[docs]"
55-
]
41+
all = ["notebook", "matplotlib", "pandas"]
5642

5743
[tool.hatch.version]
5844
path = "solcast/__init__.py"
@@ -65,9 +51,16 @@ junit_family = "xunit2"
6551

6652
[tool.coverage.run]
6753
parallel = true
68-
source = [
69-
"docs",
70-
"tests",
71-
"solcast"
72-
]
54+
source = ["docs", "tests", "solcast"]
7355
context = '${CONTEXT}'
56+
57+
[dependency-groups]
58+
docs = [
59+
"kaleido>=1.2.0",
60+
"mkdocs>=1.6.1",
61+
"mkdocs-jupyter>=0.24.8",
62+
"mkdocs-material>=9.7.0",
63+
"mkdocstrings[python]==0.26.1",
64+
]
65+
lint = ["black>=24.8.0", "isort>=5.13.2"]
66+
test = ["pytest>=8.3.5"]

solcast/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
__version__ = "1.3.0"
1+
__version__ = "1.3.1"
22

33
from . import (
4-
api,
4+
aggregations,
55
forecast,
66
historic,
77
live,
8+
pv_power_sites,
89
tmy,
9-
aggregations,
1010
unmetered_locations,
11-
urls,
12-
pv_power_sites,
1311
)
1412

1513
__all__ = [

solcast/aggregations.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
from typing import Optional
22

33
from .api import Client, PandafiableResponse
4-
from .urls import (
5-
base_url,
6-
forecast_grid_aggregations,
7-
live_grid_aggregations,
8-
)
4+
from .urls import base_url, forecast_grid_aggregations, live_grid_aggregations
95

106

117
def live(

0 commit comments

Comments
 (0)