{"action":"created","comment":{"url":"https://api.github.com/repos/FEniCS/dolfinx/pulls/comments/202979377","pull_request_review_id":137776639,"id":202979377,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjk3OTM3Nw==","diff_hunk":"@@ -0,0 +1,43 @@\n+# -*- coding: utf-8 -*-\n+# Copyright (C) 2018 Chris N. Richardson, Garth N. Wells, Michal Habera\n+#\n+# This file is part of DOLFIN (https://www.fenicsproject.org)\n+#\n+# SPDX-License-Identifier:    LGPL-3.0-or-later\n+\n+import dolfin.cpp as cpp\n+from dolfin.function.functionspace import FunctionSpace\n+from dolfin.function.function import Function\n+\n+\n+class XDMFFile(cpp.io.XDMFFile):\n+\n+    def read_checkpoint(self, V: FunctionSpace, name: str, counter: int=-1):\n+        \"\"\"Reads in function from checkpointing format\n+\n+        Parameters\n+        ----------\n+        V\n+            Function space of saved function.\n+        name\n+            Name of function as saved into XDMF file.\n+        counter : optional\n+            Position of function in the file within functions of the same\n+            name. Counter is used to read function saved as time series.\n+            To get last saved function use counter=-1, or counter=-2 for\n+            one before last, etc.\n+\n+        Note\n+        ----\n+        Parameter `V: Function space` must be the same as saved function space\n+        except for ordering of mesh entities.\n+\n+        Returns\n+        -------\n+        dolfin.Function\n+        \"\"\"\n+        if not isinstance(V, FunctionSpace):","path":"python/dolfin/io/xdmffile.py","position":39,"original_position":39,"commit_id":"816daf4bb7b4388ff09b8276aa245c25bb2cab9a","original_commit_id":"816daf4bb7b4388ff09b8276aa245c25bb2cab9a","user":{"login":"michalhabera","id":2896171,"node_id":"MDQ6VXNlcjI4OTYxNzE=","avatar_url":"https://avatars2.githubusercontent.com/u/2896171?v=4","gravatar_id":"","url":"https://api.github.com/users/michalhabera","html_url":"https://github.com/michalhabera","followers_url":"https://api.github.com/users/michalhabera/followers","following_url":"https://api.github.com/users/michalhabera/following{/other_user}","gists_url":"https://api.github.com/users/michalhabera/gists{/gist_id}","starred_url":"https://api.github.com/users/michalhabera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalhabera/subscriptions","organizations_url":"https://api.github.com/users/michalhabera/orgs","repos_url":"https://api.github.com/users/michalhabera/repos","events_url":"https://api.github.com/users/michalhabera/events{/privacy}","received_events_url":"https://api.github.com/users/michalhabera/received_events","type":"User","site_admin":false},"body":"Is there a strong need for that once rule \"no `cpp.*` object being public\" is applied?\r\nI am afraid of mixing `cpp.*` (backend) with other objects. This will cause (and already caused in 2018.1) many confusion within users.","created_at":"2018-07-17T11:01:31Z","updated_at":"2018-07-17T11:01:31Z","html_url":"https://github.com/FEniCS/dolfinx/pull/122#discussion_r202979377","pull_request_url":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/FEniCS/dolfinx/pulls/comments/202979377"},"html":{"href":"https://github.com/FEniCS/dolfinx/pull/122#discussion_r202979377"},"pull_request":{"href":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122"}},"in_reply_to_id":202964201},"pull_request":{"url":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122","id":199763874,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NzYzODc0","html_url":"https://github.com/FEniCS/dolfinx/pull/122","diff_url":"https://github.com/FEniCS/dolfinx/pull/122.diff","patch_url":"https://github.com/FEniCS/dolfinx/pull/122.patch","issue_url":"https://api.github.com/repos/FEniCS/dolfinx/issues/122","number":122,"state":"open","locked":false,"title":"Add file modes to XDMFFile, put encoding to constructor","user":{"login":"michalhabera","id":2896171,"node_id":"MDQ6VXNlcjI4OTYxNzE=","avatar_url":"https://avatars2.githubusercontent.com/u/2896171?v=4","gravatar_id":"","url":"https://api.github.com/users/michalhabera","html_url":"https://github.com/michalhabera","followers_url":"https://api.github.com/users/michalhabera/followers","following_url":"https://api.github.com/users/michalhabera/following{/other_user}","gists_url":"https://api.github.com/users/michalhabera/gists{/gist_id}","starred_url":"https://api.github.com/users/michalhabera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalhabera/subscriptions","organizations_url":"https://api.github.com/users/michalhabera/orgs","repos_url":"https://api.github.com/users/michalhabera/repos","events_url":"https://api.github.com/users/michalhabera/events{/privacy}","received_events_url":"https://api.github.com/users/michalhabera/received_events","type":"User","site_admin":false},"body":"`XDMFFile`'s encoding should really be a state-depend variable bond to XDMFFile at its construction time.\r\nThis PR removes all XDMFFile's methods encoding argument.\r\n\r\nI can possibly make encoding non-const and allow lifetime changes.\r\n\r\nUPDATE:\r\n**HDF5Interface.cpp**:\r\n- File mode \"a\" now in C-style, i.e. when addressed file is not existing create a new empty one.\r\nReason: Unify file-modes for XDMFFile and HDF5File to C lang meaning.\r\n\r\n**XDMFFile.cpp**:\r\nGenerally, make XDMFFile more state-dependent.\r\n- Add file modes {`a`,`r`, `w`, `ab`, `wb`} to XDMFFile. With the meaning defined here https://en.cppreference.com/w/cpp/io/c/fopen . Second letter \"b\" maps to HDF5 encoding. Internal encoding variable not strictly needed, possibly remove.\r\n- Remove internal `_counter` variable. \r\nReason: This variable was a pain, it was incremented to keep unique numbers of multiple entities written to XDMF, but restored to 0 when new XMDFFile is constructed. Thus re-opening and appending file with meshfunction or VTK-style timeseries was buggy. In addition there was only one counter for all entities written to a file...\r\n-  Use `_hdf5_file` more. For `wb` and `ab` this pointer is set to opened/created HDF file at XDMFFile construction time - in contrast to doing this at write time. \r\nReason: Make XDMFFile more state dependent. No need to open HDF file and check existence and validity etc. in every write/read method. \r\n- Make new `_h5_id` internal variable. \r\nReason: Lifetime of XDMFFile is now more bound to HDF5File (if binary encoding specified).\r\n- XDMF XML file is also prepared to desired state (empty <Xdmf> and <Domain> nodes) or read at XDMFFile construction time. \r\nReason: Make XDMFFile more state dependent. Simplifies handling of XML file. No need to check validity of XML structure in every write/read method.\r\n- Make `add_points` append `<Domain>` node instead of `<Xdmf>` node. \r\nReason: Every other internal appending methods does this, Xdmf node is too high level.\r\n- Add check for same function name in parallel to `write` with time\r\nReason: Since internal counter was removed this is essential for correct HDF path. Unfortunately, some methods accept name as string and some take `Variable::name`. This should be unified.","created_at":"2018-07-06T14:29:06Z","updated_at":"2018-07-17T11:01:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"348b743104d7a5800460f944b9f8465c812b54ab","assignee":null,"assignees":[],"requested_reviewers":[{"login":"chrisrichardson","id":4329467,"node_id":"MDQ6VXNlcjQzMjk0Njc=","avatar_url":"https://avatars1.githubusercontent.com/u/4329467?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisrichardson","html_url":"https://github.com/chrisrichardson","followers_url":"https://api.github.com/users/chrisrichardson/followers","following_url":"https://api.github.com/users/chrisrichardson/following{/other_user}","gists_url":"https://api.github.com/users/chrisrichardson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisrichardson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisrichardson/subscriptions","organizations_url":"https://api.github.com/users/chrisrichardson/orgs","repos_url":"https://api.github.com/users/chrisrichardson/repos","events_url":"https://api.github.com/users/chrisrichardson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisrichardson/received_events","type":"User","site_admin":false},{"login":"blechta","id":7361643,"node_id":"MDQ6VXNlcjczNjE2NDM=","avatar_url":"https://avatars3.githubusercontent.com/u/7361643?v=4","gravatar_id":"","url":"https://api.github.com/users/blechta","html_url":"https://github.com/blechta","followers_url":"https://api.github.com/users/blechta/followers","following_url":"https://api.github.com/users/blechta/following{/other_user}","gists_url":"https://api.github.com/users/blechta/gists{/gist_id}","starred_url":"https://api.github.com/users/blechta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blechta/subscriptions","organizations_url":"https://api.github.com/users/blechta/orgs","repos_url":"https://api.github.com/users/blechta/repos","events_url":"https://api.github.com/users/blechta/events{/privacy}","received_events_url":"https://api.github.com/users/blechta/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122/commits","review_comments_url":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122/comments","review_comment_url":"https://api.github.com/repos/FEniCS/dolfinx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FEniCS/dolfinx/issues/122/comments","statuses_url":"https://api.github.com/repos/FEniCS/dolfinx/statuses/816daf4bb7b4388ff09b8276aa245c25bb2cab9a","head":{"label":"FEniCS:michal/clean-io","ref":"michal/clean-io","sha":"816daf4bb7b4388ff09b8276aa245c25bb2cab9a","user":{"login":"FEniCS","id":3868708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Njg3MDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3868708?v=4","gravatar_id":"","url":"https://api.github.com/users/FEniCS","html_url":"https://github.com/FEniCS","followers_url":"https://api.github.com/users/FEniCS/followers","following_url":"https://api.github.com/users/FEniCS/following{/other_user}","gists_url":"https://api.github.com/users/FEniCS/gists{/gist_id}","starred_url":"https://api.github.com/users/FEniCS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FEniCS/subscriptions","organizations_url":"https://api.github.com/users/FEniCS/orgs","repos_url":"https://api.github.com/users/FEniCS/repos","events_url":"https://api.github.com/users/FEniCS/events{/privacy}","received_events_url":"https://api.github.com/users/FEniCS/received_events","type":"Organization","site_admin":false},"repo":{"id":128214585,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgyMTQ1ODU=","name":"dolfinx","full_name":"FEniCS/dolfinx","owner":{"login":"FEniCS","id":3868708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Njg3MDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3868708?v=4","gravatar_id":"","url":"https://api.github.com/users/FEniCS","html_url":"https://github.com/FEniCS","followers_url":"https://api.github.com/users/FEniCS/followers","following_url":"https://api.github.com/users/FEniCS/following{/other_user}","gists_url":"https://api.github.com/users/FEniCS/gists{/gist_id}","starred_url":"https://api.github.com/users/FEniCS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FEniCS/subscriptions","organizations_url":"https://api.github.com/users/FEniCS/orgs","repos_url":"https://api.github.com/users/FEniCS/repos","events_url":"https://api.github.com/users/FEniCS/events{/privacy}","received_events_url":"https://api.github.com/users/FEniCS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FEniCS/dolfinx","description":"Next generation FEniCS problem solving environment","fork":false,"url":"https://api.github.com/repos/FEniCS/dolfinx","forks_url":"https://api.github.com/repos/FEniCS/dolfinx/forks","keys_url":"https://api.github.com/repos/FEniCS/dolfinx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FEniCS/dolfinx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FEniCS/dolfinx/teams","hooks_url":"https://api.github.com/repos/FEniCS/dolfinx/hooks","issue_events_url":"https://api.github.com/repos/FEniCS/dolfinx/issues/events{/number}","events_url":"https://api.github.com/repos/FEniCS/dolfinx/events","assignees_url":"https://api.github.com/repos/FEniCS/dolfinx/assignees{/user}","branches_url":"https://api.github.com/repos/FEniCS/dolfinx/branches{/branch}","tags_url":"https://api.github.com/repos/FEniCS/dolfinx/tags","blobs_url":"https://api.github.com/repos/FEniCS/dolfinx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FEniCS/dolfinx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FEniCS/dolfinx/git/refs{/sha}","trees_url":"https://api.github.com/repos/FEniCS/dolfinx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FEniCS/dolfinx/statuses/{sha}","languages_url":"https://api.github.com/repos/FEniCS/dolfinx/languages","stargazers_url":"https://api.github.com/repos/FEniCS/dolfinx/stargazers","contributors_url":"https://api.github.com/repos/FEniCS/dolfinx/contributors","subscribers_url":"https://api.github.com/repos/FEniCS/dolfinx/subscribers","subscription_url":"https://api.github.com/repos/FEniCS/dolfinx/subscription","commits_url":"https://api.github.com/repos/FEniCS/dolfinx/commits{/sha}","git_commits_url":"https://api.github.com/repos/FEniCS/dolfinx/git/commits{/sha}","comments_url":"https://api.github.com/repos/FEniCS/dolfinx/comments{/number}","issue_comment_url":"https://api.github.com/repos/FEniCS/dolfinx/issues/comments{/number}","contents_url":"https://api.github.com/repos/FEniCS/dolfinx/contents/{+path}","compare_url":"https://api.github.com/repos/FEniCS/dolfinx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FEniCS/dolfinx/merges","archive_url":"https://api.github.com/repos/FEniCS/dolfinx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FEniCS/dolfinx/downloads","issues_url":"https://api.github.com/repos/FEniCS/dolfinx/issues{/number}","pulls_url":"https://api.github.com/repos/FEniCS/dolfinx/pulls{/number}","milestones_url":"https://api.github.com/repos/FEniCS/dolfinx/milestones{/number}","notifications_url":"https://api.github.com/repos/FEniCS/dolfinx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FEniCS/dolfinx/labels{/name}","releases_url":"https://api.github.com/repos/FEniCS/dolfinx/releases{/id}","deployments_url":"https://api.github.com/repos/FEniCS/dolfinx/deployments","created_at":"2018-04-05T14:02:41Z","updated_at":"2018-07-13T08:47:48Z","pushed_at":"2018-07-17T09:05:22Z","git_url":"git://github.com/FEniCS/dolfinx.git","ssh_url":"git@github.com:FEniCS/dolfinx.git","clone_url":"https://github.com/FEniCS/dolfinx.git","svn_url":"https://github.com/FEniCS/dolfinx","homepage":"","size":49997,"stargazers_count":12,"watchers_count":12,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":49,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":4,"open_issues":49,"watchers":12,"default_branch":"master"}},"base":{"label":"FEniCS:master","ref":"master","sha":"896e36c46ac12d91b696d8f336dbddb17fc84b29","user":{"login":"FEniCS","id":3868708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Njg3MDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3868708?v=4","gravatar_id":"","url":"https://api.github.com/users/FEniCS","html_url":"https://github.com/FEniCS","followers_url":"https://api.github.com/users/FEniCS/followers","following_url":"https://api.github.com/users/FEniCS/following{/other_user}","gists_url":"https://api.github.com/users/FEniCS/gists{/gist_id}","starred_url":"https://api.github.com/users/FEniCS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FEniCS/subscriptions","organizations_url":"https://api.github.com/users/FEniCS/orgs","repos_url":"https://api.github.com/users/FEniCS/repos","events_url":"https://api.github.com/users/FEniCS/events{/privacy}","received_events_url":"https://api.github.com/users/FEniCS/received_events","type":"Organization","site_admin":false},"repo":{"id":128214585,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgyMTQ1ODU=","name":"dolfinx","full_name":"FEniCS/dolfinx","owner":{"login":"FEniCS","id":3868708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Njg3MDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3868708?v=4","gravatar_id":"","url":"https://api.github.com/users/FEniCS","html_url":"https://github.com/FEniCS","followers_url":"https://api.github.com/users/FEniCS/followers","following_url":"https://api.github.com/users/FEniCS/following{/other_user}","gists_url":"https://api.github.com/users/FEniCS/gists{/gist_id}","starred_url":"https://api.github.com/users/FEniCS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FEniCS/subscriptions","organizations_url":"https://api.github.com/users/FEniCS/orgs","repos_url":"https://api.github.com/users/FEniCS/repos","events_url":"https://api.github.com/users/FEniCS/events{/privacy}","received_events_url":"https://api.github.com/users/FEniCS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FEniCS/dolfinx","description":"Next generation FEniCS problem solving environment","fork":false,"url":"https://api.github.com/repos/FEniCS/dolfinx","forks_url":"https://api.github.com/repos/FEniCS/dolfinx/forks","keys_url":"https://api.github.com/repos/FEniCS/dolfinx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FEniCS/dolfinx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FEniCS/dolfinx/teams","hooks_url":"https://api.github.com/repos/FEniCS/dolfinx/hooks","issue_events_url":"https://api.github.com/repos/FEniCS/dolfinx/issues/events{/number}","events_url":"https://api.github.com/repos/FEniCS/dolfinx/events","assignees_url":"https://api.github.com/repos/FEniCS/dolfinx/assignees{/user}","branches_url":"https://api.github.com/repos/FEniCS/dolfinx/branches{/branch}","tags_url":"https://api.github.com/repos/FEniCS/dolfinx/tags","blobs_url":"https://api.github.com/repos/FEniCS/dolfinx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FEniCS/dolfinx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FEniCS/dolfinx/git/refs{/sha}","trees_url":"https://api.github.com/repos/FEniCS/dolfinx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FEniCS/dolfinx/statuses/{sha}","languages_url":"https://api.github.com/repos/FEniCS/dolfinx/languages","stargazers_url":"https://api.github.com/repos/FEniCS/dolfinx/stargazers","contributors_url":"https://api.github.com/repos/FEniCS/dolfinx/contributors","subscribers_url":"https://api.github.com/repos/FEniCS/dolfinx/subscribers","subscription_url":"https://api.github.com/repos/FEniCS/dolfinx/subscription","commits_url":"https://api.github.com/repos/FEniCS/dolfinx/commits{/sha}","git_commits_url":"https://api.github.com/repos/FEniCS/dolfinx/git/commits{/sha}","comments_url":"https://api.github.com/repos/FEniCS/dolfinx/comments{/number}","issue_comment_url":"https://api.github.com/repos/FEniCS/dolfinx/issues/comments{/number}","contents_url":"https://api.github.com/repos/FEniCS/dolfinx/contents/{+path}","compare_url":"https://api.github.com/repos/FEniCS/dolfinx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FEniCS/dolfinx/merges","archive_url":"https://api.github.com/repos/FEniCS/dolfinx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FEniCS/dolfinx/downloads","issues_url":"https://api.github.com/repos/FEniCS/dolfinx/issues{/number}","pulls_url":"https://api.github.com/repos/FEniCS/dolfinx/pulls{/number}","milestones_url":"https://api.github.com/repos/FEniCS/dolfinx/milestones{/number}","notifications_url":"https://api.github.com/repos/FEniCS/dolfinx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FEniCS/dolfinx/labels{/name}","releases_url":"https://api.github.com/repos/FEniCS/dolfinx/releases{/id}","deployments_url":"https://api.github.com/repos/FEniCS/dolfinx/deployments","created_at":"2018-04-05T14:02:41Z","updated_at":"2018-07-13T08:47:48Z","pushed_at":"2018-07-17T09:05:22Z","git_url":"git://github.com/FEniCS/dolfinx.git","ssh_url":"git@github.com:FEniCS/dolfinx.git","clone_url":"https://github.com/FEniCS/dolfinx.git","svn_url":"https://github.com/FEniCS/dolfinx","homepage":"","size":49997,"stargazers_count":12,"watchers_count":12,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":49,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":4,"open_issues":49,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122"},"html":{"href":"https://github.com/FEniCS/dolfinx/pull/122"},"issue":{"href":"https://api.github.com/repos/FEniCS/dolfinx/issues/122"},"comments":{"href":"https://api.github.com/repos/FEniCS/dolfinx/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/FEniCS/dolfinx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FEniCS/dolfinx/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/FEniCS/dolfinx/statuses/816daf4bb7b4388ff09b8276aa245c25bb2cab9a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"michalhabera"}}