Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UK met office #36

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
abddf25
feat: Add ECMWF 0.25 IFS and AIFS models
colinnuk Mar 12, 2024
c5a9636
feat: Add Hourly units for ECMWF 0.25 models
colinnuk Mar 12, 2024
a8c5996
Merge branch 'AlienDwarf:master' into master
colinnuk Mar 12, 2024
cbd5d2c
fix: Reduce number of calls made to the open-meteo API in the tests -…
colinnuk Mar 13, 2024
748665f
feat: Add elevation API & tests
colinnuk Mar 13, 2024
6973bfb
fix: comment typos
colinnuk Mar 13, 2024
a56afca
Update package-and-deploy.yml
colinnuk Mar 22, 2024
47aa235
Delete .github/workflows/test-dev-build.yml
colinnuk Mar 22, 2024
4feb257
Merge pull request #1 from colinnuk/feature/elevation_api
colinnuk Mar 22, 2024
0eb818b
Update build-and-test.yml
colinnuk Mar 22, 2024
a8d10e6
Update package-and-deploy.yml
colinnuk Mar 22, 2024
e94bb0a
Update build-and-test.yml
colinnuk Mar 22, 2024
b00e779
Update OpenMeteo.csproj
colinnuk Mar 22, 2024
19dace5
Handle the OpenMeteo error responses more accurately
colinnuk Mar 22, 2024
0cee91b
Add models
colinnuk Mar 22, 2024
111b33e
Small tweak to error handling
colinnuk Mar 22, 2024
2fd56d2
Add gfs_graphcast025
colinnuk Apr 5, 2024
4ada501
Change to only log errors if we have set to rethrow exceptions
colinnuk Apr 9, 2024
8ad1b3f
Revert "Change to only log errors if we have set to rethrow exceptions"
colinnuk Apr 9, 2024
0f46876
Change errors to warnings - client code will have to log this if it n…
colinnuk Apr 9, 2024
3b47c1a
Upgrade lib to dotnet 8
colinnuk Apr 30, 2024
9fb4019
Merge pull request #2 from colinnuk/dotnet_8
colinnuk Apr 30, 2024
4dc5c11
Add pressure height params
colinnuk Apr 30, 2024
91f9d4f
Add new pressure level options
colinnuk May 1, 2024
cffdca2
Fix warning
colinnuk May 1, 2024
6b91bde
Add UK Met Office models
colinnuk Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ on:
paths:
- '**/*.cs'
- '**/*.csproj'
workflow_dispatch:

env:
DOTNET_VERSION: '6.x.x' # The .NET SDK version to use
DOTNET_VERSION: '8.x.x' # The .NET SDK version to use

jobs:
build-and-test:
Expand All @@ -22,7 +23,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest]

steps:
- name: Checkout Code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
- name: Package nuget
run: dotnet pack ./OpenMeteo/OpenMeteo.csproj --configuration release -o:package /p:PackageVersion=${{ steps.gitversion.outputs.AssemblySemVer }}

