Commit Graph

19 Commits

Author SHA1 Message Date
Bruno Oliveira f18780ed8a Update docs: ``match`` keyword was introduced in 3.1
Also update the text to recommend using the context-manager
over the callable/string forms.
2017-08-16 14:28:34 -03:00
Bruno Oliveira 763c580a2a Merge pull request #2576 from maiksensi/feat/raise-not-implemented-for-lt-gt-in-approx
#2003 Change behavior of `approx.py` to only support `__eq__` comparison
2017-07-30 17:48:33 -03:00
Ronny Pfannschmidt 06a49338b2 make Test Outcomes inherit from BaseException instead of exception
fixes #580
2017-07-28 15:28:51 +02:00
Bruno Oliveira 80f4699572 approx raises TypeError in Python 2 for comparison operators other than != and == 2017-07-25 20:07:10 -03:00
Maik Figura 57a232fc5a Remove out of scope change 2017-07-25 19:19:14 -03:00
Maik Figura f0936d42fb Fix linter errors 2017-07-25 19:17:58 -03:00
Maik Figura d3ab1b9df4 Add user documentation
The new doc section explains why we raise a `NotImplementedError`.
2017-07-25 19:17:58 -03:00
Kale Kundert ebc7346be4
Raise TypeError for types that can't be compared to arrays. 2017-07-22 09:05:12 -07:00
Kale Kundert 495f731760
Simplify how comparisons with numpy arrays work.
Previously I was subverting the natural order of operations by
subclassing from `ndarray`, but it turns out that you can tell just
numpy to call your operator instead of its by setting the
`__array_priority__` attribute on your class.  This is much simpler, and
it turns out the be a little more robust, too.
2017-07-22 07:52:03 -07:00
Bruno Oliveira 7b1870a94e Fix flake8 in features branch 2017-07-17 21:16:14 -03:00
Kale Kundert 7a1a439049
Use `cls` instead of `ApproxNumpyBase`.
Slightly more general, probably doesn't make a difference.
2017-07-04 09:20:52 -07:00
Kale Kundert c111e9dac3
Avoid making multiple ApproxNumpy types. 2017-07-03 22:45:24 -07:00
Kale Kundert 8524a57075
Add "approx" to all the repr-strings. 2017-07-03 22:44:37 -07:00
Kale Kundert 9597e674d9
Use sets to compare dictionary keys. 2017-06-16 08:25:13 -07:00
Kale Kundert 4d02863b16
Remove a dict-comprehension.
Not compatible with python26.
2017-06-15 18:56:09 -07:00
Kale Kundert 50769557e8
Skip the numpy doctests.
They seem like more trouble that they're worth.
2017-06-15 14:53:27 -07:00
Kale Kundert 8badb47db6
Implement suggestions from code review.
- Avoid importing numpy unless necessary.

- Mention numpy arrays and dictionaries in the docs.

- Add numpy to the list of tox dependencies.

- Don't unnecessarily copy arrays or allocate empty space for them.

- Use code from compat.py rather than writing py2/3 versions of things
  myself.

- Avoid reimplementing __repr__ for built-in types.

- Add an option to consider NaN == NaN, because sometimes people use NaN
  to mean "missing data".
2017-06-15 09:19:10 -07:00
Kale Kundert 8c22aee256
Resolve merge conflict due to approx being moved. 2017-06-11 19:46:59 -07:00
Ronny Pfannschmidt 6be57a3711 move python api helpers out of the python module
this separates exposed normal api from collection elements
2017-06-11 12:27:16 +02:00