Skip to content

Commit

Permalink
added readme, docs template, license, and github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobAsslaender committed Mar 24, 2022
1 parent 837e46f commit 7055169
Show file tree
Hide file tree
Showing 14 changed files with 295 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
continue-on-error: ${{ matrix.version == 'nightly' }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1.6'
arch: x64
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using MRFingerprintingRecon
DocMeta.setdocmeta!(MRFingerprintingRecon, :DocTestSetup, :(using MRFingerprintingRecon); recursive=true)
# doctest(MRFingerprintingRecon)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
15 changes: 15 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
*.out
.vscode/
docs/build
docs/src/build*
docs/Manifest.toml
/Manifest.toml
.vscode
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Jakob Asslaender <jakob.asslaender@nyumc.org> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# MRFingerprintingRecon.jl


| **Documentation** | **Paper** | **Build Status** |
|:------------------------- |:--------------------------- |:------------------------------------- |
| [![][docs-img]][docs-url] | [![][paper-img]][paper-url] | [![][gh-actions-img]][gh-actions-url] |
| | [![][arXiv-img]][arXiv-url] | [![][codecov-img]][codecov-url] |


MRFingerprintingRecon.jl is a Julia package that implements--so far--the *low rank inversion* reconstruction described in the paper [Low rank alternating direction method of multipliers reconstruction for MR fingerprinting](https://doi.org/10.1002/mrm.26639). This package is still work in progress and the interface will likely change over time. The ultimate goal of this package is to reproduce the [Matlab code](https://bitbucket.org/asslaender/nyu_mrf_recon) of the ADMM algorithm to Julia.


[docs-img]: https://img.shields.io/badge/docs-latest%20release-blue.svg
[docs-url]: https://JakobAsslaender.github.io/MRFingerprintingRecon.jl/stable

[gh-actions-img]: https://github.com/JakobAsslaender/MRFingerprintingRecon.jl/workflows/CI/badge.svg
[gh-actions-url]: https://github.com/JakobAsslaender/MRFingerprintingRecon.jl/actions

[codecov-img]: https://codecov.io/gh/JakobAsslaender/MRFingerprintingRecon.jl/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/JakobAsslaender/MRFingerprintingRecon.jl

[arXiv-img]: https://img.shields.io/badge/arXiv-2107.11000-blue.svg
[arXiv-url]: https://arxiv.org/pdf/1608.06974.pdf

[paper-img]: https://img.shields.io/badge/doi-10.1002/mrm.29071-blue.svg
[paper-url]: https://doi.org/10.1002/mrm.26639
12 changes: 12 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MRFingerprintingRecon = "f4798e02-a7e0-47f5-a571-12dd775704d3"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29"
75 changes: 75 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using Pkg
Pkg.activate("docs")
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()

using MRFingerprintingRecon
using Documenter
using Literate
using Plots # to not capture precompilation output

# HTML Plotting Functionality
struct HTMLPlot
p # :: Plots.Plot
end
const ROOT_DIR = joinpath(@__DIR__, "build")
const PLOT_DIR = joinpath(ROOT_DIR, "plots")
function Base.show(io::IO, ::MIME"text/html", p::HTMLPlot)
mkpath(PLOT_DIR)
path = joinpath(PLOT_DIR, string(UInt32(floor(rand()*1e9)), ".html"))
Plots.savefig(p.p, path)
if get(ENV, "CI", "false") == "true" # for prettyurl
print(io, "<object type=\"text/html\" data=\"../../$(relpath(path, ROOT_DIR))\" style=\"width:100%;height:425px;\"></object>")
else
print(io, "<object type=\"text/html\" data=\"../$(relpath(path, ROOT_DIR))\" style=\"width:100%;height:425px;\"></object>")
end
end

# Notebook hack to display inline math correctly
function notebook_filter(str)
re = r"(?<!`)``(?!`)" # Two backquotes not preceded by nor followed by another
return replace(str, re => "\$")
end

# Literate
OUTPUT = joinpath(@__DIR__, "src/build_literate")

files = [
"tutorial.jl",
]

for file in files
file_path = joinpath(@__DIR__, "src/", file)
Literate.markdown(file_path, OUTPUT)
Literate.notebook(file_path, OUTPUT, preprocess=notebook_filter; execute=false)
Literate.script( file_path, OUTPUT)
end

DocMeta.setdocmeta!(MRFingerprintingRecon, :DocTestSetup, :(using MRFingerprintingRecon); recursive=true)

makedocs(;
doctest = false,
modules=[MRFingerprintingRecon],
authors="Jakob Asslaender <jakob.asslaender@nyumc.org> and contributors",
repo="https://github.com/JakobAsslaender/MRFingerprintingRecon.jl/blob/{commit}{path}#{line}",
sitename="MRFingerprintingRecon.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://JakobAsslaender.github.io/MRFingerprintingRecon.jl",
assets=String[],
),
pages=[
"Home" => "index.md",
"Quick Start Tutorial" => Any[
"build_literate/tutorial.md",
],
"API" => "api.md",
],
)

# Set dark theme as default independent of the OS's settings
run(`sed -i'.old' 's/var darkPreference = false/var darkPreference = true/g' docs/build/assets/themeswap.js`)

deploydocs(;
repo="github.com/JakobAsslaender/MRFingerprintingRecon.jl",
)
15 changes: 15 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```@meta
Author = "Jakob Assländer"
CurrentModule = MRFingerprintingRecon
```

# API

In the following, you find the documentation of all exported functions of the [MRFingerprintingRecon.jl](https://github.com/JakobAsslaender/MRFingerprintingRecon.jl) package:

```@index
```

```@autodocs
Modules = [MRFingerprintingRecon]
```
10 changes: 10 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = MRFingerprintingRecon
```

# MRFingerprintingRecon.jl

Documentation for the [MRFingerprintingRecon.jl](https://github.com/JakobAsslaender/MRFingerprintingRecon.jl) package. Stay tuned for the documentation...


The documentation of all exported functions can be found in the [API](@ref) Section.
11 changes: 11 additions & 0 deletions docs/src/tutorial.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#md # [![](https://mybinder.org/badge_logo.svg)](@__BINDER_ROOT_URL__/build_literate/tutorial.ipynb)

# # Tutorial

# TODO

# For this example, we need the following packages:
using MRFingerprintingRecon
using Plots
plotlyjs(bg = RGBA(31/255,36/255,36/255,1.0), ticks=:native); #hide #!nb

4 changes: 4 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6 changes: 6 additions & 0 deletions test/cmaps.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using BenchmarkTools
using MRFingerprintingRecon
using Test

# TODO
@test 1 == 1
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using MRFingerprintingRecon
using Test

@testset "Greens_Interpolation" begin
include("cmaps.jl")
end

0 comments on commit 7055169

Please sign in to comment.