{"action":"created","issue":{"url":"https://api.github.com/repos/lebigot/uncertainties/issues/19","labels_url":"https://api.github.com/repos/lebigot/uncertainties/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/lebigot/uncertainties/issues/19/comments","events_url":"https://api.github.com/repos/lebigot/uncertainties/issues/19/events","html_url":"https://github.com/lebigot/uncertainties/issues/19","id":15079654,"number":19,"title":"Module wrapping","user":{"login":"hgrecco","id":278566,"avatar_url":"https://avatars.githubusercontent.com/u/278566?v=3","gravatar_id":"","url":"https://api.github.com/users/hgrecco","html_url":"https://github.com/hgrecco","followers_url":"https://api.github.com/users/hgrecco/followers","following_url":"https://api.github.com/users/hgrecco/following{/other_user}","gists_url":"https://api.github.com/users/hgrecco/gists{/gist_id}","starred_url":"https://api.github.com/users/hgrecco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgrecco/subscriptions","organizations_url":"https://api.github.com/users/hgrecco/orgs","repos_url":"https://api.github.com/users/hgrecco/repos","events_url":"https://api.github.com/users/hgrecco/events{/privacy}","received_events_url":"https://api.github.com/users/hgrecco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2013-06-03T17:56:53Z","updated_at":"2015-05-06T23:43:01Z","closed_at":null,"body":"I am cross posting this here from https://github.com/hgrecco/pint/issues/24\r\n\r\nIt would be nice to transform your umath module in a function plus a function call\r\n\r\n```\r\nimport math\r\n\r\ndef wrap_module(module, wrapped, wrapfun):\r\n    # Here goes most of the code inside umath\r\n    # but replacing \r\n    # math -> wrapped\r\n    # wraps -> wrapfun\r\n\r\nwrap_module(sys.modules[__name__], math, wraps)\r\n```\r\n\r\nIn this way, other people using your library for their own classes (like me!) could just call wrap_module with a different wrapping function. \r\n\r\nWhat do you think?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/lebigot/uncertainties/issues/comments/99646545","html_url":"https://github.com/lebigot/uncertainties/issues/19#issuecomment-99646545","issue_url":"https://api.github.com/repos/lebigot/uncertainties/issues/19","id":99646545,"user":{"login":"lebigot","id":5793,"avatar_url":"https://avatars.githubusercontent.com/u/5793?v=3","gravatar_id":"","url":"https://api.github.com/users/lebigot","html_url":"https://github.com/lebigot","followers_url":"https://api.github.com/users/lebigot/followers","following_url":"https://api.github.com/users/lebigot/following{/other_user}","gists_url":"https://api.github.com/users/lebigot/gists{/gist_id}","starred_url":"https://api.github.com/users/lebigot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lebigot/subscriptions","organizations_url":"https://api.github.com/users/lebigot/orgs","repos_url":"https://api.github.com/users/lebigot/repos","events_url":"https://api.github.com/users/lebigot/events{/privacy}","received_events_url":"https://api.github.com/users/lebigot/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T23:43:01Z","updated_at":"2015-05-06T23:43:01Z","body":"For reference: direct implementation of uncertainties in NumPy ndarrays: https://github.com/astropy/astropy/pull/3715#issuecomment-95876577."}}