{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6514","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6514/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6514/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6514/events","html_url":"https://github.com/numpy/numpy/pull/6514","id":112166764,"number":6514,"title":"Nested .npz files","user":{"login":"rherault-insa","id":15195333,"avatar_url":"https://avatars.githubusercontent.com/u/15195333?v=3","gravatar_id":"","url":"https://api.github.com/users/rherault-insa","html_url":"https://github.com/rherault-insa","followers_url":"https://api.github.com/users/rherault-insa/followers","following_url":"https://api.github.com/users/rherault-insa/following{/other_user}","gists_url":"https://api.github.com/users/rherault-insa/gists{/gist_id}","starred_url":"https://api.github.com/users/rherault-insa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rherault-insa/subscriptions","organizations_url":"https://api.github.com/users/rherault-insa/orgs","repos_url":"https://api.github.com/users/rherault-insa/repos","events_url":"https://api.github.com/users/rherault-insa/events{/privacy}","received_events_url":"https://api.github.com/users/rherault-insa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.lib","name":"component: numpy.lib","color":"ff0000"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Enhancement","name":"Enhancement","color":"e102d8"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Proposal","name":"Proposal","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-19T15:15:45Z","updated_at":"2015-10-21T17:22:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/6514","html_url":"https://github.com/numpy/numpy/pull/6514","diff_url":"https://github.com/numpy/numpy/pull/6514.diff","patch_url":"https://github.com/numpy/numpy/pull/6514.patch"},"body":"# In Short\r\n\r\nThis is a demo code for having nested NPZ files.\r\n\r\n# What ?\r\n\r\nWhen a dict variable with only str keys is given to np.savez,  it is not converted to array of dtype=object nor pickled but rather used to create a child npz file that will be embedded in the parent npz file.\r\nOf course that can be recursive.\r\n\r\n# Why ?\r\n\r\n- Having structured data without the use of dtype object\r\n- If saving a tree structure made out of valid dicts with standard arrays as leaves, no need to use pickle (and so avoid python2/python3 unpickle problems)\r\n\r\n# Comments\r\n\r\nThe writing part  (modification of function \\_savez + new function \\_is\\_valid\\_dict ) is quite clean.\r\n\r\nThe reading part (modification of class NpzFile) can gain in quality, but that would mean deeper changes int the way \\_\\_getitem\\_\\_ handles field types and  in the way the class handles its parent zip file: currently we can't pass a byte stream to the NpzFile constructor but only a real file, that induces the use of temp files when having nested npz files."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/149968083","html_url":"https://github.com/numpy/numpy/pull/6514#issuecomment-149968083","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6514","id":149968083,"user":{"login":"rherault-insa","id":15195333,"avatar_url":"https://avatars.githubusercontent.com/u/15195333?v=3","gravatar_id":"","url":"https://api.github.com/users/rherault-insa","html_url":"https://github.com/rherault-insa","followers_url":"https://api.github.com/users/rherault-insa/followers","following_url":"https://api.github.com/users/rherault-insa/following{/other_user}","gists_url":"https://api.github.com/users/rherault-insa/gists{/gist_id}","starred_url":"https://api.github.com/users/rherault-insa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rherault-insa/subscriptions","organizations_url":"https://api.github.com/users/rherault-insa/orgs","repos_url":"https://api.github.com/users/rherault-insa/repos","events_url":"https://api.github.com/users/rherault-insa/events{/privacy}","received_events_url":"https://api.github.com/users/rherault-insa/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T17:22:05Z","updated_at":"2015-10-21T17:22:05Z","body":"This pull request is not compatible with pull request #6540.\r\nNevertheless this proposal will be easier/cleaner to implement after pull request #6540."}}