Skip to content

Commit

Permalink
Update compat; standardize yml; use Type not DataType; to v0.18 (#133)
Browse files Browse the repository at this point in the history
* Update compat

* Standardize yml

* Standardize make.jl

* Use Type not DataType

* Use Type not DataType

* Use Type not DataType

* Fix typos
  • Loading branch information
JeffFessler authored May 18, 2024
1 parent 42869f2 commit 8e9e77a
Show file tree
Hide file tree
Showing 24 changed files with 166 additions and 81 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,47 @@ name: CompatHelper

on:
schedule:
- cron: '00 00 * * *'
- cron: 0 0 * * 0 # weekly
workflow_dispatch:

permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@latest
with:
version: '1'
# arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- 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.COMPATHELPER_PRIV }} # optional
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

# based on:
# https://github.com/JuliaRegistries/CompatHelper.jl
1 change: 1 addition & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
Pkg.instantiate()'
- name: BuildAndDeploy
env:
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#Authentication:-GITHUB_TOKEN
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
2 changes: 2 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: TagBot

on:
issue_comment:
types:
- created
workflow_dispatch:

jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand Down
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@v4
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 }}
22 changes: 11 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MIRT"
uuid = "7035ae7a-3787-11e9-139a-5545ed3dc201"
authors = ["fessler <[email protected]>"]
version = "0.17.0"
version = "0.18"

[deps]
AVSfldIO = "b6189060-daf9-4c28-845a-cc0984b81781"
Expand All @@ -25,14 +25,14 @@ Wavelets = "29a6e085-ba6d-5f35-a997-948ac2efa89a"
[compat]
AVSfldIO = "0.2"
FFTW = "1"
FileIO = "1.9, 1.14"
FillArrays = "0.12, 0.13"
ImageFiltering = "0.6, 0.7"
ImageTransformations = "0.8, 0.9"
Interpolations = "0.12, 0.13, 0.14"
LazyGrids = "0.5"
LinearMapsAA = "0.11"
FileIO = "1"
FillArrays = "1"
ImageFiltering = "0.7"
ImageTransformations = "0.10"
Interpolations = "0.15"
LazyGrids = "1"
LinearMapsAA = "0.12"
NFFT = "0.13"
SpecialFunctions = "1, 2"
Wavelets = "0.9"
julia = "1.8"
SpecialFunctions = "2"
Wavelets = "0.10"
julia = "1.10"
9 changes: 9 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[default]
extend-ignore-identifiers-re = [
"allk",
"als",
"Nd",
"iy",
"pn",
"MIRTio",
]
2 changes: 1 addition & 1 deletion doc/start-juno.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jim(x, title="test")
* This test should produce a grayscale image of the famous
[Shepp-Logan phantom](https://en.wikipedia.org/wiki/Shepp%E2%80%93Logan_phantom) in the Plots tab of Atom.
* To learn about the jiffy image display function `jim`, type `?jim` at the REPL.
* Juno and Atom have lots of online documention.
* Juno and Atom have lots of online documentation.
I use the `vim-mode-plus` key bindings, installed using Atom preferences.

* To start a Jupyter notebook for Julia, type at the REPL:
Expand Down
21 changes: 13 additions & 8 deletions doc/start.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
* Install Julia (1.5 or later recommended) from https://julialang.org/
* Explore the extensive documentation at https://docs.julialang.org/
* Install Julia (1.10 or later recommended) from https://julialang.org
* Explore the extensive documentation at https://docs.julialang.org
* Launch Julia and use the `]` key to enter its package manager.
* Add any packages needed for these notebooks using the `add` command.
* For example `add Plots` to add the `Plots` package.
* Other crucial standard packages are `FFTW` `FFTViews`
* You will also need the package `IJulia` to run any Jupyter demo notebooks.
* Add MIRT by typing `add MIRT`
(Automatically loads from https://github.com/JeffFessler/MIRT.jl because MIRT.jl is a registered package.)
(Automatically loads from https://github.com/JeffFessler/MIRT.jl
because MIRT.jl is a registered package.)
* Type `precompile` to have Julia precompile the added packages.
* After you are done adding packages, press the backspace key to return to the REPL prompt.
* Later if you need to add more packages just type the `]` key again at the REPL prompt to enter the package manager.
* Julia is under active development so code is updated frequently. It is a wise to type `up` (short for `update`) at the package manager prompt every week or so to get automatic updates of any packages you have intalled.
* After you are done adding packages, press the backspace key
to return to the REPL prompt.
* Later if you need to add more packages just type the `]` key again
at the REPL prompt to enter the package manager.
* Julia is under active development so code is updated frequently.
It is a wise to type `up` (short for `update`) at the package manager prompt
every week or so to get automatic updates of any packages you have installed.
* For some Julia tutorials see
http://web.eecs.umich.edu/~fessler/course/551/julia/tutor/
http://web.eecs.umich.edu/~fessler/course/551/julia/tutor
* For some signal processing demos in Julia see
http://web.eecs.umich.edu/~fessler/course/551/julia/demo/
http://web.eecs.umich.edu/~fessler/course/551/julia/demo
10 changes: 5 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ execute = isempty(ARGS) || ARGS[1] == "run"

org, reps = :JeffFessler, :MIRT
eval(:(using $reps))
using Documenter
using Literate
import Documenter
import Literate
#using DemoCards

# examples_templates, examples_theme = cardtheme("grid")
Expand All @@ -27,7 +27,7 @@ binder_root_url =


repo = eval(:($reps))
DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true)
Documenter.DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true)

