Skip to content

Commit

Permalink
balance between divrem, div, rem, and StepRange (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
jverzani committed Jun 15, 2021
1 parent e7896cc commit 6bee495
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "SymPy"
uuid = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
version = "1.0.47"
version = "1.0.48"


[deps]
Expand Down
3 changes: 3 additions & 0 deletions src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ Base.angle(z::SymPy.SymbolicObject) = atan(sympy.im(z), sympy.re(z))


# sympy.div for poly division
Base.divrem(x::Sym, y) = sympy.div(x, y)
# needed for #390; but odd
Base.div(x::Sym, y::Union{Sym,Number}) = convert(Sym, sympy.floor(x/convert(Sym,y)))
Base.rem(x::Sym, y::Union{Sym,Number}) = x-Sym(y)*Sym(sympy.floor.(x/y))


Base.denominator(x::SymbolicObject) = denom(x)
Base.numerator(x::SymbolicObject) = numer(x)
2 changes: 1 addition & 1 deletion src/importexport.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ expjpi(ex::SymbolicObject, args...; kwargs...)=getproperty(mpmath, :expjpi)(ex,
ellipk(ex::SymbolicObject, args...; kwargs...)=getproperty(mpmath, :ellipk)(ex, Sym.(args)...; kwargs...); export ellipk
e1(ex::SymbolicObject, args...; kwargs...)=getproperty(mpmath, :e1)(ex, Sym.(args)...; kwargs...); export e1
SpecialFunctions.digamma(ex::SymbolicObject, args...; kwargs...)=getproperty(sympy, :digamma)(ex, Sym.(args)...; kwargs...)
Base.rem(ex::SymbolicObject, args...; kwargs...)=getproperty(sympy, :rem)(ex, Sym.(args)...; kwargs...)
#Base.rem(ex::SymbolicObject, args...; kwargs...)=getproperty(sympy, :rem)(ex, Sym.(args)...; kwargs...)
Base.asin(ex::SymbolicObject, args...; kwargs...)=getproperty(sympy, :asin)(ex, Sym.(args)...; kwargs...)
Base.acosh(ex::SymbolicObject, args...; kwargs...)=getproperty(sympy, :acosh)(ex, Sym.(args)...; kwargs...)
Base.im(ex::SymbolicObject, args...; kwargs...)=getproperty(sympy, :im)(ex, Sym.(args)...; kwargs...)
Expand Down
18 changes: 9 additions & 9 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ julia> x = sympy.IndexedBase("x")
x
julia> a = sympy.Sum(x[i], (i, 1, j))
j
___
j
___
╱ x[i]
‾‾‾
i = 1
‾‾‾
i = 1
```
"""
Expand Down Expand Up @@ -146,7 +146,7 @@ simplify(x,args...;kwargs...) = x
##################################################
# avoid type piracy. After we call `pytype` mappings, some
# objects are automatically converted and no longer PyObjects
function pycall_hasproperty(x::PyCall.PyObject, k)
function pycall_hasproperty(x::PyCall.PyObject, k)
PyCall.hasproperty(x, k) && (getproperty(x,k) != nothing)
end

Expand Down Expand Up @@ -214,7 +214,7 @@ const base_Ms = (Base, SpecialFunctions, Base.MathConstants,
#
const base_exclude=("C", "lambdify",
"latex", "eye", "sympify","symbols", "subs",
"div", "log", "sinc",
"div", "rem", "log", "sinc",
"dsolve",
"ask",
"plot")
Expand Down

2 comments on commit 6bee495

@jverzani
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/38913

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.48 -m "<description of version>" 6bee495f065b9a01fd6202fe020d29578c8f788d
git push origin v1.0.48

Please sign in to comment.