Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Adding Survey Responses to Public Dashboard #124
Adding Survey Responses to Public Dashboard #124
Changes from 44 commits
758d2d8
a526257
c4cfdfa
427f44b
94f48c5
7f3d477
74768f7
99e0cc8
eb14800
3a3533d
f832c83
dc3bab8
ea0c660
157ad15
e6c7fe6
8ac86b7
5fe10e1
7d8a114
8a2c2f4
a04a316
af3dfa8
399c7b3
75d4fb6
45026b7
733e559
8a4869b
df6fde3
d6b2d80
0da6c33
8ff0b8b
8cdd6de
4ea4724
eff012b
4d0f7fb
6c7496f
1e41c35
80263ad
c98b623
10fe708
1b88265
1a7b911
0fae9fc
f1e94f5
61fa0f1
3fd5d01
e46a4b6
0f31ed6
596886a
8d0e285
130b732
fd16cad
52bc509
548a449
7e64d12
feb80dc
2dbd723
b02c1de
5e79051
7dbef2d
39d1156
7c7a718
6c38e97
a57a30f
b207efa
6957500
2e2e269
f9f3ba5
3d4c5fb
40c1478
6a36770
41db5cf
fb7bc70
334c95b
ef4786e
91cc8e7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abby-Wheelis why do you need to load composite trips? confirmed trips also have the user input handled properly and embedded in them.
https://github.com/e-mission/e-mission-server/blob/bc2d7b6b5f9fa1a9e981bbc5b911d7be9aaa393e/emission/core/wrapper/confirmedtrip.py#L24
Composite trips give you all the elements of the trip (the sections, stops and location points) in one object, but I don't think you need to use those elements for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we needed sections for a previous way that the survey choice was handled, but we should probably update them now, will the composite trips have the bluetooth sensed modes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest filtering for the survey assignment uses
confirmedMode?.baseMode == 'E_CAR'
, do you know where this confirmed mode comes from? I had been using the older version that relied on sections because that was what I had working (and therefore needed the composite trips). Is the bluetooth detected mode stored as a label?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will be once e-mission/e-mission-server#965 is merged. In the interim, as a hack, we will need to store the
confirmedMode
in the public dashboard pre-processing by treating the BLE objects as user input.Something like the following.
you can call it either before converting the trip list to a dataframe or to fill in the dataframe column later (preferable) using something like
df['confirmedMode'] = df.apply(lambda trip: get_confirmed_mode(ts, trip, ble_vehicle_mapping)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are
ts
andble_vehicle_mapping
? I'm getting errors aboutdata
being missing from the trips as well, but this seemed to work out when I wrapped the trip like{data: trip}
because I could see that it was searching for the attributedata.start_ts
. I tried thestart_ts
first asts
thinking it was timestamp, but I think it's actually timeseries, so I triedesta.TimeSeries.get_aggregate_time_series()
but I'm only gettingNone
backThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still getting
None
for all of the entries when I look up the"background/bluetooth_ble"
, I see in the blame that this was added to the server about 3 weeks ago, which I'm imagining would have been right around the time we started the Alpha testing - and the data I have is from the 15th, which was chosen to have the data from when GSA was in town testing ... I was thinking maybe it wouldn't be in this data but I just talked myself out of that, I'll keep investigating I think this is something I must be doing and not the dataThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using the dump from the 24th and the entries are there. don't know about the 15th
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried loading the most recent data, still no luck getting any of the
"background/bluetooth_ble"
entries. I am able to run the linematching_beacon = esdt.get_user_input_for_trip("analysis/confirmed_trip", trip._id, trip.user_id, "background/bluetooth_ble")
across all of the trips, but am gettingNone
in response for all of them. I have also tried with "cleaned_trip" and "composite_trip" but still allNone
, am I using the right trip key?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have now loaded the new data with
ble_sensed_summary
-- though not many of the trips seem to have a detected mode - of the 990 trips I have, 330 have an 'UNKOWN' mode, and 6 are sensed 'CAR'I used
expanded_ct["confirmedMode?.baseMode"] = participant_ct_df.ble_sensed_summary.apply(lambda md: max(md["distance"], key=md["distance"].get))
, and it seems to be working well, but not sure if it's what we expect, I think I'd expect more trips sensed asCAR
, and some sensed asECAR
... maybe I need to reevaluate how we distill the mode?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poking around at the entries for
ble_sensed_summary
, I do see some whereCAR
appears but is not the max by distance, is this expected? Are we picking up the beacon for some (but not all) of the trip? Or are they just trips with multiple segments? Only 6 trips with a detected beacon just seems quite low to meThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you have removed
load_composite_trips
, you can also removefilter_composite_trips
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that
filter_composite_trips
is not identical tofilter_labeled_trips
because it doesn't filter by blank user input. However, I don't understand why you are not filtering by blank user input. It should be possible to just callload_all_participant_trips
instead ofload_all_confirmed_trips
followed byfilter_composite_trips
to achieve the same result.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do, later, but I need all of the trips in order to create the "all trips for which a survey was prompted" information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes to the data loading (including pushing it to scaffolding) in #135 - I have the filtered, unfiltered, and file suffix all returned from a function in scaffolding now - I don't have the debug_df or quality_text included since it varies chart to chart