Skip to content

Commit

Permalink
Documenter.jl v1
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichelenstrofer committed Nov 29, 2023
1 parent 0b568e3 commit 7f4302c
Show file tree
Hide file tree
Showing 8 changed files with 2,309 additions and 22 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ UnitfulEquivalences = "da9c4bc3-91c8-4f02-8a40-6b990d2a7e0c"

[compat]
Unitful = "1.10"
UnitfulAngles = "0.7"
UnitfulEquivalences = "0.2"
julia = "1.7"
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulAngles = "6fb2a4bd-7999-5318-a3b2-8ad61056cd98"

[compat]
Documenter = "0.27.23"
DocumenterCitations = "0.2.12"
Documenter = "1.2"
DocumenterCitations = "1.3"
Unitful = "1.10"
UnitfulAngles = "0.7"
34 changes: 21 additions & 13 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
push!(LOAD_PATH,"../src/")

using Documenter
using DocumenterCitations
using DimensionfulAngles
Expand All @@ -19,17 +21,23 @@ function _filter_prefixed(base, x; exceptions = [nothing])
return false
end

makedocs(bib;
sitename = "DimensionfulAngles",
format = Documenter.HTML(),
modules = [DimensionfulAngles],
pages = ["Home" => "index.md",
"Angle as a dimension?" => "motivation.md",
"Package Guide" => ["guide/intro.md",
"guide/units.md",
"guide/derived.md",
"guide/base.md"],
"Relationship to proposed SI extensions." => "proposed.md",
"Index" => "syntax.md"])
makedocs(;
sitename = "DimensionfulAngles",
format = Documenter.HTML(
assets=String["assets/citations.css",],
),
modules = [DimensionfulAngles],
pages = [
"Home" => "index.md",
"Angle as a dimension?" => "motivation.md",
"Package Guide" => ["guide/intro.md",
"guide/units.md",
"guide/derived.md",
"guide/base.md"],
"Relationship to proposed SI extensions." => "proposed.md",
"Index" => "syntax.md",
],
plugins = [bib,],
)

deploydocs(; repo = "github.com/cmichelenstrofer/DimensionfulAngles.jl.git")
# deploydocs(; repo = "github.com/cmichelenstrofer/DimensionfulAngles.jl.git")
2,213 changes: 2,213 additions & 0 deletions docs/src/assets/Commutative_diagram_of_harmonic_wave_properties.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/src/assets/citations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.citation dl {
display: grid;
grid-template-columns: max-content auto; }
.citation dt {
grid-column-start: 1; }
.citation dd {
grid-column-start: 2;
margin-bottom: 0.75em; }
.citation ul {
padding: 0 0 2.25em 0;
margin: 0;
list-style: none;}
.citation ul li {
text-indent: -2.25em;
margin: 0.33em 0.5em 0.5em 2.25em;}
.citation ol li {
padding-left:0.75em;}

39 changes: 37 additions & 2 deletions docs/src/guide/derived.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ These are:

- [`DimensionfulAngles.SolidAngle`](@ref)
- [`DimensionfulAngles.AngularVelocity`](@ref)
- [`DimensionfulAngles.AngularAcceleration`](@ref).
- [`DimensionfulAngles.AngularAcceleration`](@ref)
- [`DimensionfulAngles.AngularWavelength`](@ref)
- [`DimensionfulAngles.AngularPeriod`](@ref)
- [`DimensionfulAngles.AngularWavenumber`](@ref)

This allows, among other things, dispatching on these derived dimensions.

Expand Down Expand Up @@ -56,12 +59,38 @@ These are [related by](https://en.wikipedia.org/wiki/Angular_frequency)

``f = 1/T = ω/2π``.

*DimensionfulAngles.jl* provides [`Periodic`](@ref) a [UnitfulEquivalences.jl](https://sostock.github.io/UnitfulEquivalences.jl/stable/) `Equivalence` to convert between period, frequency, and angular frequency of a periodic response.
Analogously, spatial period and frequency are [related by](https://en.wikipedia.org/wiki/Spatial_frequency)

``ν = 1/λ = k/2π``

between wavelength `λ` (`𝐋`, `m`), wavenumber `ν` (`1/𝐋`, `1/m`), and angular wavenumber `k` (`𝐀/𝐋`, `rad/m`).
Additionally an angular period and wavelength can be defined analogously as the period or wavelength divided by ````.

![Diagram showing graphically the relationships between the various properties of harmonic waves: frequency, period, wavelength, angular frequency, and wavenumber.](../assets/Commutative_diagram_of_harmonic_wave_properties.svg)
*image-source: Waldir, CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons*

*DimensionfulAngles.jl* provides [`Periodic`](@ref) a [UnitfulEquivalences.jl](https://sostock.github.io/UnitfulEquivalences.jl/stable/) `Equivalence` to convert between temporal or spatial period, frequency, angular frequency, and angular period of a periodic response.


```@docs
DimensionfulAngles.Periodic
```

## Angular period, wavenumber, and wavelength
Based on the definitions above the following additional derived dimensions are defined:

- Angular period (`𝐓/𝐀`, `s/rad`)
- Angular wavelength (`𝐋/𝐀`, `m/rad`)
- Angular wavenumber (`𝐀/𝐋`, `rad/m`)

No specific units are added for these dimensions.

```@docs
DimensionfulAngles.AngularWavelength
DimensionfulAngles.AngularPeriod
DimensionfulAngles.AngularWavenumber
```

## [Syntax](@id derived_syntax)

Contents:
Expand All @@ -80,6 +109,12 @@ DimensionfulAngles.AngularAccelerationUnits
DimensionfulAngles.AngularAccelerationFreeUnits
DimensionfulAngles.SolidAngleUnits
DimensionfulAngles.SolidAngleFreeUnits
DimensionfulAngles.AngularWavenumberUnits
DimensionfulAngles.AngularWavenumberFreeUnits
DimensionfulAngles.AngularPeriodUnits
DimensionfulAngles.AngularPeriodFreeUnits
DimensionfulAngles.AngularWavelengthUnits
DimensionfulAngles.AngularWavelengthFreeUnits
```

### [Prefixed Units](@id derived_prefixed)
Expand Down
4 changes: 4 additions & 0 deletions docs/src/guide/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ julia> dimension(ω̄)
𝐓⁻¹
```

```@docs
Unitful.uconvert(::Symbol, ::Quantity)
```

## [Syntax](@id intro_syntax)

Contents:
Expand Down
18 changes: 13 additions & 5 deletions src/derived.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,21 @@ See also [`DimensionfulAngles.radᵃ`](@ref).
"""
Periodic()
Equivalence to convert between period, frequency, and
Equivalence to convert between temporal or spatial period, frequency, and
[angular frequency](https://en.wikipedia.org/wiki/Angular_frequency)
according to the relation ``f = ω/2π = 1/T``, where
according to the relations ``f = ω/2π = 1/T``, where
- ``f`` is the frequency,
- ``ω`` is the angular speed and
- ``T`` is the period.
- ``f`` is the (temporal) frequency,
- ``ω`` is the (temporal) angular frequency,
- ``T`` is the (temporal) period,
- ``T̄`` is the (temporal) angular period,
and ``ν = k/2π = 1/λ = 1/(2πλ̄)``, where
- ``ν`` is the (spatial) frequency (linear wavenumber),
- ``k`` is the (spatial) angular frequency (angular wavenumber),
- ``λ`` is the (spatial) period (linear wavelength), and
- ``λ̄`` is the (spatial) angular period (angular wavelength).
# Example
Expand Down

0 comments on commit 7f4302c

Please sign in to comment.