Skip to content

Commit

Permalink
fix: fixes weather code descriptions (#231)
Browse files Browse the repository at this point in the history
* fix: fixes weather code descriptions

* fix: add migrations
  • Loading branch information
ollz272 authored Apr 30, 2023
1 parent 2066864 commit 6d5f890
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 27 deletions.
53 changes: 26 additions & 27 deletions apps/weather/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,43 @@
class WeatherTypes(models.IntegerChoices):
"""Different weather types we can have in the database."""

"TODO, make these more precise!"
CLEAR_SKY = 0, "Clear sky"

MAINLY_CLEAR_1 = 1, "Mainly clear, partly cloudy, and overcast"
MAINLY_CLEAR_2 = 2, "Mainly clear, partly cloudy, and overcast"
MAINLY_CLEAR_3 = 3, "Mainly clear, partly cloudy, and overcast"
MAINLY_CLEAR_1 = 1, "Mainly clear"
MAINLY_CLEAR_2 = 2, "Mainly partly cloudy"
MAINLY_CLEAR_3 = 3, "Mainly overcast"

FOG_1 = 45, "Fog and depositing rime fog"
FOG_2 = 48, "Fog and depositing rime fog"
FOG_1 = 45, "Fog"
FOG_2 = 48, "Depositing rime fog"

DRIZZLE_1 = 51, "Drizzle: Light, moderate, and dense intensity"
DRIZZLE_2 = 53, "Drizzle: Light, moderate, and dense intensity"
DRIZZLE_3 = 55, "Drizzle: Light, moderate, and dense intensity"
DRIZZLE_1 = 51, "Light Drizzle"
DRIZZLE_2 = 53, "Moderate Drizzle"
DRIZZLE_3 = 55, "Heavy Drizzle"

FREEZING_DRIZZLE_1 = 56, "Freezing Drizzle: Light and dense intensity"
FREEZING_DRIZZLE_2 = 57, "Freezing Drizzle: Light and dense intensity"
FREEZING_DRIZZLE_1 = 56, "Light Freezing Drizzle"
FREEZING_DRIZZLE_2 = 57, "Heavy Freezing Drizzle"

RAIN_1 = 61, "Rain: Slight, moderate and heavy intensity"
RAIN_2 = 63, "Rain: Slight, moderate and heavy intensity"
RAIN_3 = 65, "Rain: Slight, moderate and heavy intensity"
RAIN_1 = 61, "Slight Rain"
RAIN_2 = 63, "Moderate Rain"
RAIN_3 = 65, "Heavy Rain"

FREEZING_RAIN_1 = 66, "Freezing Rain: Light and heavy intensity"
FREEZING_RAIN_2 = 67, "Freezing Rain: Light and heavy intensity"
FREEZING_RAIN_1 = 66, "Light Freezing Rain"
FREEZING_RAIN_2 = 67, "Heavy Freezing Rain"

SNOW_FALL_1 = 71, "Snow fall: Slight, moderate, and heavy intensity"
SNOW_FALL_2 = 73, "Snow fall: Slight, moderate, and heavy intensity"
SNOW_FALL_3 = 75, "Snow fall: Slight, moderate, and heavy intensity"
SNOW_FALL_1 = 71, "Light Snow fall"
SNOW_FALL_2 = 73, "Moderate Snow fall"
SNOW_FALL_3 = 75, "Heavy Snow fall"

SNOW_GRAINS = 77, "Snow grains"

RAIN_SHOWERS_1 = 80, "Rain showers: Slight, moderate, and violent"
RAIN_SHOWERS_2 = 81, "Rain showers: Slight, moderate, and violent"
RAIN_SHOWERS_3 = 82, "Rain showers: Slight, moderate, and violent"
RAIN_SHOWERS_1 = 80, "Slight Rain showers"
RAIN_SHOWERS_2 = 81, "Moderate Rain showers"
RAIN_SHOWERS_3 = 82, "Heavy Rain showers"

SNOW_SHOWERS_1 = 85, "Snow showers slight and heavy"
SNOW_SHOWERS_2 = 86, "Snow showers slight and heavy"
SNOW_SHOWERS_1 = 85, "Slight Snow showers"
SNOW_SHOWERS_2 = 86, "Heavy Snow showers"

THUNDERSTORM = 95, "Thunderstorm: Slight or moderate"
THUNDERSTORM = 95, "Thunderstorm"

THUNDERSTORM_HAIL_1 = 96, "Thunderstorm with slight and heavy hail"
THUNDERSTORM_HAIL_2 = 99, "Thunderstorm with slight and heavy hail"
THUNDERSTORM_HAIL_1 = 96, "Thunderstorm with slight hail"
THUNDERSTORM_HAIL_2 = 99, "Thunderstorm with heavy hail"
48 changes: 48 additions & 0 deletions apps/weather/migrations/0009_alter_weather_weather_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by Django 4.2 on 2023-04-30 08:03

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("weather", "0008_weather_weather_wea_date_ti_accf53_idx_and_more"),
]

operations = [
migrations.AlterField(
model_name="weather",
name="weather_code",
field=models.FloatField(
choices=[
(0, "Clear sky"),
(1, "Mainly clear"),
(2, "Mainly partly cloudy"),
(3, "Mainly overcast"),
(45, "Fog"),
(48, "Depositing rime fog"),
(51, "Light Drizzle"),
(53, "Moderate Drizzle"),
(55, "Heavy Drizzle"),
(56, "Light Freezing Drizzle"),
(57, "Heavy Freezing Drizzle"),
(61, "Slight Rain"),
(63, "Moderate Rain"),
(65, "Heavy Rain"),
(66, "Light Freezing Rain"),
(67, "Heavy Freezing Rain"),
(71, "Light Snow fall"),
(73, "Moderate Snow fall"),
(75, "Heavy Snow fall"),
(77, "Snow grains"),
(80, "Slight Rain showers"),
(81, "Moderate Rain showers"),
(82, "Heavy Rain showers"),
(85, "Slight Snow showers"),
(86, "Heavy Snow showers"),
(95, "Thunderstorm"),
(96, "Thunderstorm with slight hail"),
(99, "Thunderstorm with heavy hail"),
]
),
),
]

0 comments on commit 6d5f890

Please sign in to comment.