Skip to content

Commit 4470400

Browse files
authored
Merge pull request #304 from abhro/docs
Update documentation content and infrastructure
2 parents 89783a0 + 24c35fd commit 4470400

File tree

12 files changed

+102
-39
lines changed

12 files changed

+102
-39
lines changed

.github/workflows/BuildDocs.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ jobs:
99
- uses: actions/checkout@v5
1010
- uses: julia-actions/setup-julia@v2
1111
with:
12-
version: '1.6'
12+
version: '1'
1313
- name: Install dependencies
1414
shell: julia --project=docs/ --color=yes {0}
15-
run: |
16-
using Pkg
17-
Pkg.develop(PackageSpec(path=pwd()))
18-
Pkg.instantiate()
15+
run: using Pkg; Pkg.instantiate()
1916
- name: Build Docs
2017
run: julia --project=docs/ --color=yes docs/make.jl
2118
- name: Deploy Documentation

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ TermInterface = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c"
66

77
[compat]
88
Documenter = "1"
9+
10+
[sources]
11+
SymEngine = {path = ".."}

docs/make.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
push!(LOAD_PATH,"../src/")
2-
31
using Documenter, SymEngine
42

5-
makedocs(sitename="Symengine Julia API Docs")
3+
pages = [
4+
"index.md",
5+
"basicUsage.md",
6+
"apidocs.md",
7+
]
8+
9+
makedocs(sitename="Symengine Julia API Docs"; pages)

docs/src/basicUsage.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SymEngine.jl
1+
# Basic usage
22

33
Julia wrappers for [SymEngine](https://github.com/symengine/symengine), a fast symbolic manipulation library, written in C++.
44

@@ -344,7 +344,7 @@ If `TermInterface` is loaded (below), the `operation` method returns the outermo
344344

345345
The `Basic` type is a Julia type wrapping an underlying symengine object. When a Julia method is called on symbolic objects, the method almost always resolves to some call (via `ccall`) into the `libsymengine` C++ library. The design typically involves mutating a newly constructed `Basic` variable. Some allocations can be saved by calling the mutating version of the operations:
346346

347-
```
347+
```julia
348348
@vars x
349349
a = Basic()
350350
SymEngine.sin!(a, x)
@@ -394,8 +394,3 @@ replace_head(tan(sin(tan(x))), tan, cos)
394394
## `SymEngine.jl` and symengine
395395

396396
This package only wraps those parts of symengine that are exposed through its [C wrapper](https://github.com/symengine/symengine/blob/master/symengine/cwrapper.cpp). The underlying C++ library has more functionality.
397-
398-
399-
## License
400-
401-
`SymEngine.jl` is licensed under the MIT open source license.

docs/src/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ This site contains the documentation and `julia` language bindings for the [Syme
1010
## Installation
1111
The package and dependencies can be obtained with standard `Pkg` calls.
1212

13-
```julia
13+
```julia-repl
1414
julia> Pkg.add("SymEngine")
1515
```
16+
17+
## License
18+
19+
`SymEngine.jl` is licensed under the MIT open source license.

src/calculus.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ diff(ex::SymbolicType, bs::Tuple, ns::Tuple) =
7272
diff(b1::SymbolicType, x::Union{String,Symbol}) = diff(b1, Basic(x))
7373

7474
"""
75+
series(ex, x, x0=0, n=6)
76+
7577
Series expansion to order `n` about point `x0`
7678
"""
7779
function series(ex::SymbolicType, x::SymbolicType, x0=0, n::Union{Integer, Basic}=6)

src/dense-matrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ LinearAlgebra.factorize(M::CDenseMatrix) = factorize(convert(Matrix, M))
171171
"""
172172
LU decomposition for CDenseMatrix, dense matrices of symbolic values
173173
174-
Also: lufact(a, val{:false}) for non-pivoting lu factorization
174+
Also: `lufact(a, Val{:false})` for non-pivoting lu factorization
175175
"""
176176
function LinearAlgebra.lu(a::CDenseMatrix)
177177
l, u = dense_matrix_LU(a)

src/mathfuns.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ for (meth, libnm) in [(:nextprime,:nextprime)
159159
eval(Expr(:export, meth))
160160
end
161161

162-
"Return coefficient of `x^n` term, `x` a symbol"
162+
"""
163+
coeff!(a, b, x, n)
164+
165+
Return coefficient of `x^n` term, `x` a symbol
166+
"""
163167
function coeff!(a::Basic, b::Basic, x, n)
164168
out = ccall((:basic_coeff, libsymengine), Nothing,
165169
(Ref{Basic},Ref{Basic},Ref{Basic},Ref{Basic}),

src/numerics.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ end
5555
##################################################
5656
# N
5757
"""
58+
N(a)
59+
N(Val(:Type), b::Basic)
5860
5961
Convert a SymEngine numeric value into a Julian number
6062

src/subs.jl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11

22

33
"""
4-
subs
4+
subs(ex, var, val)
5+
subs(ex, d::AbstractDict)
6+
subs(ex, y::Tuple)
7+
subs(ex)
58
69
Substitute values into a symbolic expression.
710
8-
Examples
9-
```
11+
### Examples
12+
13+
```julia
1014
@vars x y
1115
ex = x^2 + y^2
1216
subs(ex, x, 1) # 1 + y^2
@@ -126,8 +130,9 @@ end
126130
walk_expression(b) = convert(Expr, b)
127131

128132
"""
129-
lambdify
130-
evaluates a symbolless expression or returns a function
133+
lambdify(ex, vars=[]; cse=false)
134+
135+
Evaluates a symbol-less expression or returns a function
131136
"""
132137
function lambdify(ex, vars=[])
133138
if length(vars) == 0
@@ -170,7 +175,7 @@ end
170175
function _lambdify(ex::Expr, vars)
171176
try
172177
fn = eval(Expr(:function,
173-
Expr(:call, gensym(), map(Symbol,vars)...),
178+
Expr(:call, gensym(), map(Symbol,vars)...),
174179
ex))
175180
(args...) -> invokelatest(fn, args...) # https://github.com/JuliaLang/julia/pull/19784
176181
catch err

0 commit comments

Comments
 (0)