{"action":"closed","issue":{"url":"https://api.github.com/repos/jrsmith3/tec/issues/72","labels_url":"https://api.github.com/repos/jrsmith3/tec/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/jrsmith3/tec/issues/72/comments","events_url":"https://api.github.com/repos/jrsmith3/tec/issues/72/events","html_url":"https://github.com/jrsmith3/tec/issues/72","id":54405314,"number":72,"title":"`tec.TECBase.calc_electron_cooling_rate` raises AttributeError","user":{"login":"jrsmith3","id":204215,"avatar_url":"https://avatars.githubusercontent.com/u/204215?v=3","gravatar_id":"","url":"https://api.github.com/users/jrsmith3","html_url":"https://github.com/jrsmith3","followers_url":"https://api.github.com/users/jrsmith3/followers","following_url":"https://api.github.com/users/jrsmith3/following{/other_user}","gists_url":"https://api.github.com/users/jrsmith3/gists{/gist_id}","starred_url":"https://api.github.com/users/jrsmith3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrsmith3/subscriptions","organizations_url":"https://api.github.com/users/jrsmith3/orgs","repos_url":"https://api.github.com/users/jrsmith3/repos","events_url":"https://api.github.com/users/jrsmith3/events{/privacy}","received_events_url":"https://api.github.com/users/jrsmith3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jrsmith3/tec/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-15T02:29:47Z","updated_at":"2015-01-15T22:27:08Z","closed_at":"2015-01-15T22:27:08Z","body":"Upon successful instantiation of a `tec.TECBase` object, the `tec.TECBase.calc_electron_cooling_rate` unexpectedly raises an `AttributeError`. This exception was first noted in commit 32b9ec31bc545a7f4e44d8de139e01895c0bf6cd.\r\n\r\n\r\nExample code\r\n============\r\n```python\r\nfrom tec.electrode import Metal\r\nfrom tec import TECBase\r\n\r\nem = Metal(temp=1000., barrier=2., richardson=10.)\r\nco = Metal(temp=300., barrier=1., richardson=10., position=10.)\r\nt = TECBase(em, co)\r\nt.calc_electron_cooling_rate()\r\n```\r\n\r\n\r\nTraceback\r\n=========\r\n```\r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\n<ipython-input-1-d3ee802e9141> in <module>()\r\n      5 co = Metal(temp=300., barrier=1., richardson=10., position=10.)\r\n      6 t = TECBase(em, co)\r\n----> 7 t.calc_electron_cooling_rate()\r\n\r\n/Users/jrsmith3/Documents/work/tec/tec/base.pyc in calc_electron_cooling_rate(self)\r\n    272         unit_area = units.Quantity(1., \"cm2\")\r\n    273 \r\n--> 274         forward = unit_area * self.calc_forward_current_density() * (self.calc_max_motive_height + kT_E2) / constants.e.si\r\n    275         back = unit_area * self.calc_back_current_density * (self.calc_max_motive_height + kT_C2) / constants.e.si\r\n    276 \r\n\r\nAttributeError: 'TECBase' object has no attribute 'calc_max_motive_height'\r\n```\r\n\r\nEnvironment\r\n===========\r\nSee issue #66.\r\n\r\n\r\nAdditional information\r\n======================\r\nI first experienced this bug after writing some tests in commit 32b9ec31bc545a7f4e44d8de139e01895c0bf6cd; the specific test was `test/test_TECBase.py:CalculatorsReturnType.test_calc_electron_cooling_rate`.\r\n\r\nSince `tec.TECBase.calc_heat_supply_rate` depends on `tec.TECBase.calc_electron_cooling_rate`, the test for it (namely `test/test_TECBase.py:CalculatorsReturnType.test_calc_heat_supply_rate`) exited with an error as well. Fixing this bug should make both tests green.\r\n\r\nThe offending code was introduced in a39cd815.\r\n\r\n\r\nSolution\r\n========\r\nI think replacing instances of `self.calc_max_motive_height` with `self.calc_max_motive()` should fix this issue.\r\n"}}