summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
authorMark Wiebe <mwiebe@enthought.com>2011-06-07 13:21:12 -0500
committerMark Wiebe <mwiebe@enthought.com>2011-06-07 13:21:12 -0500
commita8274369fcbc3332067a8555782cb40cc4684c83 (patch)
tree00bf53d4e3951cd9e9588edf9876925482dea2e0 /numpy/core/_internal.py
parentfd9ef72daaa66803fd3109502fb584bbda6f407c (diff)
parent283b2e712bd52e6661f2dc338eb14caae2f5a8da (diff)
downloadnumpy-a8274369fcbc3332067a8555782cb40cc4684c83.tar.gz
Merge branch 'datetime-fixes'
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 5298f412b..a5b6d117a 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -166,36 +166,6 @@ def _split(input):
return newlist
-format_datetime = re.compile(asbytes(r"""
- (?P<typecode>M8|m8|datetime64|timedelta64)
- ([[]
- ((?P<num>\d+)?
- (?P<baseunit>Y|M|W|B|D|h|m|s|ms|us|ns|ps|fs|as)
- (/(?P<den>\d+))?
- []])
- (//(?P<events>\d+))?)?"""), re.X)
-
-# Return (baseunit, num, den, events), datetime
-# from date-time string
-def _datetimestring(astr):
- res = format_datetime.match(astr)
- if res is None:
- raise ValueError("Incorrect date-time string.")
- typecode = res.group('typecode')
- datetime = (typecode == asbytes('M8') or typecode == asbytes('datetime64'))
- defaults = [asbytes('us'), 1, 1, 1]
- names = ['baseunit', 'num', 'den', 'events']
- func = [bytes, int, int, int]
- dt_tuple = []
- for i, name in enumerate(names):
- value = res.group(name)
- if value:
- dt_tuple.append(func[i](value))
- else:
- dt_tuple.append(defaults[i])
-
- return tuple(dt_tuple), datetime
-
format_re = re.compile(asbytes(r'(?P<order1>[<>|=]?)(?P<repeats> *[(]?[ ,0-9]*[)]? *)(?P<order2>[<>|=]?)(?P<dtype>[A-Za-z0-9.]*)'))
# astr is a string (perhaps comma separated)