{"action":"created","issue":{"url":"https://api.github.com/repos/hgrecco/pint/issues/248","labels_url":"https://api.github.com/repos/hgrecco/pint/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/hgrecco/pint/issues/248/comments","events_url":"https://api.github.com/repos/hgrecco/pint/issues/248/events","html_url":"https://github.com/hgrecco/pint/issues/248","id":60187224,"number":248,"title":"Special case for operation with offset unit","user":{"login":"gdavis-github","id":5677224,"avatar_url":"https://avatars.githubusercontent.com/u/5677224?v=3","gravatar_id":"","url":"https://api.github.com/users/gdavis-github","html_url":"https://github.com/gdavis-github","followers_url":"https://api.github.com/users/gdavis-github/followers","following_url":"https://api.github.com/users/gdavis-github/following{/other_user}","gists_url":"https://api.github.com/users/gdavis-github/gists{/gist_id}","starred_url":"https://api.github.com/users/gdavis-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdavis-github/subscriptions","organizations_url":"https://api.github.com/users/gdavis-github/orgs","repos_url":"https://api.github.com/users/gdavis-github/repos","events_url":"https://api.github.com/users/gdavis-github/events{/privacy}","received_events_url":"https://api.github.com/users/gdavis-github/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-07T03:03:09Z","updated_at":"2015-03-07T15:48:13Z","closed_at":null,"body":"> Q_(15, 'degC') + Q_(12, 'degC')\r\n> OffsetUnitCalculusError: Ambiguous operation with offset unit (degC, degC).\r\n\r\nThere is nothing ambiguous when it is the **same** offset unit. It would be nice to avoid this error when the units are the same. Code could then convert what is considered the delta in context, rather than deal with the delta_degC object and ilk.\r\n\r\n<i>I don't know if its related, but in lantz, if the units for a Feat is a temperature, you cannot return a float for a temperature. For most Feats units, the float will be converted to the Q_ of the units. For temperature, it throws an error. The solution is to convert to a Q_ on the return.</i>\r\n\r\n<i>A side effect of returning a Q_ for Feat temperatures, is that the Feat doesn't work in the test GUI!</i>\r\n\r\n<i>I'm guessing this needs to be a fix in Pint.</i>"},"comment":{"url":"https://api.github.com/repos/hgrecco/pint/issues/comments/77694620","html_url":"https://github.com/hgrecco/pint/issues/248#issuecomment-77694620","issue_url":"https://api.github.com/repos/hgrecco/pint/issues/248","id":77694620,"user":{"login":"gdavis-github","id":5677224,"avatar_url":"https://avatars.githubusercontent.com/u/5677224?v=3","gravatar_id":"","url":"https://api.github.com/users/gdavis-github","html_url":"https://github.com/gdavis-github","followers_url":"https://api.github.com/users/gdavis-github/followers","following_url":"https://api.github.com/users/gdavis-github/following{/other_user}","gists_url":"https://api.github.com/users/gdavis-github/gists{/gist_id}","starred_url":"https://api.github.com/users/gdavis-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdavis-github/subscriptions","organizations_url":"https://api.github.com/users/gdavis-github/orgs","repos_url":"https://api.github.com/users/gdavis-github/repos","events_url":"https://api.github.com/users/gdavis-github/events{/privacy}","received_events_url":"https://api.github.com/users/gdavis-github/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T15:48:13Z","updated_at":"2015-03-07T15:48:13Z","body":"Use cases:\r\n* a ControlMethod that takes property min, max, step_size and setter_function for any Quantity\r\n  * works fine on any Quantiy but temperature (or other offset unit)\r\n  * error is raised when adjusting the setting, by adding or subtracting the step_size\r\n  * solution is to\r\n    * ask the user to enter deltas when the Quantity is an offset unit (unituitive special case)\r\n    * generate a delta from a Quantity, using some pretty clumsy code (chosen)\r\n  * meta-problem: this function was finished, until it got applied to temperature control\r\n* lantz Feats don't work as documented in that package, when used for offset units (so it has caused a problem in another package)\r\n* lantz GUI test does not work for offset units (ditto)"}}