{"action":"created","issue":{"url":"https://api.github.com/repos/PMEAL/OpenPNM/issues/631","repository_url":"https://api.github.com/repos/PMEAL/OpenPNM","labels_url":"https://api.github.com/repos/PMEAL/OpenPNM/issues/631/labels{/name}","comments_url":"https://api.github.com/repos/PMEAL/OpenPNM/issues/631/comments","events_url":"https://api.github.com/repos/PMEAL/OpenPNM/issues/631/events","html_url":"https://github.com/PMEAL/OpenPNM/issues/631","id":172813391,"number":631,"title":"Bug in OpenPNM.Network.tools.extend() - closely linked to #630","user":{"login":"MichaelHoeh","id":8254680,"avatar_url":"https://avatars.githubusercontent.com/u/8254680?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelHoeh","html_url":"https://github.com/MichaelHoeh","followers_url":"https://api.github.com/users/MichaelHoeh/followers","following_url":"https://api.github.com/users/MichaelHoeh/following{/other_user}","gists_url":"https://api.github.com/users/MichaelHoeh/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelHoeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelHoeh/subscriptions","organizations_url":"https://api.github.com/users/MichaelHoeh/orgs","repos_url":"https://api.github.com/users/MichaelHoeh/repos","events_url":"https://api.github.com/users/MichaelHoeh/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelHoeh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PMEAL/OpenPNM/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-23T21:36:34Z","updated_at":"2016-08-31T15:41:03Z","closed_at":"2016-08-31T15:41:03Z","body":"\r\n\r\n\r\nWhen a network is extended by new pores/throats, the arrays holding the properties of the original network should be extended in a meaningful manner, be it NaNs or 0 (cf. discussion in #630, as this bug is closely linked to that). \r\n\r\nIf we do this in the way as it should be done, so extending the network first, and then defining a geometry on a subset of the network, the entries in the array not belonging to the subset hold very small values.\r\n\r\n```\r\npn = op.Network.Cubic(shape=[5,5,5],spacing=1,name='net')\r\npn.add_boundaries()\r\nPs = pn.pores('boundary',mode='not')\r\nTs = pn.find_neighbor_throats(pores=Ps,mode='intersection',flatten=True)\r\ngeom = op.Geometry.GenericGeometry(network=pn,pores=Ps,throats=Ts)\r\ngeom['pore.diameter'] = 1.\r\n\r\npn['pore.diameter'] = \r\narray([  1.00000000e+000,   1.00000000e+000,   1.00000000e+000,\r\n         1.00000000e+000,   1.00000000e+000,   1.00000000e+000,\r\n         1.00000000e+000,   1.00000000e+000,   1.00000000e+000,\r\n       \r\n         2.96439388e-323,   3.45845952e-323,   3.95252517e-323,\r\n         4.44659081e-323,   4.94065646e-323,   5.43472210e-323,\r\n         5.92878775e-323,   6.42285340e-323,   6.91691904e-323,\r\n         7.41098469e-323,   7.90505033e-323])\r\n```\r\n\r\nIf it is done the other way around, so defining a network, then a geometry, and then adding boundaries, something else happens. In fact the values that appear on the array for the 'pore.diameter' are the 'pore.coords' values in this special case, which should not be. Either these entries should be filled by NaNs or by 0 or by -inf or something like that. \r\n\r\n\r\n```\r\npn = op.Network.Cubic(shape=[5,5,5],spacing=1,name='net')\r\nPs = pn.pores()\r\nTs = pn.find_neighbor_throats(pores=Ps,mode='intersection',flatten=True)\r\ngeom = op.Geometry.GenericGeometry(network=pn,pores=Ps,throats=Ts)\r\ngeom['pore.diameter'] = 1.\r\npn.add_boundaries()\r\n\r\npn['pore.diameter'] = \r\narray([  1.00000000e+000,   1.00000000e+000,   1.00000000e+000,\r\n         1.00000000e+000,   1.00000000e+000,   1.00000000e+000,\r\n         1.00000000e+000,   1.00000000e+000,   1.00000000e+000,\r\n        \r\n         3.50000000e+000,   4.50000000e+000,   3.64126381e-321,\r\n         6.92859600e-310,   6.92859600e-310,   1.50000000e+000,\r\n         5.00000000e-001,   4.50000000e+000,   1.50000000e+000,\r\n         1.50000000e+000,   4.50000000e+000,   1.50000000e+000,\r\n         2.50000000e+000,   4.50000000e+000,   1.50000000e+000,\r\n         3.50000000e+000,   4.50000000e+000,   1.50000000e+000,\r\n         4.50000000e+000,   4.50000000e+000])\r\n```\r\n\r\nThis behaviour can be confusing, and should therefore be eliminated. I guess this is due to a misbehaving OpenPNM.Network.tools.extend()."},"comment":{"url":"https://api.github.com/repos/PMEAL/OpenPNM/issues/comments/243805841","html_url":"https://github.com/PMEAL/OpenPNM/issues/631#issuecomment-243805841","issue_url":"https://api.github.com/repos/PMEAL/OpenPNM/issues/631","id":243805841,"user":{"login":"jgostick","id":5092049,"avatar_url":"https://avatars.githubusercontent.com/u/5092049?v=3","gravatar_id":"","url":"https://api.github.com/users/jgostick","html_url":"https://github.com/jgostick","followers_url":"https://api.github.com/users/jgostick/followers","following_url":"https://api.github.com/users/jgostick/following{/other_user}","gists_url":"https://api.github.com/users/jgostick/gists{/gist_id}","starred_url":"https://api.github.com/users/jgostick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgostick/subscriptions","organizations_url":"https://api.github.com/users/jgostick/orgs","repos_url":"https://api.github.com/users/jgostick/repos","events_url":"https://api.github.com/users/jgostick/events{/privacy}","received_events_url":"https://api.github.com/users/jgostick/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T15:41:03Z","updated_at":"2016-08-31T15:41:03Z","body":"This is captured in #638 "}}
{"actor":{"display_login":"jgostick"}}