Closed ChrisMarsh82 closed 8 months ago
@ChrisMarsh82 this is working as I expected it to work
To get seasonal_anything, then we need to have the start and end of the season
Both requests work if all the summaries are added.
If all the summaries are added, then the start and end dates are calculated and so the seasonal bits can be calculated. We need to have the start and end bits there which is why it throws the error.
@lilyclements but why can't it calculate that in the background? Why would I need to request more summaries? I am only interested in the start_rains, not anything else.
@ChrisMarsh82 If you want just start of rains it should work. If you want anything with seasons then the code needs to know the start and ends date for the season (otherwise how can we get the seasonal length or rainfall amounts). So you need to give definitions for how you want to define your start and end of season to get the seasonal summaries.
@lilyclements I understand that but I am not sending any more information by requesting more summaries. Although it needs the other summaries it should be a valid request to just ask for each summary individually. The code should be able to deal with each summary individually or any combination.
@ChrisMarsh82 sure. You said that:
The code should be able to deal with each summary individually or any combination.
It currently does deal with the summary individually (or in a combination) if it doesn't contain season
in the summary option
annual_rainfall_summaries("zm", "test_1", summaries = c("annual_rain"))
annual_rainfall_summaries("zm", "test_1", summaries = c("start_rains"))
annual_rainfall_summaries("zm", "test_1", summaries = c("end_rains"))
annual_rainfall_summaries("zm", "test_1", summaries = c("end_season"))
From previous discussions we decided to not have seasonal_length
work if there’s no parameters read in for it's dependents (start_rains
and end_season
(or end_rains
) variable). Similarly for seasonal_rainfall
. However, I don't mind how we want to approach this.
summaries
parameter for annual_rainfall_summaries
, that we run a check to see if start_rains
is defined in the json definitions file. If it is, we can use that to calculate the seasonal_
, and not give it in the data output (similarly for end_rains and end_season)?TODO:
If seasonal_*
are called and start_rains
and/or end_*
are not in the summaries parameter for annual_rainfall_summaries
, then run a check to see if start_rains
and end_rains
are defined in the json definitions file.
seasonal_
, and not give it in the data outputfixed by #62
Leaving this for you to check and close @ChrisMarsh82
Params: { "country": "zm", "station_id": "test_1", "summaries": [ "seasonal_rain" ] } error: Error in (function (country, station_id, summaries = c(\"annual_rain\", : \n start_rains and at least one of end_season or end_rains is required to calculate seasonal_rain\n"
and Params: { "country": "zm", "station_id": "test_1", "summaries": [ "seasonal_length" ] } error: Error in (function (country, station_id, summaries = c(\"annual_rain\", : \n start_rains and at least one of end_season or end_rains is required to calculate seasonal_length\n"
Both requests work if all the summaries are added.