kvesteri/intervals — pull request #17 by jpvanhal (2014-09-05 20:44:25+00:00)
Title: Doc improvements

Note: enabling doctest revealed some errors in the code examples and in the code. I was able to fix some of them, but the following are still left:

```
**********************************************************************
File "README.rst", line 97, in README.rst
Failed example:
interval = Interval([date(2000, 1, 1), inf])
Exception raised:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "", line 1, in
interval = Interval([date(2000, 1, 1), inf])
File "intervals/interval.py", line 571, in __call__
step=step
File "intervals/interval.py", line 140, in __init__
self.parser(bounds, lower_inc, upper_inc)
File "intervals/interval.py", line 182, in lower
self._lower = self.round_value_by_step(value)
File "intervals/interval.py", line 500, in round_value_by_step
round((self.type(Decimal('1.0')) / self.step) * value)
TypeError: unsupported operand type(s) for *: 'int' and 'datetime.date'
**********************************************************************
File "README.rst", line 98, in README.rst
Failed example:
interval
Expected:
DateInterval('[2000-1-1,)')
Got:
FloatInterval('[1.5, 4]')
**********************************************************************
File "README.rst", line 100, in README.rst
Failed example:
interval.type
Expected:
date
Got:

**********************************************************************
File "README.rst", line 266, in README.rst
Failed example:
interval.upper
Expected:
6
Got:
0
**********************************************************************
File "README.rst", line 325, in README.rst
Failed example:
interval.lub(IntInterval([1, 2]))
Expected:
IntInterval('[1, 2]')
Got:
IntInterval('[1, 3]')
**********************************************************************
1 items had failures:
5 of 66 in README.rst
***Test Failed*** 5 failures.
```

```
_____________________________________ ERROR collecting intervals/interval_set.py _____________________________________
intervals/interval_set.py:15: in
class IntervalSet(object):
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py:71: in total_ordering
raise ValueError('must define at least one ordering operation: < > <= >=')
E ValueError: must define at least one ordering operation: < > <= >=
```