- name: Push generated package to NuGet.org
run: dotnet nuget push ./package/*.nupkg --api-key ${{ secrets.API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Push generated package to Github Packages
run: dotnet nuget push ./package/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/colinnuk/index.json --skip-duplicate
49 changes: 0 additions & 49 deletions .github/workflows/test-dev-build.yml

This file was deleted.

12 changes: 12 additions & 0 deletions OpenMeteo/ElevationApiResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace OpenMeteo
{
/// <summary>
/// Elevation API response
/// </summary>
public class ElevationApiResponse
{
/// <summary>
/// Elevation array in meters - this library currently only supports 1 input elevation so this will always be a single value array
public float[]? Elevation { get; set; }
}
}
21 changes: 21 additions & 0 deletions OpenMeteo/ElevationOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace OpenMeteo
{
internal class ElevationOptions
{
public ElevationOptions(float latitude, float longitude)
{
Latitude = latitude;
Longitude = longitude;
}

/// <summary>
/// Geographical WGS84 coordinate of the location
/// </summary>
public float Latitude { get; set; }

/// <summary>
/// Geographical WGS84 coordinate of the location
/// </summary>
public float Longitude { get; set; }
}
}
13 changes: 13 additions & 0 deletions OpenMeteo/ErrorResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;

namespace OpenMeteo
{
internal class ErrorResponse
{
[JsonPropertyName("reason")]
public string? Reason { get; set; }

[JsonPropertyName("error")]
public bool Error { get; set; }
}
}
44 changes: 44 additions & 0 deletions OpenMeteo/Hourly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,21 @@ public class Hourly
public float?[]? Temperature_950hPa { get; set; }
public float?[]? Temperature_925hPa { get; set; }
public float?[]? Temperature_900hPa { get; set; }
public float?[]? Temperature_875hPa { get; set; }
public float?[]? Temperature_850hPa { get; set; }
public float?[]? Temperature_825hPa { get; set; }
public float?[]? Temperature_800hPa { get; set; }
public float?[]? Temperature_775hPa { get; set; }
public float?[]? Temperature_750hPa { get; set; }
public float?[]? Temperature_725hPa { get; set; }
public float?[]? Temperature_700hPa { get; set; }
public float?[]? Temperature_675hPa { get; set; }
public float?[]? Temperature_650hPa { get; set; }
public float?[]? Temperature_625hPa { get; set; }
public float?[]? Temperature_600hPa { get; set; }
public float?[]? Temperature_575hPa { get; set; }
public float?[]? Temperature_550hPa { get; set; }
public float?[]? Temperature_525hPa { get; set; }
public float?[]? Temperature_500hPa { get; set; }
public float?[]? Temperature_400hPa { get; set; }
public float?[]? Temperature_300hPa { get; set; }
Expand Down Expand Up @@ -105,10 +116,21 @@ public class Hourly
public int?[]? Relativehumidity_950hPa { get; set; }
public int?[]? Relativehumidity_925hPa { get; set; }
public int?[]? Relativehumidity_900hPa { get; set; }
public int?[]? Relativehumidity_875hPa { get; set; }
public int?[]? Relativehumidity_850hPa { get; set; }
public int?[]? Relativehumidity_825hPa { get; set; }
public int?[]? Relativehumidity_800hPa { get; set; }
public int?[]? Relativehumidity_775hPa { get; set; }
public int?[]? Relativehumidity_750hPa { get; set; }
public int?[]? Relativehumidity_725hPa { get; set; }
public int?[]? Relativehumidity_700hPa { get; set; }
public int?[]? Relativehumidity_675hPa { get; set; }
public int?[]? Relativehumidity_650hPa { get; set; }
public int?[]? Relativehumidity_625hPa { get; set; }
public int?[]? Relativehumidity_600hPa { get; set; }
public int?[]? Relativehumidity_575hPa { get; set; }
public int?[]? Relativehumidity_550hPa { get; set; }
public int?[]? Relativehumidity_525hPa { get; set; }
public int?[]? Relativehumidity_500hPa { get; set; }
public int?[]? Relativehumidity_400hPa { get; set; }
public int?[]? Relativehumidity_300hPa { get; set; }
Expand All @@ -124,10 +146,21 @@ public class Hourly
public int?[]? Cloudcover_950hPa { get; set; }
public int?[]? Cloudcover_925hPa { get; set; }
public int?[]? Cloudcover_900hPa { get; set; }
public int?[]? Cloudcover_875hPa { get; set; }
public int?[]? Cloudcover_850hPa { get; set; }
public int?[]? Cloudcover_825hPa { get; set; }
public int?[]? Cloudcover_800hPa { get; set; }
public int?[]? Cloudcover_775hPa { get; set; }
public int?[]? Cloudcover_750hPa { get; set; }
public int?[]? Cloudcover_725hPa { get; set; }
public int?[]? Cloudcover_700hPa { get; set; }
public int?[]? Cloudcover_675hPa { get; set; }
public int?[]? Cloudcover_650hPa { get; set; }
public int?[]? Cloudcover_625hPa { get; set; }
public int?[]? Cloudcover_600hPa { get; set; }
public int?[]? Cloudcover_575hPa { get; set; }
public int?[]? Cloudcover_550hPa { get; set; }
public int?[]? Cloudcover_525hPa { get; set; }
public int?[]? Cloudcover_500hPa { get; set; }
public int?[]? Cloudcover_400hPa { get; set; }
public int?[]? Cloudcover_300hPa { get; set; }
Expand Down Expand Up @@ -181,10 +214,21 @@ public class Hourly
public float?[]? Geopotential_height_950hPa { get; set; }
public float?[]? Geopotential_height_925hPa { get; set; }
public float?[]? Geopotential_height_900hPa { get; set; }
public float?[]? Geopotential_height_875hPa { get; set; }
public float?[]? Geopotential_height_850hPa { get; set; }
public float?[]? Geopotential_height_825hPa { get; set; }
public float?[]? Geopotential_height_800hPa { get; set; }
public float?[]? Geopotential_height_775hPa { get; set; }
public float?[]? Geopotential_height_750hPa { get; set; }
public float?[]? Geopotential_height_725hPa { get; set; }
public float?[]? Geopotential_height_700hPa { get; set; }
public float?[]? Geopotential_height_675hPa { get; set; }
public float?[]? Geopotential_height_650hPa { get; set; }
public float?[]? Geopotential_height_625hPa { get; set; }
public float?[]? Geopotential_height_600hPa { get; set; }
public float?[]? Geopotential_height_575hPa { get; set; }
public float?[]? Geopotential_height_550hPa { get; set; }
public float?[]? Geopotential_height_525hPa { get; set; }
public float?[]? Geopotential_height_500hPa { get; set; }
public float?[]? Geopotential_height_400hPa { get; set; }
public float?[]? Geopotential_height_300hPa { get; set; }
Expand Down
98 changes: 98 additions & 0 deletions OpenMeteo/HourlyOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,25 @@ public enum HourlyOptionsParameter
temperature_950hPa,
temperature_925hPa,
temperature_900hPa,
temperature_875hPa,
temperature_850hPa,
temperature_825hPa,
temperature_800hPa,
temperature_775hPa,
temperature_750hPa,
temperature_725hPa,
temperature_700hPa,
temperature_675hPa,
temperature_650hPa,
temperature_625hPa,
temperature_600hPa,
temperature_575hPa,
temperature_550hPa,
temperature_525hPa,
temperature_500hPa,
temperature_475hPa,
temperature_450hPa,
temperature_425hPa,
temperature_400hPa,
temperature_300hPa,
temperature_250hPa,
Expand All @@ -177,11 +191,25 @@ public enum HourlyOptionsParameter
dewpoint_950hPa,
dewpoint_925hPa,
dewpoint_900hPa,
dewpoint_875hPa,
dewpoint_850hPa,
dewpoint_825hPa,
dewpoint_800hPa,
dewpoint_775hPa,
dewpoint_750hPa,
dewpoint_725hPa,
dewpoint_700hPa,
dewpoint_675hPa,
dewpoint_650hPa,
dewpoint_625hPa,
dewpoint_600hPa,
dewpoint_575hPa,
dewpoint_550hPa,
dewpoint_525hPa,
dewpoint_500hPa,
dewpoint_475hPa,
dewpoint_450hPa,
dewpoint_425hPa,
dewpoint_400hPa,
dewpoint_300hPa,
dewpoint_250hPa,
Expand All @@ -196,11 +224,25 @@ public enum HourlyOptionsParameter
relativehumidity_950hPa,
relativehumidity_925hPa,
relativehumidity_900hPa,
relativehumidity_875hPa,
relativehumidity_850hPa,
relativehumidity_825hPa,
relativehumidity_800hPa,
relativehumidity_775hPa,
relativehumidity_750hPa,
relativehumidity_725hPa,
relativehumidity_700hPa,
relativehumidity_675hPa,
relativehumidity_650hPa,
relativehumidity_625hPa,
relativehumidity_600hPa,
relativehumidity_575hPa,
relativehumidity_550hPa,
relativehumidity_525hPa,
relativehumidity_500hPa,
relativehumidity_475hPa,
relativehumidity_450hPa,
relativehumidity_425hPa,
relativehumidity_400hPa,
relativehumidity_300hPa,
relativehumidity_250hPa,
Expand All @@ -215,11 +257,25 @@ public enum HourlyOptionsParameter
cloudcover_950hPa,
cloudcover_925hPa,
cloudcover_900hPa,
cloudcover_875hPa,
cloudcover_850hPa,
cloudcover_825hPa,
cloudcover_800hPa,
cloudcover_775hPa,
cloudcover_750hPa,
cloudcover_725hPa,
cloudcover_700hPa,
cloudcover_675hPa,
cloudcover_650hPa,
cloudcover_625hPa,
cloudcover_600hPa,
cloudcover_575hPa,
cloudcover_550hPa,
cloudcover_525hPa,
cloudcover_500hPa,
cloudcover_475hPa,
cloudcover_450hPa,
cloudcover_425hPa,
cloudcover_400hPa,
cloudcover_300hPa,
cloudcover_250hPa,
Expand All @@ -234,11 +290,25 @@ public enum HourlyOptionsParameter
windspeed_950hPa,
windspeed_925hPa,
windspeed_900hPa,
windspeed_875hPa,
windspeed_850hPa,
windspeed_825hPa,
windspeed_800hPa,
windspeed_775hPa,
windspeed_750hPa,
windspeed_725hPa,
windspeed_700hPa,
windspeed_675hPa,
windspeed_650hPa,
windspeed_625hPa,
windspeed_600hPa,
windspeed_575hPa,
windspeed_550hPa,
windspeed_525hPa,
windspeed_500hPa,
windspeed_475hPa,
windspeed_450hPa,
windspeed_425hPa,
windspeed_400hPa,
windspeed_300hPa,
windspeed_250hPa,
Expand All @@ -253,11 +323,25 @@ public enum HourlyOptionsParameter
winddirection_950hPa,
winddirection_925hPa,
winddirection_900hPa,
winddirection_875hPa,
winddirection_850hPa,
winddirection_825hPa,
winddirection_800hPa,
winddirection_775hPa,
winddirection_750hPa,
winddirection_725hPa,
winddirection_700hPa,
winddirection_675hPa,
winddirection_650hPa,
winddirection_625hPa,
winddirection_600hPa,
winddirection_575hPa,
winddirection_550hPa,
winddirection_525hPa,
winddirection_500hPa,
winddirection_475hPa,
winddirection_450hPa,
winddirection_425hPa,
winddirection_400hPa,
winddirection_300hPa,
winddirection_250hPa,
Expand All @@ -272,11 +356,25 @@ public enum HourlyOptionsParameter
geopotential_height_950hPa,
geopotential_height_925hPa,
geopotential_height_900hPa,
geopotential_height_875hPa,
geopotential_height_850hPa,
geopotential_height_825hPa,
geopotential_height_800hPa,
geopotential_height_775hPa,
geopotential_height_750hPa,
geopotential_height_725hPa,
geopotential_height_700hPa,
geopotential_height_675hPa,
geopotential_height_650hPa,
geopotential_height_625hPa,
geopotential_height_600hPa,
geopotential_height_575hPa,
geopotential_height_550hPa,
geopotential_height_525hPa,
geopotential_height_500hPa,
geopotential_height_475hPa,
geopotential_height_450hPa,
geopotential_height_425hPa,
geopotential_height_400hPa,
geopotential_height_300hPa,
geopotential_height_250hPa,
Expand Down
Loading
Loading