# preprocessing
inc1 = "include(\"../../../inc/reproduce.jl\")"
Expand Down Expand Up @@ -81,7 +81,7 @@ format = Documenter.HTML(;
assets = ["assets/custom.css"],
)

makedocs(;
Documenter.makedocs(;
modules = [repo],
authors = "Jeff Fessler and contributors",
sitename = "$repo.jl",
Expand All @@ -96,7 +96,7 @@ makedocs(;
# examples_cb()

if isci
deploydocs(;
Documenter.deploydocs(;
repo = "github.com/$base",
devbranch = "main",
devurl = "dev",
Expand Down
4 changes: 2 additions & 2 deletions src/algorithm/general/dot-curv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _curv_type(Tf::Type{<:RealU}, Tx::Type{<:Number}) =


"""
make_dot_curvf(curv::Function, [x, Tf::DataType; w = similar(x)])
make_dot_curvf(curv::Function, [x, Tf::Type; w = similar(x)])
Make a function with arguments `(v, x)`
that computes the dot product between
Expand Down Expand Up @@ -53,7 +53,7 @@ Those units are relevant to defining the work array `w`.
- `x` an array whose `size` and `eltype` is used to allocate `w`
# option
- `Tf::DataType = typeof(one(eltype(x)))`
- `Tf::Type = typeof(one(eltype(x)))`
Specify `eltype` of function `f(x)`, defaulting to unitless.
- `w = similar(x, typeof(oneunit(Tf) / oneunit(eltype(x))^2))`
work space for gradient calculation, with appropriate units (if needed).
Expand Down
4 changes: 2 additions & 2 deletions src/algorithm/general/dot-grad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _grad_type(Tf::Type{<:RealU}, Tx::Type{<:Number}) =


"""
make_dot_gradf(grad::Function, [x, Tf::DataType; w = similar(x)])
make_dot_gradf(grad::Function, [x, Tf::Type; w = similar(x)])
Make a function with arguments `(v, x)`
that computes the dot product between
Expand Down Expand Up @@ -44,7 +44,7 @@ Those units are relevant to defining the work array `w`.
# in
- `grad::Function` see above
- `x` an array whose `size` and `eltype` is used to allocate `w`
- `Tf::DataType = typeof(one(eltype(x)))`
- `Tf::Type = typeof(one(eltype(x)))`
Specify `eltype` of function `f(x)`, defaulting to unitless.
# option
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/general/pogm_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ iterate as below for given coefficients ``(\\alpha, \\beta_k, \\gamma_k)``
- ``x_{k+1} = y_{k+1} + \\beta_k (y_{k+1} - y_k) + \\gamma_k (y_{k+1} - x_k)`` : momentum update
Proximal versions of the above for ``g(x) \\neq 0`` are in the below references,
and use the proximal operater
and use the proximal operator
``prox_g(z) = argmin_x {1/2\\|z-x\\|^2 + g(x)}``.
- Proximal Gradient method (PGM or ISTA) - ``\\beta_k = \\gamma_k = 0``. [BT09]
Expand Down
4 changes: 2 additions & 2 deletions src/mri/kspace-spiral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using Interpolations
Make k-space spiral trajectory based on GE 3T scanner constraints
Option:
- `N` dimention of reconstructed image
- `N` dimension of reconstructed image
- `Nt` # of time points
- `fov` field of view in cm
- `dt` time sampling interval out; default `5e-6` sec
Expand Down Expand Up @@ -163,7 +163,7 @@ to gradients at 4us.
Multi-shot spiral design
uses Duyn's approximate slewrate limited design
augmented with archimedian `gmax` limit
augmented with archimedean `gmax` limit
# in [args]
* `D` = FOV; cm
Expand Down
Loading

2 comments on commit 8e9e77a

@JeffFessler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator() register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/107119

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.18.0 -m "<description of version>" 8e9e77a0cca43ff045345cf9075194072c82a552
git push origin v0.18.0

Please sign in to comment.