Skip to content

Commit

Permalink
Merge pull request #550 from mivek/fix/recent_intensity
Browse files Browse the repository at this point in the history
Fix/recent intensity
  • Loading branch information
mivek authored Dec 9, 2023
2 parents 08cbfaf + 40011f9 commit 4c0f866
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Indicator.P=greater than

Intensity.-=Light
Intensity.+=Heavy
Intensity.RE=Recent
Intensity.VC=In the vicinity

Phenomenon.BR=mist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ CloudQuantity.OVC=ciel couvert
CloudQuantity.SCT=nuages épars
CloudQuantity.SKC=pas de nuage

CloudType.AC=Altocumulus
CloudType.AS=Altostratus
CloudType.CB=Cumunolinbus
CloudType.CC=Cirrocumulus
CloudType.CI=Cirrus
CloudType.CS=Cirrostratus
CloudType.CU=Cumulus
CloudType.NS=Nimbostratus
CloudType.SC=Stratocumulus
CloudType.ST=Stratus
CloudType.TCU=Cumulus bourgeonnant

DepositBrakingCapacity.//=non reportée
Expand All @@ -16,6 +24,7 @@ DepositBrakingCapacity.93=moyenne
DepositBrakingCapacity.94=moyenne/bonne
DepositBrakingCapacity.95=bonne
DepositBrakingCapacity.99=valeurs non fiables
DepositBrakingCapacity.default=friction coefficient of {0}

DepositCoverage.NOT_REPORTED=non reportée
DepositCoverage.LESS_10=moins de 10%
Expand All @@ -25,8 +34,15 @@ DepositCoverage.FROM_51_TO_100=de 51% à 100%

DepositThickness.//=non reportée
DepositThickness.00=moins de 1 mm
DepositThickness.92=10 cm
DepositThickness.93=15 cm
DepositThickness.94=20 cm
DepositThickness.95=25 cm
DepositThickness.96=30 cm
DepositThickness.97=35 cm
DepositThickness.98=40 cm ou plus
DepositThickness.99=fermée
DepositThickness.default={0} mm

