GitHub PullRequestReviewCommentEvent at 2014-04-05 01:18:09
Repository: pandas
Actor: jreback
Payload: {"comment":{"url":"https://api.github.com/repos/pydata/pandas/pulls/comments/11319176","id":11319176,"diff_hunk":"@@ -119,17 +132,22 @@ def __init__(self, value=None, freq=None, ordinal=None,\n             msg = \"Value must be Period, string, integer, or datetime\"\n             raise ValueError(msg)\n \n-        base, mult = _gfc(freq)\n-        if mult != 1:\n-            # TODO: Better error message - this is slightly confusing\n-            raise ValueError('Only mult == 1 supported')\n+        self.freq_obj = freq\n+        _check_freq_mult(freq)\n \n         if self.ordinal is None:\n-            self.ordinal = tslib.period_ordinal(dt.year, dt.month, dt.day,\n-                                                dt.hour, dt.minute, dt.second, dt.microsecond, 0,\n-                                                base)\n+            if isinstance(freq, _NonCythonPeriod):\n+                self.ordinal = freq.get_period_ordinal(dt)\n+            else:\n+                base, _ = _gfc(freq, as_periodstr=True)\n+\n+                self.ordinal = tslib.period_ordinal(dt.year, dt.month, dt.day,\n+                                                    dt.hour, dt.minute, dt.second, dt.microsecond, 0,\n+                                                    base)\n \n-        self.freq = _freq_mod._get_freq_str(base)\n+    @cache_readonly","path":"pandas/tseries/period.py","position":110,"original_position":110,"commit_id":"af7bc2d113fa933a358fc164f212b9462abe6e56","original_commit_id":"af7bc2d113fa933a358fc164f212b9462abe6e56","user":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?","gravatar_id":"b2833d485728ee2f603802242ebc9826","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"body":"why did you add a ``freq_obj`` and not just leave it as ``freq`` (and then have then ``__repr__/__str__`` return the string repr) (and the same as ``freqstr``? isn't this more complicated?","created_at":"2014-04-05T01:18:09Z","updated_at":"2014-04-05T01:18:09Z","html_url":"https://github.com/pydata/pandas/pull/5148#discussion_r11319176","pull_request_url":"https://api.github.com/repos/pydata/pandas/pulls/5148","_links":{"self":{"href":"https://api.github.com/repos/pydata/pandas/pulls/comments/11319176"},"html":{"href":"https://github.com/pydata/pandas/pull/5148#discussion_r11319176"},"pull_request":{"href":"https://api.github.com/repos/pydata/pandas/pulls/5148"}}}}