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

Forecast Precisions #3759

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions web/src/api/moreCast2API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ export const marshalMoreCast2ForecastRecords = (forecasts: MoreCast2ForecastRow[
for_date: forecast.forDate.toMillis(),
precip: forecast.precip.value,
rh: forecast.rh.value,
temp: forecast.temp.value,
temp: Math.round(forecast.temp.value),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to be rounding values here. I think I would error on the side of maintaining precision in the event that a forecaster is using persistence forecasting or values from one of the weather models.

Or is the reason to do the rounding to prevent decimals from being sent to and appearing in the WFWX forecasting app?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to prevent decimals from appearing in WFWX, and following my interpretation of the acceptance criteria "Forecaster can only forecast integers for temp and wind speed". Without rounding, the front end would show integers but they would technically be forecasting floats if they're using models.
I also figured the discrepancy between Morecast and WFWX might be puzzling.

Open to changing it of course, that was just my interpretation of the desired functionality

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having WF1 and Morecast match is good enough reason for me! Thanks for the clarification!

wind_direction: Math.round(forecast.windDirection.value),
wind_speed: forecast.windSpeed.value,
wind_speed: Math.round(forecast.windSpeed.value),
grass_curing: forecast.grassCuring.value
}
})
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/moreCast2/components/MoreCast2Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ export class IndeterminateField implements ColDefGenerator, ForecastColDefGenera
}
}

export const tempForecastField = new IndeterminateField('temp', TEMP_HEADER, 'number', 1, true)
export const tempForecastField = new IndeterminateField('temp', TEMP_HEADER, 'number', 0, true)
export const rhForecastField = new IndeterminateField('rh', RH_HEADER, 'number', 0, true)
export const windDirForecastField = new IndeterminateField('windDirection', WIND_DIR_HEADER, 'number', 0, true)
export const windSpeedForecastField = new IndeterminateField('windSpeed', WIND_SPEED_HEADER, 'number', 1, true)
export const windSpeedForecastField = new IndeterminateField('windSpeed', WIND_SPEED_HEADER, 'number', 0, true)
export const precipForecastField = new IndeterminateField('precip', PRECIP_HEADER, 'number', 1, true)
export const gcForecastField = new IndeterminateField('grassCuring', GC_HEADER, 'number', 0, false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('MoreCast2Column', () => {
describe('TempForecastField', () => {
it('should have the desired configuration', () => {
const instance = tempForecastField
expect(tempForecastField.precision).toEqual(1)
expect(tempForecastField.precision).toEqual(0)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: tempForecastField.field,
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('MoreCast2Column', () => {
describe('WindSpeedForecastField', () => {
it('should have the desired configuration', () => {
const instance = windSpeedForecastField
expect(windSpeedForecastField.precision).toEqual(1)
expect(windSpeedForecastField.precision).toEqual(0)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: windSpeedForecastField.field,
Expand Down
Loading