-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create
SupportsRealImagAsMethod
, real
, and imag
Now ``sympy.core.numbers`` primitives are adequately supported (excepting general false positives; see #5). Fixes #4. Also renames ``SupportsNumeratorDenominatorProperties`` to ``SupportsNumeratorDenominator`` for consistency.
- Loading branch information
Showing
23 changed files
with
487 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
all : \ | ||
perf_rational_baseline.txt \ | ||
perf_rational_big_protocol.txt \ | ||
perf_rational_protocol.txt \ | ||
perf_supports_complex.txt | ||
|
||
perf_%.txt : perf_%.ipy Makefile ../numerary/types.py | ||
ipython --no-banner --quick --LoggingMagics.quiet=True perf_$*.ipy \ | ||
| cut >perf_$*.txt -f 2 -d $$'\a' | ||
|
||
../numerary-encumbered.svg : Makefile | ||
curl --output $@ 'https://img.shields.io/badge/%F0%9F%98%A3-%F0%9D%9A%97%F0%9D%9A%9E%F0%9D%9A%96%F0%9D%9A%8E%F0%9D%9A%9B%F0%9D%9A%8A%F0%9D%9A%9B%F0%9D%9A%A2--encumbered-yellowgreen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%timeit isinstance(builtins.int(1), Rational) | ||
356 ns ± 15.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
%timeit isinstance(fractions.Fraction(2), Rational) | ||
350 ns ± 14.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
%timeit isinstance(builtins.float(3.0), Rational) | ||
359 ns ± 3.21 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) |
6 changes: 3 additions & 3 deletions
6
docs/perf_rational_big_protocol.out → docs/perf_rational_big_protocol.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
%timeit isinstance(builtins.int(1), SupportsLotsOfNumberStuff) | ||
132 µs ± 1.15 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
136 µs ± 3.3 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
%timeit isinstance(fractions.Fraction(2), SupportsLotsOfNumberStuff) | ||
139 µs ± 2.01 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
154 µs ± 5.94 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
%timeit isinstance(builtins.float(3.0), SupportsLotsOfNumberStuff) | ||
131 µs ± 1.13 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
149 µs ± 8.33 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) |
6 changes: 3 additions & 3 deletions
6
docs/perf_rational_protocol.out → docs/perf_rational_protocol.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
%timeit isinstance(builtins.int(1), SupportsNumeratorDenominator) | ||
12.3 µs ± 95.6 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
13 µs ± 270 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(fractions.Fraction(2), SupportsNumeratorDenominator) | ||
12.4 µs ± 91.6 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
14 µs ± 761 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(builtins.float(3.0), SupportsNumeratorDenominator) | ||
12.5 µs ± 167 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
15.4 µs ± 323 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) |
21 changes: 11 additions & 10 deletions
21
docs/perf_supports_complex.out → docs/perf_supports_complex.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
%timeit isinstance(builtins.int(1), _SupportsComplexOps) | ||
11.8 µs ± 314 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
11.9 µs ± 279 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(builtins.int(1), SupportsComplexOps) | ||
307 ns ± 2.97 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
312 ns ± 1.56 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
|
||
%timeit isinstance(builtins.float(2.0), _SupportsComplexOps) | ||
11.6 µs ± 104 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
13.1 µs ± 385 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(builtins.float(2.0), SupportsComplexOps) | ||
312 ns ± 6.29 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
380 ns ± 23 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
|
||
%timeit isinstance(decimal.Decimal(3), _SupportsComplexOps) | ||
11.7 µs ± 68.1 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
13.3 µs ± 897 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(decimal.Decimal(3), SupportsComplexOps) | ||
306 ns ± 3.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
322 ns ± 12.4 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
|
||
%timeit isinstance(fractions.Fraction(4), _SupportsComplexOps) | ||
11.7 µs ± 100 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
11.9 µs ± 178 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(fractions.Fraction(4), SupportsComplexOps) | ||
308 ns ± 4.24 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
314 ns ± 1.54 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
|
||
%timeit isinstance(sympy.core.numbers.Integer(5), _SupportsComplexOps) | ||
11.9 µs ± 251 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
12 µs ± 110 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
%timeit isinstance(sympy.core.numbers.Integer(5), SupportsComplexOps) | ||
306 ns ± 1.5 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
315 ns ± 4.39 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.