DepositType.NOT_REPORTED=non reportée
DepositType.CLEAR_DRY=clair et sec
Expand Down Expand Up @@ -75,6 +91,7 @@ Indicator.P=plus que
Intensity.-=Faible
Intensity.+=Fort
Intensity.RE=Récent(e)
Intensity.VC=Au voisinage de
Phenomenon.BR=brume
Expand All @@ -90,6 +107,7 @@ Phenomenon.HZ=brume sèche
Phenomenon.IC=cristaux de glace
Phenomenon.PL=granules de glace
Phenomenon.PO=tourbillon de poussières sable
Phenomenon.PY=spray
Phenomenon.RA=pluie
Phenomenon.SA=sable
Phenomenon.SG=neige en grains
Expand Down Expand Up @@ -162,6 +180,7 @@ Remark.Tower.Visibility=visibility de la tour de contrôle de {0} miles
Remark.Variable.Prevailing.Visibility=variation de la visibilité dominante entre {0} et {1} SM
Remark.Variable.Sky.Condition=couche de nuages variant entre {0} et {1}
Remark.Variable.Sky.Condition.Height=couche de nuages à {0} pieds variant entre {1} et {2}
Remark.VIRGA=virga
Remark.Virga.Direction=virga au {0} de la station
Remark.WATERSPOUT=trombe
Remark.Water.Equivalent.Snow.Ground=équivalent d''eau de {0} pouces de neige
Expand All @@ -187,6 +206,7 @@ Converter.SSE=Sud Sud Est
Converter.SSW=Sud Sud Ouest
Converter.SW=Sud Ouest
Converter.U=accroissement
Converter.VRB=Variable
Converter.W=Ouest
Converter.WNW=Ouest Nord Ouest
Converter.WSW=Ouest Sud Ouest
Expand All @@ -203,7 +223,9 @@ TimeIndicator.TL=jusqu'à
ToString.airport=aéroport
ToString.altimeter=altimètre (hPa)
ToString.amendment=amendement
ToString.auto=auto
ToString.baseHeight=Base de la couche en pied
ToString.cavok=cavok
ToString.clouds=nuages
ToString.day.month=jour du mois
ToString.day.hour=heure du jour
Expand All @@ -223,6 +245,7 @@ ToString.intensity=intensité
ToString.indicator=indicateur
ToString.message=message original
ToString.name=nom
ToString.nosig=nosig
ToString.phenomenons=phénomènes
ToString.probability=probabilité
ToString.quantity=quantité
Expand All @@ -237,12 +260,14 @@ ToString.temperature.max=température maximale (°C)
ToString.temperature.min=température minimale (°C)
ToString.trend=tendance
ToString.trends=tendances
ToString.type=type
ToString.visibility.main=visibilité principale
ToString.visibility.min=visibilité minimale
ToString.visibility.min.direction=direction de la visibilité minimale
ToString.visibility.max=visibilité maximale
ToString.vertical.visibility=visibilité verticale (pieds)
ToString.weather.conditions=conditions météorologique
ToString.wind.direction=direction
ToString.wind.direction.degrees=direction (degrés)
ToString.wind.gusts=rafales
ToString.wind.min.variation=variation minimale du vent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public enum Intensity {
LIGHT("-"),
/** Heavy intensity. */
HEAVY("+"),
/** Recent. */
RECENT("RE"),
/** In vicinity. */
IN_VICINITY("VC");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class AbstractWeatherContainerParser<T extends AbstractWeatherCo
/** Regex for the validity. */
protected static final Pattern VALIDITY_REGEX = Pattern.compile("^\\d{4}/\\d{4}$");
/** Pattern regex for the intensity of a phenomenon. */
private static final Pattern INTENSITY_REGEX = Pattern.compile("^(-|\\+|VC)");
private static final Pattern INTENSITY_REGEX = Pattern.compile("^(-|\\+|VC|RE)");
/** The remark parser. */
private final RemarkParser remarkParser;
/** The common command commonSupplier. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,17 @@ void testParsWithLowWind() {
assertEquals(0, m.getWind().getSpeed());
assertEquals(0, m.getWind().getDirectionDegrees());
}

@Test
void testParseWithRecentRain() {
String code = "LTAE 250250Z VRB02KT 9999 BKN030 BKN080 06/05 Q1005 RESHRA NOSIG RMK RWY21 07004KT 040V100";

Metar m = parser.parse(code);
assertEquals("LTAE", m.getStation());
assertEquals(1, m.getWeatherConditions().size());
assertEquals(Intensity.RECENT, m.getWeatherConditions().get(0).getIntensity());
assertEquals(Descriptive.SHOWERS, m.getWeatherConditions().get(0).getDescriptive());
assertEquals(1, m.getWeatherConditions().get(0).getPhenomenons().size());
assertEquals(Phenomenon.RAIN, m.getWeatherConditions().get(0).getPhenomenons().get(0));
}
}
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,26 @@
<jacoco.coverage.instruction.minimum>0.98</jacoco.coverage.instruction.minimum>
<jacoco.coverage.branch.minimum>0.96</jacoco.coverage.branch.minimum>
<jacoco.coverage.complexity.minimum>0.97</jacoco.coverage.complexity.minimum>
<archunit-junit5.version>1.1.0</archunit-junit5.version>
<checkstyle.version>10.12.4</checkstyle.version>
<commons-lang3.version>3.13.0</commons-lang3.version>
<archunit-junit5.version>1.2.1</archunit-junit5.version>
<checkstyle.version>10.12.6</checkstyle.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<hamcrest.version>2.2</hamcrest.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<junit.version>5.10.0</junit.version>
<maven-checkstyle-plugin.version>3.3.0</maven-checkstyle-plugin.version>
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
<junit.version>5.10.1</junit.version>
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven.gpg.plugin.version>3.1.0</maven.gpg.plugin.version>
<maven.javadoc.plugin.version>3.6.0</maven.javadoc.plugin.version>
<maven-project-info-reports-plugin.version>3.4.5</maven-project-info-reports-plugin.version>
<maven.javadoc.plugin.version>3.6.3</maven.javadoc.plugin.version>
<maven-project-info-reports-plugin.version>3.5.0</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
<maven.source.plugin.version>3.3.0</maven.source.plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<commons-csv.version>1.10.0</commons-csv.version>
<pitest-junit5-plugin.version>1.2.0</pitest-junit5-plugin.version>
<pitest-maven.version>1.15.1</pitest-maven.version>
<pitest-maven.version>1.15.3</pitest-maven.version>
<slf4j-nop.version>2.0.9</slf4j-nop.version>
<spotbugs-maven-plugin.version>4.7.3.6</spotbugs-maven-plugin.version>
<spotbugs-maven-plugin.version>4.8.2.0</spotbugs-maven-plugin.version>
<sonar.organization>mivek-github</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
Expand Down

0 comments on commit 4c0f866

Please sign in to comment.