Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc tests run #48

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Documenter
using Controlz
using Polynomials

# using Controlz before all docstrings
DocMeta.setdocmeta!(Controlz, :DocTestSetup, :(using Controlz); recursive=true)
Expand All @@ -9,6 +10,7 @@ makedocs(
modules = [Controlz],
# source = "src",
doctest = true,
warnonly = true,
sitename = "Controlz.jl",
clean = true,
pages = ["Controlz" => "index.md",
Expand Down
6 changes: 3 additions & 3 deletions docs/src/tfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ as rational functions associated with a time delay, each `TransferFunction` data
```jldoctest gdef
g.numerator
# output
Polynomials.Polynomial(1.0 + 5.0*s)
Polynomial(1.0 + 5.0*s)
```

```jldoctest gdef
g.denominator
# output
Polynomials.Polynomial(5.0 + 4.0*s + 1.0*s^2)
Polynomial(5.0 + 4.0*s + 1.0*s^2)
```

```jldoctest gdef
Expand Down Expand Up @@ -240,7 +240,7 @@ margins.ω_g # gain crossover freq. (radians / time)
margins.gain_margin # gain margin
margins.phase_margin # phase margin (radians)
# output
1.7479849408794201
1.74798494087942
```


Expand Down
2 changes: 1 addition & 1 deletion src/systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ a polynomial of type `Polynomial`
g_ol = 4 / (s + 3) / (s + 2) / (s + 1)
characteristic_polynomial(g_ol)
# output
Polynomials.Polynomial(10.0 + 11.0*s + 6.0*s^2 + 1.0*s^3)
Polynomial(10.0 + 11.0*s + 6.0*s^2 + 1.0*s^3)
```
"""
function characteristic_polynomial(g_ol::TransferFunction)
Expand Down
3 changes: 0 additions & 3 deletions src/tf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ evaluate(tf, 1.0)
# output
0.25
```

```jldoctest eval
```
"""
function evaluate(tf::TransferFunction, z::Number)
return tf.numerator(z) / tf.denominator(z) * exp(-tf.time_delay * z)
Expand Down
Loading