hash
stringlengths
64
64
content
stringlengths
0
1.51M
62e4753f7c63464c503fcf3e7667dcf3d4bc3b37f2b551a7f658fa35980f0998
from sympy.core.relational import Eq, is_eq from sympy.core.logic import fuzzy_and, fuzzy_bool from sympy.logic.boolalg import And from sympy.multipledispatch import dispatch from sympy.sets.sets import tfn, ProductSet, Interval, FiniteSet @dispatch(Interval, FiniteSet) def _eval_is_eq(lhs, rhs): # noqa: F811 ret...
a858020e4bebaa9f2c0b9fdb0c2077e413da1ac046b31db5f505498d183c9655
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import os from itertools import chain import json import sys import warnings import pytest from sympy.testing.runtests import setup_pprint, _get_doctest_blacklist durations_path = os.path.join(os.path.dirname(__file__), '.ci', '...
f6e3c0a0120b741b0d16511361ab5dab52e66b36c78a4379034f01a29ba4067b
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A tool to generate AUTHORS. We started tracking authors before moving to git, so we have to do some manual rearrangement of the git history authors in order to get the order in AUTHORS. bin/mailmap_update.py should be run before committing the results. """ from __futur...
6f570d05bae2bcd24dfb435352aa7686e333de8733998ad538326acaa26d61e5
#!/usr/bin/env python """ Test that only executable files have an executable bit set """ from __future__ import print_function import os import sys from get_sympy import path_hack base_dir = path_hack() def test_executable(path): if not os.path.isdir(path): if os.access(path, os.X_OK): with o...
f27b6b78c19f8637e90dc32c70c275d67b062c75a1b4c82c192c12fccd200331
#!/usr/bin/env python """ Test that from sympy import * doesn't import anything other than SymPy, it's hard dependencies (mpmath), and hard optional dependencies (gmpy2). Importing unnecessary libraries can accidentally add hard dependencies to SymPy in the worst case, or at best slow down the SymPy import time when ...
77e2be58473622545b79a96ade239dd88ec3f60d9a44c20284fed0c4c4b56068
#!/usr/bin/env python """ Test that from sympy import * only imports those sympy submodules that have names that are part of the top-level namespace. """ import sys import os # hook in-tree SymPy into Python path, if possible this_path = os.path.abspath(__file__) this_dir = os.path.dirname(this_path) sympy_top = o...
b269c0ec426d3e816e80bd4ddb4d3223168257de1808f0e1aeeee4364cd9f1ab
#!/usr/bin/env python """ Script to generate test coverage reports. Usage: $ bin/coverage_report.py This will create a directory covhtml with the coverage reports. To restrict the analysis to a directory, you just need to pass its name as argument. For example: $ bin/coverage_report.py sympy/logic runs only the t...
e9e0c452359500b056918d133e572097e4b22377bde79c3dff43554945c6b3e4
#!/usr/bin/env python3 import subprocess import sys from os.path import join, splitext, basename from contextlib import contextmanager from tempfile import TemporaryDirectory from zipfile import ZipFile from shutil import copytree def main(sympy_doc_git, doc_html_zip, version, push=None): """Run this as ./updat...
626da77cf38bad8e05ec9065bb64975cd69be34ad8cde7c499d0e819bfa35a34
""" SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python. It depends on mpmath, and other external libraries may be option...
20f14288e489734a63a3fd43945b74666d87e23dcb203879269976242bce388e
#!/usr/bin/env python """Pretty print example Demonstrates pretty printing. """ from sympy import Symbol, pprint, sin, cos, exp, sqrt, MatrixSymbol, KroneckerProduct def main(): x = Symbol("x") y = Symbol("y") a = MatrixSymbol("a", 1, 1) b = MatrixSymbol("b", 1, 1) c = MatrixSymbol("c", 1, 1) ...
fa79c8e992b8d9e9927793a513fe5cbae6afed27b460c32425a142714553d4b0
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwis...
2d9b891b19d8f9bdf2a577fb0fc458d6e737908345b2ffabcd7f016e1ca9f91d
from __future__ import division, absolute_import, print_function import sys import re import inspect import textwrap import pydoc import sphinx import collections from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): ...
143099c96dc670625c55f30eeb8588e808c62f3719cc6f0d02db5799f474161c
from __future__ import print_function, division import random import itertools from sympy import (Matrix, MatrixSymbol, S, Indexed, Basic, Set, And, Eq, FiniteSet, ImmutableMatrix, Lambda, Mul, Dummy, IndexedBase, Add, Interval, oo, linsolve, eye, Or, Not, Inte...
86a828c5502fb8e6c88bd2fdf80b8e0e80807e33537f7ab9c693aee5a2a1535e
from sympy import S, Basic, exp, multigamma, pi from sympy.core.sympify import sympify, _sympify from sympy.matrices import (ImmutableMatrix, Inverse, Trace, Determinant, MatrixSymbol, MatrixBase, Transpose, MatrixSet, matrix2numpy) from sympy.stats.rv import (_va...
963b181026147d473ed1e42806d7322e11298bbc3821ecc6b0c5590b94247db0
""" SymPy statistics module Introduces a random variable type into the SymPy language. Random variables may be declared using prebuilt functions such as Normal, Exponential, Coin, Die, etc... or built with functions like FiniteRV. Queries on random expressions can be made using the functions ======================...
3de5d917cdecd68b97ac922eff77419c21ac4049206d45a2e951c26e5e41c97f
""" Main Random Variables Module Defines abstract random variable type. Contains interfaces for probability space object (PSpace) as well as standard operators, P, E, sample, density, where, quantile See Also ======== sympy.stats.crv sympy.stats.frv sympy.stats.rv_interface """ from __future__ import print_function...
348d9eb2190c55211bd577dde6578b0fc28fceccfa05fd76e318be4231fe73bb
""" Joint Random Variables Module See Also ======== sympy.stats.rv sympy.stats.frv sympy.stats.crv sympy.stats.drv """ from __future__ import print_function, division from sympy import (Basic, Lambda, sympify, Indexed, Symbol, ProductSet, S, Dummy) from sympy.concrete.products import Product from ...
755263de89f6d520833954ae6458cb2452f205c6bd413dae44409872811fd0d3
from sympy import Basic, Sum, Dummy, Lambda, Integral from sympy.stats.rv import (NamedArgsMixin, random_symbols, _symbol_converter, PSpace, RandomSymbol, is_random) from sympy.stats.crv import ContinuousDistribution, SingleContinuousPSpace from sympy.stats.drv import DiscreteDistribution, Singl...
5d55b05966aff116634da7fda462a42dba24e8d3a841b6d57c2d0cd183fad77a
from __future__ import print_function, division from sympy import (Basic, exp, pi, Lambda, Trace, S, MatrixSymbol, Integral, gamma, Product, Dummy, Sum, Abs, IndexedBase, I) from sympy.core.sympify import _sympify from sympy.stats.rv import _symbol_converter, Density, RandomMatrixSymbol, is_random f...
acbecd9795e590e73165f245e1f24feb8c2e6e1ff762c688161c494e501eeba4
from sympy import Integer import sympy.polys from math import gcd def egyptian_fraction(r, algorithm="Greedy"): """ Return the list of denominators of an Egyptian fraction expansion [1]_ of the said rational `r`. Parameters ========== r : Rational a positive rational number. alg...
fa830824c5508dcd5d3dae281f52ce8753fbb4b08cc084012b4e89e59230dd8e
from __future__ import print_function, division from collections import defaultdict from sympy.core import (Basic, S, Add, Mul, Pow, Symbol, sympify, expand_func, Function, Dummy, Expr, factor_terms, expand_power_exp, Eq) from sympy.core.compatibility import iterable, o...
032de2bec20a5ead97aa7c3d9ffa457bb9e80752dc02cdba8c48ca4d5de48e5b
from sympy.core import Add, Expr, Mul, S, sympify from sympy.core.function import _mexpand, count_ops, expand_mul from sympy.core.symbol import Dummy from sympy.functions import root, sign, sqrt from sympy.polys import Poly, PolynomialError from sympy.utilities import default_sort_key def is_sqrt(expr): """Return...
ef34f4749e04b60f3562902026d72790384375b43e4cafa58b508f99ebe596bc
from typing import Any, Set from itertools import permutations from sympy.combinatorics import Permutation from sympy.core import ( Basic, Expr, Function, diff, Pow, Mul, Add, Atom, Lambda, S, Tuple, Dict ) from sympy.core.cache import cacheit from sympy.core.compatibility import reduce from sympy.core.symbol...
a4e118caef58a38834b98d6562da42eea909725bbfac46b0e251b250b060047f
""" AST nodes specific to the C family of languages """ from sympy.codegen.ast import Attribute, Declaration, Node, String, Token, Type, none, FunctionCall from sympy.core.basic import Basic from sympy.core.containers import Tuple from sympy.core.sympify import sympify void = Type('void') restrict = Attribute('restr...
8f6a275dc6626891b2eb08cfb795a1e8a177ab44396c7bbd58c991f4841da4e7
from sympy.core.function import Add, ArgumentIndexError, Function from sympy.core.power import Pow from sympy.core.singleton import S from sympy.functions.elementary.exponential import exp, log from sympy.utilities import default_sort_key def _logaddexp(x1, x2, *, evaluate=True): return log(Add(exp(x1, evaluate=e...
d5f7fec78bfcb8975afef511081337de38e895cbb03497993eb7cf4c2bff1634
""" Classes and functions useful for rewriting expressions for optimized code generation. Some languages (or standards thereof), e.g. C99, offer specialized math functions for better performance and/or precision. Using the ``optimize`` function in this module, together with a collection of rules (represented as instan...
28adbba1735a1e33952f0d9576334f2d1e7b523778e2967c1be126fce9495b3b
""" Types used to represent a full function/module as an Abstract Syntax Tree. Most types are small, and are merely used as tokens in the AST. A tree diagram has been included below to illustrate the relationships between the AST types. AST Type Tree ------------- :: *Basic* |--->AssignmentBase | ...
0fb522feaf94491631fa068070f0d31ab30558ec2bffa82449da30ab07927557
""" This module contains SymPy functions mathcin corresponding to special math functions in the C standard library (since C99, also available in C++11). The functions defined in this module allows the user to express functions such as ``expm1`` as a SymPy function for symbolic manipulation. """ from sympy.core.functi...
be5cccb3c3a40b906ee2c20ff801769987ffb48a3b528e2bd83008fcb3616733
from sympy.printing.c import C99CodePrinter def render_as_source_file(content, Printer=C99CodePrinter, settings=None): """ Renders a C source file (with required #include statements) """ printer = Printer(settings or {}) code_str = printer.doprint(content) includes = '\n'.join(['#include <%s>' % h for ...
93e9b13092abfd0fda7d3cba36b28d97f3765d02c199275902cb0ee610689cd6
from itertools import chain from sympy.codegen.fnodes import Module from sympy.core.symbol import Dummy from sympy.printing.fortran import FCodePrinter """ This module collects utilities for rendering Fortran code. """ def render_as_module(definitions, name, declarations=(), printer_settings=None): """ Creates a...
076385f0c02c6909def3fe4032a00099f48f4aabc63f21ae6d609a10136c5d15
""" module for generating C, C++, Fortran77, Fortran90, Julia, Rust and Octave/Matlab routines that evaluate sympy expressions. This module is work in progress. Only the milestones with a '+' character in the list below have been completed. --- How is sympy.utilities.codegen different from sympy.printing.ccode? --- W...
06c9c61ffdbc253e4878da6d1ecc279f5b153a0830fa4db0900145dd2074ee36
""" Python code printers This module contains python code printers for plain python as well as NumPy & SciPy enabled code. """ from collections import defaultdict from itertools import chain from sympy.core import S from .precedence import precedence from .codeprinter import CodePrinter _kw_py2and3 = { 'and', 'as...
fdaa994e864d9b004814d3c9703051e420381aa8b940949f5606fe1e219bdbb8
""" A Printer for generating readable representation of most sympy classes. """ from __future__ import print_function, division from typing import Any, Dict from sympy.core import S, Rational, Pow, Basic, Mul, Number from sympy.core.mul import _keep_coeff from .printer import Printer from sympy.printing.precedence i...
5b059a164f16ba0a2fd642a11ee0e0c78584dc764b03aca9a9b838c0941bd842
"""Printing subsystem""" from .pretty import pager_print, pretty, pretty_print, pprint, pprint_use_unicode, pprint_try_use_unicode from .latex import latex, print_latex, multiline_latex from .mathml import mathml, print_mathml from .python import python, print_python from .pycode import pycode from .codeprinter i...
0c1d1e721d28637d9c6625a6c3fea8eca95468f18f926598fd1cd61cf4e6b670
""" Rust code printer The `RustCodePrinter` converts SymPy expressions into Rust expressions. A complete code generator, which uses `rust_code` extensively, can be found in `sympy.utilities.codegen`. The `codegen` module can be used to generate complete source code files. """ # Possible Improvement # # * make sure ...
b7774aa8930090d11f1b1f7db2c18e1e25103b3e69f5924da09e759460349bfa
""" C++ code printer """ from __future__ import (absolute_import, division, print_function) from itertools import chain from sympy.codegen.ast import Type, none from .c import C89CodePrinter, C99CodePrinter # These are defined in the other file so we can avoid importing sympy.codegen # from the top-level 'import symp...
6db3f65d8d8c2b83c395c1f2c79aadc7d3bd279aa135e64cc6bdc889b69c2e30
""" A Printer which converts an expression into its LaTeX equivalent. """ from __future__ import print_function, division from typing import Any, Dict import itertools from sympy.core import Add, Float, Mod, Mul, Number, S, Symbol from sympy.core.alphabets import greeks from sympy.core.containers import Tuple from ...
d4f4f6ea6126628a52c757e711ef7e7a36fae9f8545eca238990b2020bca537f
"""Printing subsystem driver SymPy's printing system works the following way: Any expression can be passed to a designated Printer who then is responsible to return an adequate representation of that expression. **The basic concept is the following:** 1. Let the object print itself if it knows how. 2. Take the bes...
570af13e0dd88ad6497996d5328fd081a5f4d3d9ea9530297dfad5ced6ca3393
""" C code printer The C89CodePrinter & C99CodePrinter converts single sympy expressions into single C expressions, using the functions defined in math.h where possible. A complete code generator, which uses ccode extensively, can be found in sympy.utilities.codegen. The codegen module can be used to generate complet...
e2bd7712684273cf9b5e0bdf665dad984931edc110cccf31847432e4b93eb8a7
""" Fortran code printer The FCodePrinter converts single sympy expressions into single Fortran expressions, using the functions defined in the Fortran 77 standard where possible. Some useful pointers to Fortran can be found on wikipedia: https://en.wikipedia.org/wiki/Fortran Most of the code below is based on the "...
2027de104d67865a78a0c365637f5dd36e11b43789b3b83b34b2cacc8390b552
""" R code printer The RCodePrinter converts single sympy expressions into single R expressions, using the functions defined in math.h where possible. """ from __future__ import print_function, division from typing import Any, Dict from sympy.printing.codeprinter import CodePrinter from sympy.printing.precedence...
39527a752ee2242ea4b2e47bf125cdd3f17a8b54705d4dad63d924f78baa927b
""" Octave (and Matlab) code printer The `OctaveCodePrinter` converts SymPy expressions into Octave expressions. It uses a subset of the Octave language for Matlab compatibility. A complete code generator, which uses `octave_code` extensively, can be found in `sympy.utilities.codegen`. The `codegen` module can be us...
ceb2f98089b8b2e759004f7604cffac6f11db3e6f475da77a20068a04ec3f20b
from __future__ import print_function, division from typing import Any, Dict, Set, Tuple from functools import wraps from sympy.core import Add, Expr, Mul, Pow, S, sympify, Float from sympy.core.basic import Basic from sympy.core.compatibility import default_sort_key from sympy.core.function import Lambda from sympy...
84af4fcb21029aad9b496fe8558e6b49486afb0f388772fbedfeb5d396b88d2c
""" Maple code printer The MapleCodePrinter converts single sympy expressions into single Maple expressions, using the functions defined in the Maple objects where possible. FIXME: This module is still under actively developed. Some functions may be not completed. """ from __future__ import print_function, division...
f735a5fdf563cc0b045eb3005b609c0f268b0d2f7d778aa47ff7c0e091da54e5
from __future__ import print_function, division import io import os from os.path import join import shutil import tempfile try: from subprocess import STDOUT, CalledProcessError, check_output except ImportError: pass from sympy.utilities.decorator import doctest_depends_on from .latex import latex __doctest...
e6a43ccf52a61bbb2d3bca06e442720cb3d8c17b8d29d254e21f4aff7b8183a2
""" Javascript code printer The JavascriptCodePrinter converts single sympy expressions into single Javascript expressions, using the functions defined in the Javascript Math object where possible. """ from __future__ import print_function, division from typing import Any, Dict from sympy.core import S from sympy....
968ede0b36d5c9ea8b40c448796332e2dbb8c1e9d940babf9557a6a494c2cbe0
""" A Printer for generating executable code. The most important function here is srepr that returns a string so that the relation eval(srepr(expr))=expr holds in an appropriate environment. """ from __future__ import print_function, division from typing import Any, Dict from sympy.core.function import AppliedUndef...
0d85e1ba5eb8e871122cb79ea542ece74b1f0bc54993d6af521b1d7f49764882
""" Julia code printer The `JuliaCodePrinter` converts SymPy expressions into Julia expressions. A complete code generator, which uses `julia_code` extensively, can be found in `sympy.utilities.codegen`. The `codegen` module can be used to generate complete source code files. """ from __future__ import print_funct...
295f997d500c747855a48ebe060cb27d8596b81d002edf3919e33e085d674b86
from typing import Set from sympy.core import Basic, S from sympy.core.function import _coeff_isneg, Lambda from sympy.printing.codeprinter import CodePrinter from sympy.printing.precedence import precedence from functools import reduce known_functions = { 'Abs': 'abs', 'sin': 'sin', 'cos': 'cos', 'ta...
d1750867cc60b948477cb855598dd4dee76e5df730e039b77f86f404209d088f
"""Module for SymPy containers (SymPy objects that store other SymPy objects) The containers implemented in this module are subclassed to Basic. They are supposed to work seamlessly within the SymPy framework. """ from collections import OrderedDict from sympy.core.basic import Basic from sympy.core.com...
cc55d811d3d83daf7bb1a83e295e5073366136d2c7337f16d9dbb46ed05d5085
""" Base class to provide str and repr hooks that `init_printing` can overwrite. This is exposed publicly in the `printing.defaults` module, but cannot be defined there without causing circular imports. """ class Printable: """ The default implementation of printing for SymPy classes. This implements a h...
805ceb88f60a68ef12c54c51090d601cdbe1bb5ad268f83f40c0def6a58393bc
"""Tools for setting up printing in interactive sessions. """ import sys from distutils.version import LooseVersion as V from io import BytesIO from sympy import latex as default_latex from sympy import preview from sympy.utilities.misc import debug from sympy.printing.defaults import Printable def _init_python_pri...
d9465d06ab69fa6791950c7fb944d55cd33e503a4d7e7fa3260ce6bc818bbebf
from __future__ import print_function from sympy.matrices.dense import MutableDenseMatrix from sympy.polys.polytools import Poly from sympy.polys.domains import EX class MutablePolyDenseMatrix(MutableDenseMatrix): """ A mutable matrix of objects from poly module or to operate with them. Examples ==...
95024ae6c16aa7d32ce2d0991e927e29a9e1e0aac96914dfbcf19ecb8120f4ef
from __future__ import print_function from operator import mul from sympy.core.sympify import _sympify from sympy.matrices.common import (NonInvertibleMatrixError, NonSquareMatrixError, ShapeError) from sympy.polys.constructor import construct_domain class DDMError(Exception): """Base class for errors raise...
bbc53c9e43d9e1893f1f444724b7d2e6ec94fec9d332ea234a9f8ba6a905ea85
"""Sparse rational function fields. """ from __future__ import print_function, division from typing import Any, Dict from operator import add, mul, lt, le, gt, ge from sympy.core.compatibility import is_sequence, reduce from sympy.core.expr import Expr from sympy.core.mod import Mod from sympy.core.numbers import E...
0b88a5000fb64fb2d64e3049e282a8527257987a86677e18214b4b62ced34c55
"""Low-level linear systems solver. """ from __future__ import print_function, division from sympy.utilities.iterables import connected_components from sympy.matrices import MutableDenseMatrix from sympy.polys.domains import EX from sympy.polys.rings import sring from sympy.polys.polyerrors import NotInvertible from...
fd389536eeda25a7286980919fb2614043108b2d54d64b95befe000f493edefb
"""Computational algebraic field theory. """ from __future__ import print_function, division from sympy import ( S, Rational, AlgebraicNumber, GoldenRatio, TribonacciConstant, Add, Mul, sympify, Dummy, expand_mul, I, pi ) from sympy.functions import sqrt, cbrt from sympy.core.compatibility import reduce from ...
6732d67b99280489f3066711ef699876aa021739f1bcaea9d5292bd9fabf5ea8
from sympy.vector.coordsysrect import CoordSys3D, CoordSysCartesian from sympy.vector.vector import (Vector, VectorAdd, VectorMul, BaseVector, VectorZero, Cross, Dot, cross, dot) from sympy.vector.dyadic import (Dyadic, DyadicAdd, DyadicMul, BaseDyadic, ...
da63b1f841a69779d8df0e7ca09db237d7315efa06de4fef1d1a970e6c710834
from sympy import S, Rational, gcd, sqrt, sign, symbols, Complement from sympy.core import Basic, Tuple, diff, expand, Eq, Integer from sympy.core.compatibility import ordered from sympy.core.symbol import _symbol from sympy.solvers import solveset, nonlinsolve, diophantine from sympy.polys import total_degree from sym...
47c9ffc0a9a0b9f940f795b5d81def118867335a8cf459a3356970de52f56236
from __future__ import division, print_function from contextlib import contextmanager from threading import local from sympy.core.function import expand_mul from sympy.simplify.simplify import dotprodsimp as _dotprodsimp class DotProdSimpState(local): def __init__(self): self.state = False _dotprodsimp...
abca347c2f5bca773dadf338873bac2233c1308d38b368cedb6f242dd68055e8
"""A module that handles matrices. Includes functions for fast creating matrices like zero, one/eye, random matrix, etc. """ from .common import ShapeError, NonSquareMatrixError from .dense import ( GramSchmidt, casoratian, diag, eye, hessian, jordan_cell, list2numpy, matrix2numpy, matrix_multiply_elementwise,...
01dd54affabf2e44e1f8bcf67bf0bc78bdbc278badfc54d27120aa8be7854dac
""" Basic methods common to all matrices to be used when creating more advanced matrices (e.g., matrices over rings, etc.). """ from sympy.core.logic import FuzzyBool from collections import defaultdict from inspect import isfunction from sympy.assumptions.refine import refine from sympy.core import SympifyError, Ad...
73aec4d6aadb954865e6f169d90038945db3e14beee90c5eb60a1ab9f5016ab8
import mpmath as mp from sympy.core.add import Add from sympy.core.basic import Basic from sympy.core.compatibility import ( Callable, NotIterable, as_int, is_sequence) from sympy.core.decorators import deprecated from sympy.core.expr import Expr from sympy.core.power import Pow from sympy.core.singleton import S ...
9d80c564ae9db53eca8a020ccdb010144a982688997de87a6ccef4a95e951b0c
from types import FunctionType from collections import Counter from mpmath import mp, workprec from mpmath.libmp.libmpf import prec_to_dps from sympy.core.compatibility import default_sort_key from sympy.core.evalf import DEFAULT_MAXPREC, PrecisionExhausted from sympy.core.logic import fuzzy_and, fuzzy_or from sympy....
af38c32224bed4463735d96867b58a9bf5056a37781fd33fdbd4cc41065f68f3
from __future__ import print_function, division from functools import reduce from sympy.core.basic import Basic from sympy.core.containers import Tuple from sympy.core.expr import Expr from sympy.core.function import Lambda from sympy.core.logic import fuzzy_not, fuzzy_or, fuzzy_and from sympy.core.numbers import oo,...
5fecaf57786964841d08e93da96f1ed481a0896c4a76d7d2f120f8227df153df
from __future__ import unicode_literals from sympy import (S, Symbol, Interval, exp, Or, symbols, Eq, cos, And, Tuple, integrate, oo, sin, Sum, Basic, Indexed, DiracDelta, Lambda, log, pi, FallingFactorial, Rational, Matrix) from sympy.stats import (Die, Normal, Exponential, FiniteRV, P, E, H, variance,...
e9bb50144f7d29e264885a1162deceab4eddd90634c4578109e14d5e44743f29
from sympy import (FiniteSet, S, Symbol, sqrt, nan, beta, Rational, symbols, simplify, Eq, cos, And, Tuple, Or, Dict, sympify, binomial, cancel, exp, I, Piecewise, Sum, Dummy) from sympy.external import import_module from sympy.matrices import Matrix from sympy.stats import (Discre...
6a41b983f0493c4f4e1ed858a8565d33ced1fdd91b28fc111269257e65fe3f6f
from sympy import (symbols, pi, oo, S, exp, sqrt, besselk, Indexed, Sum, simplify, Rational, factorial, gamma, Piecewise, Eq, Product, Interval, IndexedBase, RisingFactorial, polar_lift, ProductSet, Range) from sympy.core.numbers import comp from sympy.integrals.integrals import in...
2399a56c49f71d09e5ea9e72fa0da10dc2ea2b777cc5713da360cc908cd51b62
from sympy import (Symbol, Eq, Ne, simplify, sqrt, exp, pi, symbols, Piecewise, factorial, gamma, IndexedBase, Add, Pow, Mul, Indexed, Integer, Integral, DiracDelta, Dummy, Sum, oo) from sympy.functions.elementary.piecewise import ExprCondPair from sympy.stats import (Poisson, Beta, Expo...
8e9a0a6c6454a989dd3d29813501dde0551a831ffd816f62dda3cbc40c1703bf
from sympy import (S, symbols, FiniteSet, Eq, Matrix, MatrixSymbol, Float, And, ImmutableMatrix, Ne, Lt, Gt, exp, Not, Rational, Lambda, erf, Piecewise, factorial, Interval, oo, Contains, sqrt, pi, gamma, lowergamma, Sum) from sympy.stats import (DiscreteMarkovCh...
71c84ef03cb562b210f154916e8176c664ec81fc6fc21ccca9196ea635b3f64c
from sympy import exp, S, sqrt, pi, symbols, Product, gamma, Dummy from sympy.matrices import Determinant, Matrix, Trace, MatrixSymbol, MatrixSet from sympy.stats import density, sample from sympy.stats.matrix_distributions import (MatrixGammaDistribution, MatrixGamma, MatrixPSpace, Wishart, MatrixNorma...
5ff9e822ed6775c8ffb684f8039cc6acb48d059ecf808b90483fa5dc427f3303
from sympy import (S, Symbol, Sum, I, lambdify, re, im, log, simplify, sqrt, zeta, pi, besseli, Dummy, oo, Piecewise, Rational, beta, floor, FiniteSet) from sympy.core.relational import Eq, Ne from sympy.functions.elementary.exponential import exp from sympy.logic.boolalg import Or...
93afc7e674eee8bfe4b1ff1ce51a4d247660558440c8fd141a6fd65bae5bc635
from sympy import (sqrt, exp, Trace, pi, S, Integral, MatrixSymbol, Lambda, Dummy, Product, Abs, IndexedBase, Matrix, I, Rational) from sympy.stats import (GaussianUnitaryEnsemble as GUE, density, GaussianOrthogonalEnsemble as GOE, GaussianSymplectic...
753c89b3acfd507be2c26b4251ad2696e6a5fd1bb71d671e3647c792d1c827eb
from sympy import E as e from sympy import (Symbol, Abs, exp, expint, S, pi, simplify, Interval, erf, erfc, Ne, EulerGamma, Eq, log, lowergamma, uppergamma, symbols, sqrt, And, gamma, beta, Piecewise, Integral, sin, cos, tan, sinh, cosh, besseli, floor, expand_fu...
cc99a9d2f4a04a181113f046513f1ea48a8ffdf9610af7d4576ffd9d842ea93c
from sympy import (symbols, S, erf, sqrt, pi, exp, gamma, Interval, oo, beta, Eq, Piecewise, Integral, Abs, arg, Dummy, Sum, factorial) from sympy.stats import (Normal, P, E, density, Gamma, Poisson, Rayleigh, variance, Bernoulli, Beta, Uniform, cdf) from sympy.stats.compound...
593cef9f73540abce7047b5312b8acfd7cb26a093ba9f0d1ba7f22f8dfcb86fe
from sympy import ( Abs, And, binomial, Catalan, combsimp, cos, Derivative, E, Eq, exp, EulerGamma, factorial, Function, harmonic, I, Integral, KroneckerDelta, log, nan, oo, pi, Piecewise, Product, product, Rational, S, simplify, Identity, sin, sqrt, Sum, summation, Symbol, symbols, sympify, zeta, gamma...
ea2c0903d53a3046a623d2a349c13593332f77cb5aba0f298e08e9de5e9288b6
import sympy import tempfile import os from sympy import symbols, Eq, Mod from sympy.external import import_module from sympy.tensor import IndexedBase, Idx from sympy.utilities.autowrap import autowrap, ufuncify, CodeWrapError from sympy.testing.pytest import skip numpy = import_module('numpy', min_module_version='1....
4185da6c29339406ea0a1bb9f4c2f9e8cc38c628a4a0068a8d2ffa86eb521129
from sympy import (symbols, Symbol, oo, Sum, harmonic, exp, Add, S, binomial, factorial, log, fibonacci, subfactorial, sin, cos, pi, I, sqrt, Rational, gamma) from sympy.series.limitseq import limit_seq from sympy.series.limitseq import difference_delta as dd from sympy.testing.pytest import raises, XFAIL from symp...
ee1f2a3aa87631157aa4ba74708c6e3bac5ff82a0f7038e92a0b05424a74058a
from sympy import sin, cos, exp, E, series, oo, S, Derivative, O, Integral, \ Function, PoleError, log, sqrt, N, Symbol, Subs, pi, symbols, atan, LambertW, Rational from sympy.abc import x, y, n, k from sympy.testing.pytest import raises from sympy.series.gruntz import calculate_series def test_sin(): e1 = si...
38b5585b6a8587d9fd6465dfd5ea391d137bfaedc1284ffe7e9a15d62cc6398a
from itertools import product as cartes from sympy import ( limit, exp, oo, log, sqrt, Limit, sin, floor, cos, ceiling, atan, Abs, gamma, Symbol, S, pi, Integral, Rational, I, tan, cot, integrate, Sum, sign, Function, subfactorial, symbols, binomial, simplify, frac, Float, sec, zoo, fresnelc, fresnels,...
14903e7542682b28ca5522f62a8d89e8ef81555c4b8bea34558d4b961f0b8ed5
from sympy import (residue, Symbol, Function, sin, I, exp, log, pi, factorial, sqrt, Rational) from sympy.testing.pytest import XFAIL, raises from sympy.abc import x, z, a, s def test_basic1(): assert residue(1/x, x, 0) == 1 assert residue(-2/x, x, 0) == -2 assert residue(81/x, x, 0) ==...
d381b2b5cc61ea8ad71b8393df596248d6dc251e79c43b72f6470aeb114ce97b
from sympy import ( sqrt, root, Symbol, sqrtdenest, Integral, cos, Rational, I, Integer) from sympy.simplify.sqrtdenest import ( _subsets as subsets, _sqrt_numeric_denest) from sympy.testing.pytest import slow r2, r3, r5, r6, r7, r10, r15, r29 = [sqrt(x) for x in [2, 3, 5, 6, 7, 10, ...
2f37a09d16d1399dd39c54618536359e75276af6d62729a4779724be53989154
from sympy.core.symbol import symbols from sympy.printing import ccode from sympy.codegen.ast import Declaration, Variable, float64, int64, String from sympy.codegen.cnodes import ( alignof, CommaOperator, goto, Label, PreDecrement, PostDecrement, PreIncrement, PostIncrement, sizeof, union, struct ) x, y = sym...
c57c253d4b5bc688e955edf4a89c8ad178585871e8ba4df0757858ee42695a63
import os import tempfile from sympy import Symbol, symbols from sympy.codegen.ast import ( Assignment, Print, Declaration, FunctionDefinition, Return, real, FunctionCall, Variable, Element, integer ) from sympy.codegen.fnodes import ( allocatable, ArrayConstructor, isign, dsign, cmplx, kind, literal_dp, ...
d897d8fb32a8c49f4c59a4e88823d9042dd11d4232223b3904eedb4bf0041e52
from sympy.core.symbol import Symbol from sympy.codegen.ast import Type from sympy.codegen.cxxnodes import using from sympy.printing import cxxcode x = Symbol('x') def test_using(): v = Type('std::vector') u1 = using(v) assert cxxcode(u1) == 'using std::vector' u2 = using(v, 'vec') assert cxxcode...
cf24ae024b8dcdcf85286964402ea8dd208088885db31050d325be364e470c75
from sympy import log, exp, Symbol, Pow, sin, MatrixSymbol from sympy.assumptions import assuming, Q from sympy.printing import ccode from sympy.codegen.matrix_nodes import MatrixSolve from sympy.codegen.cfunctions import log2, exp2, expm1, log1p from sympy.codegen.numpy_nodes import logaddexp, logaddexp2 from sympy.co...
f7ebbb4483bfa39e597d4c14012fba664e3b5da9e9ef851bf6ba0a517381fa34
import tempfile import sympy as sp from sympy.core.compatibility import exec_ from sympy.codegen.ast import Assignment from sympy.codegen.algorithms import newtons_method, newtons_method_function from sympy.codegen.fnodes import bind_C from sympy.codegen.futils import render_as_module as f_module from sympy.codegen.pyu...
182ed3232ab5f7a85ebb6f9a7fd1273c1b24ab71e38faa52f73ff5c51c75e7ad
from itertools import product from sympy import symbols, exp, log, S from sympy.codegen.numpy_nodes import logaddexp, logaddexp2 x, y, z = symbols('x y z') def test_logaddexp(): lae_xy = logaddexp(x, y) ref_xy = log(exp(x) + exp(y)) for wrt, deriv_order in product([x, y, z], range(0, 3)): assert (...
d48fc83272d49b8a9328fc4e5952add190444cad489ecdf6f304d6d47ea1e881
# This file contains tests that exercise multiple AST nodes import tempfile from sympy.external import import_module from sympy.printing import ccode from sympy.utilities._compilation import compile_link_import_strings, has_c from sympy.utilities._compilation.util import may_xfail from sympy.testing.pytest import ski...
38a14793ebd2018bd0b3991f2f36870e92854e19fec9cd9bfac1011927c8548c
from sympy.core.add import Add from sympy.core.basic import sympify, cacheit from sympy.core.function import Function, ArgumentIndexError, PoleError, expand_mul from sympy.core.logic import fuzzy_not, fuzzy_or, FuzzyBool from sympy.core.numbers import igcdex, Rational, pi from sympy.core.relational import Ne from sympy...
6f3b3674305b96900c607614fddbf19bad917d5edf7ed3b22c909999e5c511e3
"""Hypergeometric and Meijer G-functions""" from sympy.core import S, I, pi, oo, zoo, ilcm, Mod from sympy.core.function import Function, Derivative, ArgumentIndexError from sympy.core.compatibility import reduce from sympy.core.containers import Tuple from sympy.core.mul import Mul from sympy.core.symbol import Dummy...
05f12600ae303128dc03cb00be14cd71a0c832360aebe15e449b4dd0fbfba7cb
from sympy import pi, I from sympy.core import Dummy, sympify from sympy.core.function import Function, ArgumentIndexError from sympy.core.singleton import S from sympy.functions import assoc_legendre from sympy.functions.combinatorial.factorials import factorial from sympy.functions.elementary.complexes import Abs fro...
b71cbbeb487f799cd76088f50c2196b05fc93ff592cd943424b34cfe27e46eb4
from sympy.core import Add, Mul from sympy.core.containers import Tuple from sympy.core.compatibility import iterable from sympy.core.exprtools import factor_terms from sympy.core.numbers import I from sympy.core.relational import Eq, Equality from sympy.core.symbol import Dummy, Symbol from sympy.core.function import ...
9b19be1f68e57933f1cae2e3bbc4507c4ed12223206be070a751b7ca89580baf
from sympy import (acos, acosh, asinh, atan, cos, Derivative, diff, Dummy, Eq, Ne, exp, Function, I, Integral, LambertW, log, O, pi, Rational, rootof, S, sin, sqrt, Subs, Symbol, tan, asin, sinh, Piecewise, symbols, Poly, sec, re, im, atan2, collect, hyper, integrate) from sympy.solvers.ode import (classif...
195468ab74632d66d10072548e487eb86330577e73d30cef96a01aa675f5fd1b
from sympy import (symbols, Symbol, diff, Function, Derivative, Matrix, Rational, S, I, Eq, sqrt) from sympy.core.containers import Tuple from sympy.functions import exp, cos, sin, log from sympy.matrices import dotprodsimp, NonSquareMatrixError from sympy.solvers.ode import dsolve from sympy.solvers...
6c116d3b571791747246fc0d72d3ecf5e9f4312715288339842880efb1bf7875
import glob import os import shutil import subprocess import sys import tempfile import warnings from distutils.errors import CompileError from distutils.sysconfig import get_config_var from .runners import ( CCompilerRunner, CppCompilerRunner, FortranCompilerRunner ) from .util import ( get_abspath, m...
71581b96f72c0c66f85ab13849f6db03173d498b26d75822a630a1e5abe8b734
from typing import Callable, Dict, Optional, Tuple, Union from collections import OrderedDict from distutils.errors import CompileError import os import re import subprocess from .util import ( find_binary_of_command, unique_list ) class CompilerRunner: """ CompilerRunner base class. Parameters ===...
f1a612dcda2cbc54e17a232a227f4d81d6f284d1026f55bf7ef47b01b9f3a1ae
from collections import namedtuple from hashlib import sha256 import os import shutil import sys import fnmatch from sympy.testing.pytest import XFAIL def may_xfail(func): if sys.platform.lower() == 'darwin' or os.name == 'nt': # sympy.utilities._compilation needs more testing on Windows and macOS ...
d7ebcc78107aa4c358a751cfe79c7c4a38c57a9f86b1dbc3fdc6dba3c7b05136
from itertools import product import math import inspect import mpmath from sympy.testing.pytest import raises from sympy import ( symbols, lambdify, sqrt, sin, cos, tan, pi, acos, acosh, Rational, Float, Lambda, Piecewise, exp, E, Integral, oo, I, Abs, Function, true, false, And, Or, Not, ITE, Min, Max, f...
2daef951c3e2c53b10b7a5b1da68944574ea904726604de248bd1525bb535999
from sympy.core import symbols, Eq, pi, Catalan, Lambda, Dummy from sympy.core.compatibility import StringIO from sympy import erf, Integral, Symbol from sympy import Equality from sympy.matrices import Matrix, MatrixSymbol from sympy.utilities.codegen import ( codegen, make_routine, CCodeGen, C89CodeGen, C99CodeGe...