-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for a new module on datetime Similar to moment.js in javascript, and supports parsing ISO format strings as well as getting the timestamp from a datetime object, something which requires too much fiddling otherwise. * Fix a bunch of issues with the initial data collection for ground truth - In particular, the iOS battery level was never read, so we always got -100 - The android key was always "sensor_config" (because when we updated the read timestamp on the document, it updated everything including the key) e-mission/cordova-usercache#14 * Fix issue with tour model creation Found this while running the intake pipeline locally. Does not appear to happen on the real server, but fixing corner cases is important! * Add support for displaying the formatted time from the data_df in geojson Makes it easier to debug maps in the various evaluations
- Loading branch information
Showing
5 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import emission.core.get_database as edb | ||
|
||
edb.get_timeseries_db().remove({'metadata.key': 'background/battery', | ||
'data.battery_level_pct': -100}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import emission.core.get_database as edb | ||
|
||
|
||
def fix_key(check_field, new_key): | ||
print "First entry for "+new_key+" is %s" % list(edb.get_timeseries_db().find( | ||
{"metadata.key": "config/sensor_config", | ||
check_field: {"$exists": True}}).sort( | ||
"metadata/write_ts").limit(1)) | ||
udb = edb.get_usercache_db() | ||
tdb = edb.get_timeseries_db() | ||
for i, entry in enumerate(edb.get_timeseries_db().find( | ||
{"metadata.key": "config/sensor_config", | ||
check_field: {"$exists": True}})): | ||
entry["metadata"]["key"] = new_key | ||
if i % 10000 == 0: | ||
print udb.insert(entry) | ||
print tdb.remove(entry["_id"]) | ||
else: | ||
udb.insert(entry) | ||
tdb.remove(entry["_id"]) | ||
|
||
fix_key("data.battery_status", "background/battery") | ||
fix_key("data.latitude", "background/location") | ||
fix_key("data.zzaEh", "background/motion_activity") | ||
fix_key("data.currState", "statemachine/transition") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ xmltodict | |
python-crontab | ||
attrdict | ||
enum34 | ||
arrow |