{"action":"created","issue":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/739","repository_url":"https://api.github.com/repos/GalSim-developers/GalSim","labels_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/739/labels{/name}","comments_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/739/comments","events_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/739/events","html_url":"https://github.com/GalSim-developers/GalSim/pull/739","id":147574418,"number":739,"title":"Thinning","user":{"login":"jmeyers314","id":3650485,"avatar_url":"https://avatars.githubusercontent.com/u/3650485?v=3","gravatar_id":"","url":"https://api.github.com/users/jmeyers314","html_url":"https://github.com/jmeyers314","followers_url":"https://api.github.com/users/jmeyers314/followers","following_url":"https://api.github.com/users/jmeyers314/following{/other_user}","gists_url":"https://api.github.com/users/jmeyers314/gists{/gist_id}","starred_url":"https://api.github.com/users/jmeyers314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmeyers314/subscriptions","organizations_url":"https://api.github.com/users/jmeyers314/orgs","repos_url":"https://api.github.com/users/jmeyers314/repos","events_url":"https://api.github.com/users/jmeyers314/events{/privacy}","received_events_url":"https://api.github.com/users/jmeyers314/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/milestones/13","html_url":"https://github.com/GalSim-developers/GalSim/milestones/v1.4","labels_url":"https://api.github.com/repos/GalSim-developers/GalSim/milestones/13/labels","id":1498158,"number":13,"title":"v1.4","description":null,"creator":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":18,"state":"open","created_at":"2016-01-11T20:05:44Z","updated_at":"2016-04-13T13:01:06Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2016-04-11T22:32:35Z","updated_at":"2016-04-14T05:50:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/pulls/739","html_url":"https://github.com/GalSim-developers/GalSim/pull/739","diff_url":"https://github.com/GalSim-developers/GalSim/pull/739.diff","patch_url":"https://github.com/GalSim-developers/GalSim/pull/739.patch"},"body":"This is a short PR to improve the thin_tabulated_values() utility, which we noticed wasn't actually meeting its prescribed goals in the photometry bakeoff (https://github.com/jchiang87/PhotometryBakeoff).  The old algorithm placed a constraint on the relative error in small intervals, which it used to look for sample points that could be thrown away.  The proposed algorithm places a constraint on the global relative error, and uses a divide-and-conquer scheme to iteratively improve the approximation where the current error is the largest until the global accuracy goal is reached.\r\n\r\nThe proposed algorithm is definitely slower, but I don't think this is a problem since thinning is something typically done only once per bandpass or SED.\r\n\r\nAnother impact is that the number of retained samples using the proposed algorithm is typically more than with the previous algorithm, which will lead to slower chromatic code.  I think this ought to be viewed as an increase in accuracy, though, rather than a decrease in speed; the previous code was simply not as accurate as it claimed to be."},"comment":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/comments/209773514","html_url":"https://github.com/GalSim-developers/GalSim/pull/739#issuecomment-209773514","issue_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/739","id":209773514,"user":{"login":"jmeyers314","id":3650485,"avatar_url":"https://avatars.githubusercontent.com/u/3650485?v=3","gravatar_id":"","url":"https://api.github.com/users/jmeyers314","html_url":"https://github.com/jmeyers314","followers_url":"https://api.github.com/users/jmeyers314/followers","following_url":"https://api.github.com/users/jmeyers314/following{/other_user}","gists_url":"https://api.github.com/users/jmeyers314/gists{/gist_id}","starred_url":"https://api.github.com/users/jmeyers314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmeyers314/subscriptions","organizations_url":"https://api.github.com/users/jmeyers314/orgs","repos_url":"https://api.github.com/users/jmeyers314/repos","events_url":"https://api.github.com/users/jmeyers314/events{/privacy}","received_events_url":"https://api.github.com/users/jmeyers314/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T05:50:23Z","updated_at":"2016-04-14T05:50:23Z","body":"So I got at least one of the failures to occur on the linux cluster at SLAC and was able to trace the failure to astropy.io.fits (!).  I suspect this is the root cause of all the failures though.  Here's a minimal example behaving weirdly for the linux cluster, but not my laptop:\r\n\r\n```\r\nimport numpy as np\r\n\r\na = np.arange(10)\r\nnp.set_printoptions(threshold=5)\r\n\r\nprint repr(a)     # array([0, 1, 2, ..., 7, 8, 9])\r\nimport astropy.io.fits\r\nprint repr(a)     # array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])   !!\r\nnp.set_printoptions(threshold=5)\r\nprint repr(a)     # array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])   !!\r\n```\r\n\r\nSomehow astropy is hijacking the numpy printoptions, reseting them to its own values, and then preventing them from being changed thereafter.  Specifically, astropy version 1.0.4 seems to have this problem, but 1.0.6 does not (at least for me).\r\n\r\nSo the question then becomes, do we try to work around this?  Or do we just declare that it's an external problem?  I think the only place we muck with the printoptions is in the unit tests, not the galsim package proper."}}