Urban-Analytics / RAMP-UA

https://urban-analytics.github.io/RAMP-UA/
MIT License
15 stars 10 forks source link

Add parameter for lockdown scenario #102

Closed spoonerf closed 4 years ago

spoonerf commented 4 years ago

Not sure if this is an appropriate use of Issues so apologies if not! @nickmalleson Would it be possible to add a parameter selecting which lockdown scenario to use? For example if we had a .csv referencing the actual lockdown and another one referencing lockdown a week earlier.

nickmalleson commented 4 years ago

Yes absolutely, I'll add that after lunch (its an easy one).

-- Sent from a mobile, sorry about the grammar


From: Fiona Spooner notifications@github.com Sent: Monday, August 17, 2020 1:08:47 PM To: Urban-Analytics/RAMP-UA RAMP-UA@noreply.github.com Cc: Nicolas Malleson N.S.Malleson@leeds.ac.uk; Mention mention@noreply.github.com Subject: [Urban-Analytics/RAMP-UA] Add parameter for lockdown scenario (#102)

Not sure if this is an appropriate use of Issues so apologies if not! @nickmallesonhttps://github.com/nickmalleson Would it be possible to add a parameter selecting which lockdown scenario to use? For example if we had a .csv referencing the actual lockdown and another one referencing lockdown a week earlier.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Urban-Analytics/RAMP-UA/issues/102, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQLWMYOPYFSMN5GMTJ4WFDSBEMU7ANCNFSM4QBSMBLA.

spoonerf commented 4 years ago

Brilliant, thanks!

nickmalleson commented 4 years ago

Just done it here https://github.com/Urban-Analytics/RAMP-UA/pull/103 but I have to go and haven't tested it properly. The default behaviour is to continue reading google, but there is now a parameter you can set to change that file name. Or passing an empty string turns off any lockdown. Let me know if you see any problems and I'll check it properly tomorrow.

spoonerf commented 4 years ago

Hi Nick, It looks as if it is always reading the original lockdown file. At least in the terminal output it shows the "google_mobility_lockdown_daily.csv" lockdown multiplier whether I use "", "google_mobility_lockdown_daily.csv" or "google_mobility_lockdown_daily_week_earlier.csv".

nickmalleson commented 4 years ago

That's really weird, I can't replicate the behaviour. Are you using the parameters file? If I put a non-existant file name in here:

https://github.com/Urban-Analytics/RAMP-UA/blob/236b292fd46d59608b37b9797f182c42f076dcb4/model_parameters/default.yml#L11

I get a FileNotFound error, so it's definitely trying to read the file. What happens if you put a non-existnat file in?

nickmalleson commented 4 years ago

(P.S. please also get the latest version of master)

spoonerf commented 4 years ago

Ah yes it doesn't like it if I read in a non-existant file. It seems to be reading in the correct file but it is printing out the values from the google_mobility_lockdown_daily.csv file regardless of which file (or no file) is input, so I'm not sure which is being used.

Lines 1229-1231 on microsim_model.py

timeout_multiplier = self.time_activity_multiplier.loc[ self.time_activity_multiplier.day == self.iteration, "timeout_multiplier"].values[0] print(f"\tApplying regular (google mobility) lockdown multiplier {timeout_multiplier}")

Am using the latest version of master

spoonerf commented 4 years ago

Ah sorry ignore this!