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

Concrete types, towards GPU support #26

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
49 changes: 0 additions & 49 deletions .github/workflows/CI.yml

This file was deleted.

29 changes: 21 additions & 8 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CompatHelper

on:
schedule:
- cron: 0 0 * * 0 # weekly
Expand All @@ -8,13 +9,25 @@ jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} # need ssh
run: julia -e 'using CompatHelper; CompatHelper.main()'

# based on:
# https://github.com/JuliaRegistries/CompatHelper.jl
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
18 changes: 11 additions & 7 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Documentation

on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
branches:
- 'main'
- 'release-'
Expand All @@ -15,8 +19,8 @@ jobs:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.6'
- name: Cache artifacts
version: '1'
- name: CacheArtifacts
uses: actions/cache@v1
env:
cache-name: cache-artifacts
Expand All @@ -27,13 +31,13 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install dependencies
- name: InstallDependencies
run: |
julia --project=docs/ -e '
ENV["JULIA_PKG_SERVER"] = ""
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
ENV["JULIA_PKG_SERVER"] = ""
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: BuildAndDeploy
env:
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#Authentication:-GITHUB_TOKEN
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
create:
tags:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
workflow_dispatch:

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version: ['1.6', '1', 'nightly']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
# - name: "Set up Julia"
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
# - name: "Unit Test"
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
# - name: "Cover"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
if: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
with:
file: lcov.info
28 changes: 28 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#gh-pages-Branch

name: DocPreviewCleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ deps/src/
# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/
docs/src/generated/

# 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
Expand Down
Binary file added data/trained-cnn-example-6-dl.bson
Binary file not shown.
15 changes: 7 additions & 8 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
ImagePhantoms = "71a99df6-f52c-4da1-bd2a-69d6f37f3252"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearMapsAA = "599c1a8e-b958-11e9-0d14-b1e6b2ecea07"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MIRTjim = "170b2178-6dee-4cb0-8729-b3e8b57834cc"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SPECTrecon = "ab1be465-a7f0-4423-9048-0ee774b70ed9"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulRecipes = "42071c24-d89e-48dd-8a24-8a12d9b8861f"

[compat]
Distributions = "0.25"
Documenter = "0.27.7"
ImagePhantoms = "0.0.5"
LinearMapsAA = "0.7"
Literate = "2.9.3"
MIRTjim = "0.13"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
13 changes: 13 additions & 0 deletions docs/lit/examples/1-overview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using LinearAlgebra: mul!
using LinearMapsAA: LinearMapAA
using Plots: scatter, plot!, default; default(markerstrokecolor=:auto)
using Plots # @animate, gif
using InteractiveUtils: versioninfo

# The following line is helpful when running this example.jl file as a script;
# this way it will prompt user to hit a key after each figure is displayed.
Expand Down Expand Up @@ -216,3 +217,15 @@ anim = @animate for i in 1:nview
)
end
gif(anim, "views.gif", fps = 8)


# ### Reproducibility

# This page was generated with the following version of Julia:

io = IOBuffer(); versioninfo(io); split(String(take!(io)), '\n')


# And with the following package versions

import Pkg; Pkg.status()
4 changes: 2 additions & 2 deletions docs/lit/examples/3-psf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jim(image, "Original image")

px = 11
nview = 1 # for simplicity in this illustration
psf = repeat(psf_gauss( ; ny, px), 1, 1, 1, nview)
psf = repeat(psf_gauss( ; ny=nx, px), 1, 1, 1, nview)
jim(psf, "PSF for each of $nx planes")


Expand Down Expand Up @@ -111,7 +111,7 @@ jim(adj, "Adjoint of PSF modeling")
using LinearMapsAA: LinearMapAA

nx, nz, px = 10, 7, 5 # small size for illustration
psf3 = psf_gauss( ; ny, px)
psf3 = psf_gauss( ; ny=nx, px)
plan = plan_psf( ; nx, nz, px, T)
idim = (nx,nx,nz)
odim = (nx,nx,nz)
Expand Down
4 changes: 2 additions & 2 deletions docs/lit/examples/4-mlem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function mlem(x0, ynoisy, background, A; niter::Int = 20)
all(>(0), background) || throw("need background > 0")
x = copy(x0)
asum = A' * ones(eltype(ynoisy), size(ynoisy))
time0 = time()
time0 = time()
for iter = 1:niter
@show iter, extrema(x), time() - time0
ybar = A * x .+ background # forward model
Expand All @@ -119,7 +119,7 @@ function mlem!(x, ynoisy, background, A; niter::Int = 20)
ybar = similar(ynoisy)
yratio = similar(ynoisy)
back = similar(x)
time0 = time()
time0 = time()
for iter = 1:niter
@show iter, extrema(x), time() - time0
mul!(ybar, A, x)
Expand Down
Loading