Page 1 of 1

Best Practice: get_room_results() vs Get_all_results()

Posted: Mon Jan 21, 2019 3:24 am
by bbrannon4
Hi,

I'm a little confused to the distinction between these two methods, and there are parallels to some other methods with similar relationships, but let's just use these two for now:

Code: Select all

get_all_room_results(room_id, aps_var, var_level, [start_day], [end_day])
get_room_results( room_id, aps_var, vista_var, var_level, start_day = -1, end_day = -1 )
Specifically, the only difference I am seeing is that a variable level must be specified for the latter, which seems unnecessary because 'room' is in the method name, so I'd assume the level would always be 'z'. After that, what is the intended use for each? I would have assumed (based on the name) that the first one wouldn't take any room ID's and would return a dictionary with a specified variable for all the rooms in the model.

After that, what is the purpose of requiring both the 'aps_var' and the 'vista_var'? These are always matched pairs, right? So it seems like it's just requiring an extra step where I have to pull out a full list of all the variables to be sure I have both specified correctly.

Re: Best Practice: get_room_results() vs Get_all_results()

Posted: Tue Jan 22, 2019 8:18 am
by Rhind
Hi,

It's actually not always the case that 'aps_var' and 'vista_var' are matched pairs. There are some 'aps_var' you can specify for which there are multiple vista vars.

For example if you write:

Code: Select all

get_all_room_results(room_id, "Room air temperature&Room % saturation&Room radiant temperature", "z")
You'll get back something like:

Code: Select all

{'Standard effective temperature': array([ 22.87572479,  22.87210846,  22.86867142, ...,  22.88566399,
        22.88206482,  22.87883949], dtype=float32), 'People dissatisfied': array([ 10.54942513,  10.56272507,  10.57537842, ...,  10.50407791,
        10.52049828,  10.53558064], dtype=float32), 'Predicted mean vote': array([-0.51516265, -0.51577455, -0.51635593, ..., -0.5130707 ,
       -0.51382923, -0.51452488], dtype=float32), 'Comfort index': array([ 5.,  5.,  5., ...,  5.,  5.,  5.], dtype=float32)}
So the 'all' in get_all_room_results() refers to getting all the results for a particular aps variable (but still for a specified room). The non-all version gets it just for a particular vista variable. So you could specify e.g. 'Comfort index' to just get that set of results. You are however correct that in most cases the two methods will be practically equivalent.

Hope that helps clear up some confusion! :)