{"action":"created","issue":{"url":"https://api.github.com/repos/kinverarity1/lasio/issues/107","labels_url":"https://api.github.com/repos/kinverarity1/lasio/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/kinverarity1/lasio/issues/107/comments","events_url":"https://api.github.com/repos/kinverarity1/lasio/issues/107/events","html_url":"https://github.com/kinverarity1/lasio/issues/107","id":114824384,"number":107,"title":"LASFile object should be serializable with json.dumps()","user":{"login":"knbknb","id":603200,"avatar_url":"https://avatars.githubusercontent.com/u/603200?v=3","gravatar_id":"","url":"https://api.github.com/users/knbknb","html_url":"https://github.com/knbknb","followers_url":"https://api.github.com/users/knbknb/followers","following_url":"https://api.github.com/users/knbknb/following{/other_user}","gists_url":"https://api.github.com/users/knbknb/gists{/gist_id}","starred_url":"https://api.github.com/users/knbknb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knbknb/subscriptions","organizations_url":"https://api.github.com/users/knbknb/orgs","repos_url":"https://api.github.com/users/knbknb/repos","events_url":"https://api.github.com/users/knbknb/events{/privacy}","received_events_url":"https://api.github.com/users/knbknb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kinverarity1/lasio/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"kinverarity1","id":4525931,"avatar_url":"https://avatars.githubusercontent.com/u/4525931?v=3","gravatar_id":"","url":"https://api.github.com/users/kinverarity1","html_url":"https://github.com/kinverarity1","followers_url":"https://api.github.com/users/kinverarity1/followers","following_url":"https://api.github.com/users/kinverarity1/following{/other_user}","gists_url":"https://api.github.com/users/kinverarity1/gists{/gist_id}","starred_url":"https://api.github.com/users/kinverarity1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinverarity1/subscriptions","organizations_url":"https://api.github.com/users/kinverarity1/orgs","repos_url":"https://api.github.com/users/kinverarity1/repos","events_url":"https://api.github.com/users/kinverarity1/events{/privacy}","received_events_url":"https://api.github.com/users/kinverarity1/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-11-03T14:06:54Z","updated_at":"2015-12-02T11:41:24Z","closed_at":null,"body":"I'd like to dump the lasfile into Redis (a popular nosql database), or save it to disk in the platform-independent JSON Format. \r\nAt this time, this is not possible. \r\n<pre>\r\nimport redis\r\nimport json\r\nr = redis.StrictRedis(host='localhost', port=6379, db=0)\r\n#json_images = json.dumps(lasobj) # DOES NOT WORK\r\njson_images = json.dumps(lasobj, default=lambda x: None)\r\nr.set('lasobj', json_images)\r\n    TypeError: array([ 134.5946,  134.62  ,  134.6454, ...,  745.6424,  745.6678,\r\n        745.6932]) is not JSON serializable\r\n</pre>\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kinverarity1/lasio/issues/comments/161268753","html_url":"https://github.com/kinverarity1/lasio/issues/107#issuecomment-161268753","issue_url":"https://api.github.com/repos/kinverarity1/lasio/issues/107","id":161268753,"user":{"login":"kinverarity1","id":4525931,"avatar_url":"https://avatars.githubusercontent.com/u/4525931?v=3","gravatar_id":"","url":"https://api.github.com/users/kinverarity1","html_url":"https://github.com/kinverarity1","followers_url":"https://api.github.com/users/kinverarity1/followers","following_url":"https://api.github.com/users/kinverarity1/following{/other_user}","gists_url":"https://api.github.com/users/kinverarity1/gists{/gist_id}","starred_url":"https://api.github.com/users/kinverarity1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinverarity1/subscriptions","organizations_url":"https://api.github.com/users/kinverarity1/orgs","repos_url":"https://api.github.com/users/kinverarity1/repos","events_url":"https://api.github.com/users/kinverarity1/events{/privacy}","received_events_url":"https://api.github.com/users/kinverarity1/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T11:41:24Z","updated_at":"2015-12-02T11:41:24Z","body":"#111 provides a partial fix:\r\n\r\n```python\r\njson_images = json.dumps(lasobj, cls=lasio.JSONEncoder)\r\n```\r\n\r\nwill work (a unit test for it has been added).\r\n\r\nHowever the JSON representation only contains the data, not the header information.\r\n\r\nI think a better solution would be to provide a ``LASFile.json`` attribute which covers all the information in the file. I'll leave this issue open for now."}}