Skip to content

Commit

Permalink
improve weather data extraction for departements using meteo.data.gou…
Browse files Browse the repository at this point in the history
…v.fr source

One next step is to use meteofrance API
  • Loading branch information
antoinetavant committed Sep 11, 2024
1 parent 768124b commit 883ae59
Show file tree
Hide file tree
Showing 12 changed files with 392 additions and 254 deletions.
Empty file removed .gitattributes
Empty file.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ doc/_build
.vscode/settings.json
data/silver/*.nc
data/silver/weather_forecasts/*.nc
data/geo/*.nc
94 changes: 0 additions & 94 deletions data/geo/departements_name.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions data/geo/france_bounds.yml

This file was deleted.

Binary file added data/geo/lonlat_france.npz
Binary file not shown.
Binary file removed data/geo/mask_france_departements.nc
Binary file not shown.
Binary file removed data/geo/mask_france_regions.nc
Binary file not shown.
13 changes: 0 additions & 13 deletions data/geo/regions_name.yml

This file was deleted.

13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "energy-forecast"
dynamic = ["version"]
description = 'Predict the french electricity mix'
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.11"
license = "MIT"
keywords = []
authors = [
Expand All @@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"numpy>=1.25.0,<2.0.0", # numpy 2.0.0 is released but not yet supported by all dependencies
"numpy>=2.0",
"pandas",
"xarray",
"netCDF4",
Expand All @@ -35,9 +35,11 @@ dependencies = [
"eccodes",
"cfgrib",
"requests",
"pyyaml",
"statsmodels",

"geojson",
"shapely",
"tqdm",
"dask",
]

[project.urls]
Expand All @@ -48,6 +50,9 @@ Source = "https://github.com/GreenForecast-Squad/energetic-stress-production"
[tool.hatch.version]
path = "src/energy_forecast/__init__.py"

[tool.hatch.envs.default]
installer = "uv"

[tool.hatch.envs.types]
extra-dependencies = [
"mypy>=1.0.0",
Expand Down
196 changes: 102 additions & 94 deletions src/energy_forecast/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,98 +18,106 @@

#: List of all the departments in France
#: Ordered by as the mask ``"mask_france_departments.nc"``.
departements = ["Aisne ",
"Aube ",
"Calvados ",
"Cantal ",
"Eure-et-Loir ",
"Ille-et-Vilaine ",
"Jura ",
"Landes ",
"Loire ",
"Loiret ",
"Lot-et-Garonne ",
"Meuse ",
"Orne ",
"Pas-de-Calais ",
"Puy-de-Dôme ",
"Bas-Rhin ",
"Haut-Rhin ",
"Seine-Maritime ",
"Yonne ",
"Seine-Saint-Denis ",
"Alpes-de-Haute-Provence ",
"Hautes-Alpes ",
"Ardèche ",
"Ardennes ",
"Ariège ",
"Charente-Maritime ",
"Corrèze ",
"Dordogne ",
"Eure ",
"Indre-et-Loire ",
"Lozère ",
"Nièvre ",
"Oise ",
"Pyrénées-Atlantiques ",
"Rhône ",
"Saône-et-Loire ",
"Paris ",
"Yvelines ",
"Tarn ",
"Tarn-et-Garonne ",
"Var ",
"Vendée ",
"Haute-Vienne ",
"Vosges ",
"Hauts-de-Seine ",
"Allier ",
"Alpes-Maritimes ",
"Aude ",
"Corse-du-Sud ",
"Côtes-d'Armor ",
"Creuse ",
"Doubs ",
"Finistère ",
"Gard ",
"Gironde ",
"Indre ",
"Isère ",
"Marne ",
"Haute-Marne ",
"Moselle ",
"Hautes-Pyrénées ",
"Pyrénées-Orientales ",
"Savoie ",
"Haute-Savoie ",
"Seine-et-Marne ",
"Vaucluse ",
"Vienne ",
"Val-de-Marne ",
"Ain ",
"Aveyron ",
"Bouches-du-Rhône ",
"Charente ",
"Cher ",
"Haute-Corse ",
"Côte-d'Or ",
"Drôme ",
"Haute-Garonne ",
"Gers ",
"Hérault ",
"Haute-Loire ",
"Loire-Atlantique ",
"Lot ",
"Maine-et-Loire ",
"Manche ",
"Morbihan ",
"Nord ",
"Haute-Saône ",
"Sarthe ",
"Somme ",
"Essonne ",
"Val-d'Oise ",
"Loir-et-Cher ",
"Mayenne ",
"Meurthe-et-Moselle ",
departement_names = ["Aisne",
"Aube",
"Calvados",
"Cantal",
"Eure-et-Loir",
"Ille-et-Vilaine",
"Jura",
"Landes",
"Loire",
"Loiret",
"Lot-et-Garonne",
"Meuse",
"Orne",
"Pas-de-Calais",
"Puy-de-Dôme",
"Bas-Rhin",
"Haut-Rhin",
"Seine-Maritime",
"Yonne",
"Seine-Saint-Denis",
"Alpes-de-Haute-Provence",
"Hautes-Alpes",
"Ardèche",
"Ardennes",
"Ariège",
"Charente-Maritime",
"Corrèze",
"Dordogne",
"Eure",
"Indre-et-Loire",
"Lozère",
"Nièvre",
"Oise",
"Pyrénées-Atlantiques",
"Rhône",
"Saône-et-Loire",
# "Paris",
"Yvelines",
"Tarn",
"Tarn-et-Garonne",
"Var",
"Vendée",
"Haute-Vienne",
"Vosges",
"Hauts-de-Seine",
"Allier",
"Alpes-Maritimes",
"Aude",
"Corse-du-Sud",
"Côtes-d'Armor",
"Creuse",
"Doubs",
"Finistère",
"Gard",
"Gironde",
"Indre",
"Isère",
"Marne",
"Haute-Marne",
"Moselle",
"Hautes-Pyrénées",
"Pyrénées-Orientales",
"Savoie",
"Haute-Savoie",
"Seine-et-Marne",
"Vaucluse",
"Vienne",
"Val-de-Marne",
"Ain",
"Aveyron",
"Bouches-du-Rhône",
"Charente",
"Cher",
"Haute-Corse",
"Côte-d'Or",
"Drôme",
"Haute-Garonne",
"Gers",
"Hérault",
"Haute-Loire",
"Loire-Atlantique",
"Lot",
"Maine-et-Loire",
"Manche",
"Morbihan",
"Nord",
"Haute-Saône",
"Sarthe",
"Somme",
"Essonne",
"Val-d'Oise",
"Loir-et-Cher",
"Mayenne",
"Meurthe-et-Moselle",
"Deux-Sèvres",
]

france_bounds = {
"min_lon": -4.79542,
"max_lon": 9.55996,
"min_lat": 41.36484,
"max_lat": 51.089,
}
Loading

0 comments on commit 883ae59

Please sign in to comment.