Skip to content

Commit

Permalink
Fix thunderstorm detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Jul 21, 2023
1 parent 51acd2a commit f562577
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.kylecorry"
version = "7.1.0"
version = "7.1.1"

afterEvaluate {
publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ internal class CloudPrecipitationCalculator {
private val alto = listOf(CloudGenus.Altocumulus, CloudGenus.Altostratus)
private val warm = listOf(CloudGenus.Stratus, CloudGenus.Nimbostratus)
private val cold = listOf(CloudGenus.Cumulus, CloudGenus.Cumulonimbus)
private val storm = listOf(CloudGenus.Nimbostratus, CloudGenus.Cumulonimbus)
private val coldStorm = listOf(CloudGenus.Cumulonimbus)
private val warmStorm = listOf(CloudGenus.Nimbostratus)

val frontPatterns = listOf(
listOf(cirro, alto, warm),
listOf(cirro, alto, cold),
listOf(storm),
listOf(coldStorm),
listOf(warmStorm),
listOf(cirro, alto)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,27 @@ class MeteorologyTest {
WeatherCondition.Clear
)
),
// clouds only - cold front (Cb only)
Arguments.of(
emptyList<Reading<Pressure>>(),
clouds(CloudGenus.Cumulonimbus),
temperatures(10f, 20f),
weatherAt(
weatherTime.minusSeconds(1),
WeatherFront.Cold,
null,
PressureTendency(PressureCharacteristic.Steady, 0f),
WeatherCondition.Storm,
WeatherCondition.Thunderstorm,
WeatherCondition.Precipitation,
WeatherCondition.Wind,
WeatherCondition.Rain
),
weatherLater(
PressureSystem.High,
WeatherCondition.Clear
)
),
// clouds only - cold front (Cb, cold temps)
Arguments.of(
emptyList<Reading<Pressure>>(),
Expand Down

0 comments on commit f562577

Please sign in to comment.