{"action":"created","issue":{"url":"https://api.github.com/repos/numenta/numenta-apps/issues/431","labels_url":"https://api.github.com/repos/numenta/numenta-apps/issues/431/labels{/name}","comments_url":"https://api.github.com/repos/numenta/numenta-apps/issues/431/comments","events_url":"https://api.github.com/repos/numenta/numenta-apps/issues/431/events","html_url":"https://github.com/numenta/numenta-apps/pull/431","id":112670079,"number":431,"title":"ENG-40 Parse replacement parameters using newer argparse, as opposed …","user":{"login":"oxtopus","id":326528,"avatar_url":"https://avatars.githubusercontent.com/u/326528?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtopus","html_url":"https://github.com/oxtopus","followers_url":"https://api.github.com/users/oxtopus/followers","following_url":"https://api.github.com/users/oxtopus/following{/other_user}","gists_url":"https://api.github.com/users/oxtopus/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtopus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtopus/subscriptions","organizations_url":"https://api.github.com/users/oxtopus/orgs","repos_url":"https://api.github.com/users/oxtopus/repos","events_url":"https://api.github.com/users/oxtopus/events{/privacy}","received_events_url":"https://api.github.com/users/oxtopus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-21T20:14:14Z","updated_at":"2015-10-22T18:13:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numenta/numenta-apps/pulls/431","html_url":"https://github.com/numenta/numenta-apps/pull/431","diff_url":"https://github.com/numenta/numenta-apps/pull/431.diff","patch_url":"https://github.com/numenta/numenta-apps/pull/431.patch"},"body":"…to deprecated optparse.  Apply replacements using newly added _recurseDictAndReplace() function\r\n\r\nThis adds a new optional `--replaceParam` command line argument to the unicorn model  runner.  For example, to encode timestamps as day of week rather than time of day, as well as enable verbose output in the encoder:\r\n\r\n```\r\npython unicorn_backend/model_runner.py \\\r\n  --model \"1\" \\\r\n  --stats '{\"max\": 10, \"min\": 0}'  \\\r\n  --replaceParam modelConfig/modelParams/sensorParams/verbosity 1 \\\r\n  --replaceParam modelConfig/modelParams/sensorParams/encoders/c0_dayOfWeek '{\"dayOfWeek\": [21, 1], \"type\": \"DateEncoder\", \"fieldname\": \"c0\", \"name\": \"c0\"}' \\\r\n  --replaceParam modelConfig/modelParams/sensorParams/encoders/c0_timeOfDay null\r\n```\r\n\r\nUsing the dummy data emitter with the params above yields the following output:\r\n\r\n```\r\nRecordSensor got data: {'_timestamp': datetime.datetime(2015, 8, 4, 0, 55, 11), '_sequenceId': 0, '_category': [None], 'c0': datetime.datetime(2015, 8, 4, 0, 55, 11), '_timestampRecordIdx': None, 'c1': 835.93679, '_reset': 0}\r\nsensor: day of week                                                                                                                                         | c1                                                                                                                                                                                                                                                                                                                                                                                                               |\r\nsensor: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n      0: array('c', '...........*********************...................................................................................................................') | array('c', '.........................................*........................*.............*.............*.....*..................**............................*.....................*..............................................*................*.............................*................*.................*...........*.*.*..............*.*............*..............*......................................') |\r\n     nz: (42) [ 11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28\r\n  29  30  31 188 213 227 241 247 266 267 296 318 365 382 412 429 447 459\r\n 461 463 478 480 493 508]\r\n  encIn: c0.day of week:1.00, c1:835.94\r\n[0, 0.0301029996658834]\r\n```"},"comment":{"url":"https://api.github.com/repos/numenta/numenta-apps/issues/comments/150310101","html_url":"https://github.com/numenta/numenta-apps/pull/431#issuecomment-150310101","issue_url":"https://api.github.com/repos/numenta/numenta-apps/issues/431","id":150310101,"user":{"login":"oxtopus","id":326528,"avatar_url":"https://avatars.githubusercontent.com/u/326528?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtopus","html_url":"https://github.com/oxtopus","followers_url":"https://api.github.com/users/oxtopus/followers","following_url":"https://api.github.com/users/oxtopus/following{/other_user}","gists_url":"https://api.github.com/users/oxtopus/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtopus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtopus/subscriptions","organizations_url":"https://api.github.com/users/oxtopus/orgs","repos_url":"https://api.github.com/users/oxtopus/repos","events_url":"https://api.github.com/users/oxtopus/events{/privacy}","received_events_url":"https://api.github.com/users/oxtopus/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T18:13:45Z","updated_at":"2015-10-22T18:13:45Z","body":"Ok, Fixed!  Integration tests pass now."}}