{"action":"created","issue":{"url":"https://api.github.com/repos/crsmithdev/arrow/issues/466","repository_url":"https://api.github.com/repos/crsmithdev/arrow","labels_url":"https://api.github.com/repos/crsmithdev/arrow/issues/466/labels{/name}","comments_url":"https://api.github.com/repos/crsmithdev/arrow/issues/466/comments","events_url":"https://api.github.com/repos/crsmithdev/arrow/issues/466/events","html_url":"https://github.com/crsmithdev/arrow/pull/466","id":263848303,"number":466,"title":"Fix arrow.Arrow.interval()","user":{"login":"dwrpayne","id":5867191,"avatar_url":"https://avatars2.githubusercontent.com/u/5867191?v=4","gravatar_id":"","url":"https://api.github.com/users/dwrpayne","html_url":"https://github.com/dwrpayne","followers_url":"https://api.github.com/users/dwrpayne/followers","following_url":"https://api.github.com/users/dwrpayne/following{/other_user}","gists_url":"https://api.github.com/users/dwrpayne/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrpayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrpayne/subscriptions","organizations_url":"https://api.github.com/users/dwrpayne/orgs","repos_url":"https://api.github.com/users/dwrpayne/repos","events_url":"https://api.github.com/users/dwrpayne/events{/privacy}","received_events_url":"https://api.github.com/users/dwrpayne/received_events","type":"User","site_admin":false},"labels":[{"id":19660345,"url":"https://api.github.com/repos/crsmithdev/arrow/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-10-09T10:28:42Z","updated_at":"2017-11-09T23:53:43Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/crsmithdev/arrow/pulls/466","html_url":"https://github.com/crsmithdev/arrow/pull/466","diff_url":"https://github.com/crsmithdev/arrow/pull/466.diff","patch_url":"https://github.com/crsmithdev/arrow/pull/466.patch"},"body":"arrow.Arrow.interval() produces unexpected results if the interval doesn't evenly divide the range. It leaves off the last chunk of time.\r\n\r\n>>> start = datetime(2013, 5, 5, 12, 30)\r\n>>> end = datetime(2013, 5, 5, 17, 15)\r\n>>> for r in arrow.Arrow.interval('hour', start, end, 4): print (r)\r\n(<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>)\r\n# Expected result:\r\n# (<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>)\r\n# (<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T17:59:59.999999+00:00]>)"},"comment":{"url":"https://api.github.com/repos/crsmithdev/arrow/issues/comments/343330564","html_url":"https://github.com/crsmithdev/arrow/pull/466#issuecomment-343330564","issue_url":"https://api.github.com/repos/crsmithdev/arrow/issues/466","id":343330564,"user":{"login":"rhan-mentad","id":13842218,"avatar_url":"https://avatars2.githubusercontent.com/u/13842218?v=4","gravatar_id":"","url":"https://api.github.com/users/rhan-mentad","html_url":"https://github.com/rhan-mentad","followers_url":"https://api.github.com/users/rhan-mentad/followers","following_url":"https://api.github.com/users/rhan-mentad/following{/other_user}","gists_url":"https://api.github.com/users/rhan-mentad/gists{/gist_id}","starred_url":"https://api.github.com/users/rhan-mentad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhan-mentad/subscriptions","organizations_url":"https://api.github.com/users/rhan-mentad/orgs","repos_url":"https://api.github.com/users/rhan-mentad/repos","events_url":"https://api.github.com/users/rhan-mentad/events{/privacy}","received_events_url":"https://api.github.com/users/rhan-mentad/received_events","type":"User","site_admin":false},"created_at":"2017-11-09T23:53:43Z","updated_at":"2017-11-09T23:53:43Z","author_association":"NONE","body":"can also fix some pep8 issues along the way with this PR ;)\r\n```\r\nif interval < 1:\r\n        raise ValueError(\"interval has to be a positive integer\")\r\n    range_span = arrow.Arrow.span_range(frame, start, end, tz)\r\n    bound = (len(range_span) // interval) * interval\r\n    _range = [(range_span[i][0], range_span[i + interval - 1][1]) for i in range(0, bound, interval)]\r\n    if bound < len(range_span):\r\n        _range.append((range_span[bound][0], range_span[-1][1]))\r\n    return _range\r\n```"}}
{"actor":{"display_login":"rhan-mentad"}}