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

Docs update to strict docs build #164

Merged
merged 4 commits into from
Oct 28, 2023
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
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FinanceCore = "b9b1ffdd-6612-4b69-8227-7663be06e089"
FinanceModels = "77f2ae65-bdde-421f-ae9d-22f1af19dd76"
4 changes: 4 additions & 0 deletions docs/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FinanceCore = "b9b1ffdd-6612-4b69-8227-7663be06e089"
FinanceModels = "77f2ae65-bdde-421f-ae9d-22f1af19dd76"
27 changes: 20 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ using FinanceModels
using Documenter

makedocs(;
modules=[FinanceModels],
modules=[FinanceModels, FinanceCore],
authors="Alec Loudenback <[email protected]> and contributors",
repo="https://github.com/JuliaActuary/FinanceModels.jl/blob/{commit}{path}#L{line}",
repo=Remotes.GitHub("JuliaActuary", "FinanceModels.jl"),
sitename="FinanceModels.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
Expand All @@ -13,11 +13,24 @@ makedocs(;
),
pages=[
"Home" => "index.md",
"Guide" => "guide.md",
"Contracts" => "contracts.md",
"Models, Valuation, and Fitting" => "models.md",
"API Reference" => "api.md",
"Migration Guide" => "migration.md",
"Guide" => [
"Introduction" => "introduction.md",
"Models, Valuation, and Fitting" => "models.md",
"Contracts" => "contracts.md",
"Rates" => "Rates.md",
"Migration Guide" => "migration.md",
],
"Modules" => [
"FinanceModels" => "API/FinanceModels.md",
"FinanceCore" => "API/FinanceCore.md",
"Spline" => "API/Spline.md",
"Fit" => "API/Fit.md",
"Yield" => "API/Yield.md",
"Bond" => "API/Bond.md",
"Equity" => "API/Equity.md",
"Option" => "API/Option.md",
"Volatility" => "API/Volatility.md",
],
"FAQs" => "faq.md",
]
)
Expand Down
19 changes: 19 additions & 0 deletions docs/src/API/Bond.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Bond API Reference

```@index
Modules = [FinanceModels.Bond]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Bond]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Bond]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/Equity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Equity API Reference

```@index
Modules = [FinanceModels.Equity]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Equity]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Equity]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/FinanceCore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceCore API Reference

```@index
Modules = [FinanceCore]
```

## Exported API
```@autodocs
Modules = [FinanceCore]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceCore]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/FinanceModels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels API Reference

```@index
Modules = [FinanceModels]
```

## Exported API
```@autodocs
Modules = [FinanceModels]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/Fit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Fit API Reference

```@index
Modules = [FinanceModels.Fit]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Fit]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Fit]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/Option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Option API Reference

```@index
Modules = [FinanceModels.Option]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Option]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Option]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/Spline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Spline API Reference

```@index
Modules = [FinanceModels.Spline]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Spline]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Spline]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/Volatility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Volatility API Reference

```@index
Modules = [FinanceModels.Volatility]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Volatility]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Volatility]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
19 changes: 19 additions & 0 deletions docs/src/API/Yield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# FinanceModels.Yield API Reference

```@index
Modules = [FinanceModels.Yield]
```

## Exported API
```@autodocs
Modules = [FinanceModels.Yield]
Private = false
```

## Unexported API
```@autodocs
Modules = [FinanceModels.Yield]
Public = false
```

