-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set up docs structure * write up home page * update docstrings from readme and clean up readme * update travis for GH pages * fix broken doc tests
- Loading branch information
1 parent
f54596d
commit 6872ec8
Showing
8 changed files
with
326 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
# Created by https://www.gitignore.io/api/julia | ||
# Edit at https://www.gitignore.io/?templates=julia | ||
|
||
### Julia ### | ||
# Files generated by invoking Julia with --code-coverage | ||
*.jl.cov | ||
*.jl.*.cov | ||
|
||
# Files generated by invoking Julia with --track-allocation | ||
*.jl.mem | ||
|
||
# System-specific files and directories generated by the BinaryProvider and BinDeps packages | ||
# They contain absolute paths specific to the host computer, and so should not be committed | ||
deps/deps.jl | ||
deps/build.log | ||
deps/downloads/ | ||
deps/usr/ | ||
deps/src/ | ||
|
||
# Build artifacts for creating documentation generated by the Documenter package | ||
docs/build/ | ||
docs/site/ | ||
|
||
# File generated by Pkg, the package manager, based on a corresponding Project.toml | ||
# It records a fixed state of all packages used by the project. As such, it should not be | ||
# committed for packages, but should be committed for applications that require a static | ||
# environment. | ||
Manifest.toml | ||
|
||
# End of https://www.gitignore.io/api/julia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" | ||
UnitfulAstro = "6112ee07-acf9-5e0f-b108-d242c714bf9f" | ||
|
||
[compat] | ||
Documenter = "0.24" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Documenter | ||
using Cosmology | ||
|
||
|
||
DocMeta.setdocmeta!(Cosmology, :DocTestSetup, :(using Cosmology); recursive = true) | ||
|
||
|
||
makedocs(; | ||
modules = [Cosmology], | ||
authors = "Julia Astro", | ||
repo = "https://github.com/JuliaAstro/Cosmology.jl/blob/{commit}{path}#L{line}", | ||
sitename = "Cosmology.jl", | ||
format = Documenter.HTML(; | ||
prettyurls = get(ENV, "CI", "false") == "true", | ||
canonical = "https://juliaastro.github.io/Cosmology.jl", | ||
assets = String[],), | ||
pages = [ | ||
"Home" => "index.md", | ||
"API/Reference" => "api.md" | ||
],) | ||
|
||
deploydocs(; | ||
repo = "github.com/JuliaAstro/Cosmology.jl",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
```@meta | ||
DocTestSetup = :(using Cosmology, Unitful, UnitfulAstro) | ||
``` | ||
|
||
# API/Reference | ||
|
||
## Cosmological Models | ||
|
||
```@docs | ||
cosmology | ||
``` | ||
|
||
## Distances | ||
|
||
```@docs | ||
angular_diameter_dist | ||
comoving_radial_dist | ||
luminosity_dist | ||
distmod | ||
``` | ||
|
||
### Examples | ||
|
||
```jldoctest | ||
julia> c = cosmology(OmegaM=0.26) | ||
Cosmology.FlatLCDM{Float64}(0.69, 0.7399122024007928, 0.26, 8.77975992071536e-5) | ||
julia> angular_diameter_dist(c, 1.2) | ||
1784.0089227105113 Mpc | ||
julia> angular_diameter_dist(c, 0.7, 1.2) | ||
606.6521737365097 Mpc | ||
julia> luminosity_dist(c, 1.5) | ||
11420.338287150073 Mpc | ||
julia> luminosity_dist(u"Gpc", c, 1.5) # Can convert to appropriate unit | ||
11.420338287150074 Gpc | ||
``` | ||
|
||
|
||
## Volumes | ||
|
||
```@docs | ||
comoving_volume_element | ||
comoving_volume | ||
``` | ||
|
||
### Examples | ||
|
||
```jldoctest | ||
julia> c = cosmology(OmegaM=0.26) | ||
Cosmology.FlatLCDM{Float64}(0.69, 0.7399122024007928, 0.26, 8.77975992071536e-5) | ||
julia> comoving_volume_element(c, 2.1) | ||
46.74459228888612 Gpc^3 | ||
julia> comoving_volume(c, 0.6) | ||
49.3633436631307 Gpc^3 | ||
julia> comoving_volume(u"ly^3", c, 0.6) | ||
1.7127035381753e30 ly^3 | ||
``` | ||
|
||
## Times | ||
|
||
```@docs | ||
age | ||
lookback_time | ||
``` | ||
|
||
### Examples | ||
```jldoctest | ||
julia> c = cosmology(OmegaM=0.26) | ||
Cosmology.FlatLCDM{Float64}(0.69, 0.7399122024007928, 0.26, 8.77975992071536e-5) | ||
julia> age(c, 1.2) | ||
5.445600787626434 Gyr | ||
julia> lookback_time(u"yr", c, 1.2) | ||
8.761660748088268e9 yr | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Cosmology.jl | ||
|
||
[](https://travis-ci.org/JuliaAstro/Cosmology.jl) | ||
[](https://coveralls.io/r/JuliaAstro/Cosmology.jl?branch=master) | ||
|
||
`Cosmology.jl` provides functions for quick cosmological calculations, written in pure Julia. | ||
|
||
## Installation | ||
|
||
To install the package, enter `pkg` mode (`]`) | ||
|
||
```julia-repl | ||
pkg> add Cosmology | ||
``` | ||
|
||
Then, to load the package | ||
|
||
```julia-repl | ||
julia> using Cosmology | ||
``` | ||
|
||
## Contributing | ||
|
||
If you would like to contribute to `Cosmology.jl`, head over to our [GitHub page](https://github.com/juliaastro/cosmology.jl) and open an issue or pull request! | ||
|
||
For any new features, we ask the contributors to add any relevant unit tests and bump the package version by one minor version. |
Oops, something went wrong.