{"action":"created","issue":{"url":"https://api.github.com/repos/NREL/OpenStudio/issues/2291","repository_url":"https://api.github.com/repos/NREL/OpenStudio","labels_url":"https://api.github.com/repos/NREL/OpenStudio/issues/2291/labels{/name}","comments_url":"https://api.github.com/repos/NREL/OpenStudio/issues/2291/comments","events_url":"https://api.github.com/repos/NREL/OpenStudio/issues/2291/events","html_url":"https://github.com/NREL/OpenStudio/issues/2291","id":163532853,"number":2291,"title":"No Exception Opened for siteGroundTemperatureBuildingSurface .get()","user":{"login":"chriswmackey","id":5567574,"avatar_url":"https://avatars.githubusercontent.com/u/5567574?v=3","gravatar_id":"","url":"https://api.github.com/users/chriswmackey","html_url":"https://github.com/chriswmackey","followers_url":"https://api.github.com/users/chriswmackey/followers","following_url":"https://api.github.com/users/chriswmackey/following{/other_user}","gists_url":"https://api.github.com/users/chriswmackey/gists{/gist_id}","starred_url":"https://api.github.com/users/chriswmackey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriswmackey/subscriptions","organizations_url":"https://api.github.com/users/chriswmackey/orgs","repos_url":"https://api.github.com/users/chriswmackey/repos","events_url":"https://api.github.com/users/chriswmackey/events{/privacy}","received_events_url":"https://api.github.com/users/chriswmackey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"macumber","id":1327850,"avatar_url":"https://avatars.githubusercontent.com/u/1327850?v=3","gravatar_id":"","url":"https://api.github.com/users/macumber","html_url":"https://github.com/macumber","followers_url":"https://api.github.com/users/macumber/followers","following_url":"https://api.github.com/users/macumber/following{/other_user}","gists_url":"https://api.github.com/users/macumber/gists{/gist_id}","starred_url":"https://api.github.com/users/macumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macumber/subscriptions","organizations_url":"https://api.github.com/users/macumber/orgs","repos_url":"https://api.github.com/users/macumber/repos","events_url":"https://api.github.com/users/macumber/events{/privacy}","received_events_url":"https://api.github.com/users/macumber/received_events","type":"User","site_admin":false},"assignees":[{"login":"macumber","id":1327850,"avatar_url":"https://avatars.githubusercontent.com/u/1327850?v=3","gravatar_id":"","url":"https://api.github.com/users/macumber","html_url":"https://github.com/macumber","followers_url":"https://api.github.com/users/macumber/followers","following_url":"https://api.github.com/users/macumber/following{/other_user}","gists_url":"https://api.github.com/users/macumber/gists{/gist_id}","starred_url":"https://api.github.com/users/macumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macumber/subscriptions","organizations_url":"https://api.github.com/users/macumber/orgs","repos_url":"https://api.github.com/users/macumber/repos","events_url":"https://api.github.com/users/macumber/events{/privacy}","received_events_url":"https://api.github.com/users/macumber/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-07-02T19:38:02Z","updated_at":"2016-07-05T15:19:43Z","closed_at":null,"body":"Hello beloved OpenStudio team,\r\n\r\nI have noticed this bug a couple of times where I try to use the .get() method to get a certain object in my model and my whole program running the script crashes, seemingly because there is no exception opened for the operation.  The most recent issue that I have is with getting the monthly ground temperatures object.\r\n\r\nTrying to run this python code, I get my whole program crashing:\r\n\r\nimport OpenStudio\r\nmodel = OpenStudio .Model()\r\nsite = OpenStudio .Model.getSite(model)\r\ngrndTemps = site.siteGroundTemperatureBuildingSurface().get()\r\n\r\nI dug through the error log a while ago and found that the error was because of something in OpenStudio and not the program running the script.  Let me know if you would like me to dig through the error log again to find the specific error message.\r\n\r\nAlternatively, if there is some way of getting the ground temperature object without having to use the .get() method, I would be very interested in knowing it.\r\n\r\nThank you all for this wonderful software,\r\n-Chris\r\n\r\ncc: @mostaphaRoudsari"},"comment":{"url":"https://api.github.com/repos/NREL/OpenStudio/issues/comments/230510052","html_url":"https://github.com/NREL/OpenStudio/issues/2291#issuecomment-230510052","issue_url":"https://api.github.com/repos/NREL/OpenStudio/issues/2291","id":230510052,"user":{"login":"macumber","id":1327850,"avatar_url":"https://avatars.githubusercontent.com/u/1327850?v=3","gravatar_id":"","url":"https://api.github.com/users/macumber","html_url":"https://github.com/macumber","followers_url":"https://api.github.com/users/macumber/followers","following_url":"https://api.github.com/users/macumber/following{/other_user}","gists_url":"https://api.github.com/users/macumber/gists{/gist_id}","starred_url":"https://api.github.com/users/macumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macumber/subscriptions","organizations_url":"https://api.github.com/users/macumber/orgs","repos_url":"https://api.github.com/users/macumber/repos","events_url":"https://api.github.com/users/macumber/events{/privacy}","received_events_url":"https://api.github.com/users/macumber/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T15:19:43Z","updated_at":"2016-07-05T15:19:43Z","body":"You should read the section **OpenStudio Measures and the boost::optional Type** in the [Measure Writing Guide](http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/#measure-writing).  Basically, Model.getSite returns an OptionalGroundTemperatureBuildingSurface and you need to check it using `.empty?` or `.is_initialized` before calling get.\r\n\r\nThat being said, I don't know why [this line](https://github.com/NREL/OpenStudio/blob/develop/openstudiocore/src/utilities/core/CommonImport.i#L116) is not working to cause an exception to be thrown instead of a seg fault crash when deferencing an unset optional.  "}}
{"actor":{"display_login":"macumber"}}