Please [open an issue](https://github.com/JuliaActuary/FinanceModels.jl/issues) if you encounter any issues or confusion with the package.
62 changes: 62 additions & 0 deletions docs/src/Rates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Rates

We should first discuss `Rate`s, which are reexported from [`FinanceCore.jl`](https://github.com/JuliaActuary/FinanceCore.jl)

Rates are types that wrap scalar values to provide information about how to determine `discount` and `accumulation` factors. These allow for explicit handling of rate compounding conventions which, if not explicit, is often a source of errors in practice.

There are two `Frequency` types:

- `Yields.Periodic(m)` for rates that compound `m` times per period (e.g. `m` times per year if working with annual rates).
- `Yields.Continuous()` for continuously compounding rates.

#### Examples

```julia
Continuous(0.05) # 5% continuously compounded
Periodic(0.05,2) # 5% compounded twice per period
```

These are both subtypes of the parent `Rate` type and are instantiated as:

```julia
Rate(0.05,Continuous()) # 5% continuously compounded
Rate(0.05,Periodic(2)) # 5% compounded twice per period
```

Broadcast over a vector to create `Rates` with the given compounding:

```julia
Periodic.([0.02,0.03,0.04],2)
Continuous.([0.02,0.03,0.04])
```

Rates can also be constructed by specifying the `CompoundingFrequency` and then passing a scalar rate:

```julia
Periodic(1)(0.05)
Continuous()(0.05)
```

#### Conversion

Convert rates between different types with `convert`. E.g.:

```julia
r = Rate(0.01,Periodic(12)) # rate that compounds 12 times per rate period (ie monthly)

convert(Yields.Periodic(1),r) # convert monthly rate to annual effective
convert(Yields.Continuous(),r) # convert monthly rate to continuous
```

To get the scalar value out of the `Rate`, use `FinanceModels.rate(r)`:

```julia-rel
julia> r = Rate(0.01,Periodic(12));
julia> rate(r)
0.01

```

#### Arithmetic

Adding, subtracting, multiplying, dividing, and comparing rates is supported.
43 changes: 0 additions & 43 deletions docs/src/api.md

This file was deleted.

32 changes: 3 additions & 29 deletions docs/src/contracts.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Contracts

## Page Contents

```@contents
Pages = ["contracts.md"]
Depth = 4
```


## **Contracts** - A composable way to represent financial instruments

Contracts are a composable way to represent financial instruments. They are, in essence, anything that is a collection of cashflows. Contracts can be combined to represent more complex instruments. For example, a bond can be represented as a collection of cashflows that correspond to the coupon payments and the principal repayment.
Expand Down Expand Up @@ -96,26 +88,8 @@ Note that all contracts in FinanceModels.jl are currently *unit* contracts in th

#### More complex Contracts

**When the cashflow depends on a model**. An example of this is a floating bond where the coupon paid depends on a view of forward rates. See [this section in the overview](guide.html#Contracts-that-depend-on-the-model-(or-multiple-models)) on projections for how this is handled.

## Availalbe Contracts & Modules

### `Bond` Module
**When the cashflow depends on a model**. An example of this is a floating bond where the coupon paid depends on a view of forward rates. See [this section in the overview](@ref Contracts-that-depend-on-the-model-(or-multiple-models)) on projections for how this is handled.

```@autodocs
Modules = [FinanceModels.Bond]
```

### Other Contracts

```@docs
Composite
CommonEquity
Forward
```

### Derivatives
## Available Contracts & Modules

```@autodocs
Modules = [FinanceModels.Option]
```
See the Modules in the left navigation for details on available contracts/models/functions.
4 changes: 2 additions & 2 deletions docs/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Transducers are a [rich and powerful way to express programs](https://www.youtub
- To regular end-users who just use what is given to them here, the transducers internals are effectively completely hidden
- To moderately advanced users who want to extend the functionality, as the examples show the only real exposure here is a weird function name ( `__foldl__`) with for loop with a `return` signature that has some extra information.

A number of examples of extending the package are given on the [Guide](./guide.html) page and the of course the source code itself offers examples of existing `Projection`s and `Contract`s.
A number of examples of extending the package are given on the [FinanceModels.jl Guide](@ref) page and the of course the source code itself offers examples of existing `Projection`s and `Contract`s.


## I have another question

Ask on the discussion forum here: https://github.com/JuliaActuary/Yields.jl/discussions
Ask on the discussion forum here: [https://github.com/JuliaActuary/FinanceModels.jl/discussions](https://github.com/JuliaActuary/FinanceModels.jl/discussions)

Loading
Loading