Skip to content

Commit

Permalink
Replace Requires with package extension, update compat (#37)
Browse files Browse the repository at this point in the history
* Replace Requires with ext/

* Fix doc
  • Loading branch information
JeffFessler authored Jan 3, 2024
1 parent 9d01fed commit 79e1c17
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
15 changes: 10 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name = "ImageGeoms"
uuid = "9ee76f2b-840d-4475-b6d6-e485c9297852"
authors = ["Jeff Fessler <[email protected]> and contributors"]
version = "0.10"
version = "0.10.1"

[deps]
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LazyGrids = "7031d0ef-c40d-4431-b2f8-61a8d2f650db"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[compat]
FillArrays = "0.13, 1"
FillArrays = "1"
LazyGrids = "0.4, 0.5"
Requires = "1.3"
julia = "1.8"
MIRTjim = "0.23"
julia = "1.10"

[weakdeps]
MIRTjim = "170b2178-6dee-4cb0-8729-b3e8b57834cc"

[extensions]
ImageGeoms_MIRTjim = "MIRTjim"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ see the

### Compatibility

Tested with Julia ≥ 1.8.
Tested with Julia ≥ 1.10.

<!-- URLs -->
[action-img]: https://github.com/JuliaImageRecon/ImageGeoms.jl/workflows/CI/badge.svg
Expand Down
4 changes: 2 additions & 2 deletions docs/lit/examples/2-mask.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ This page explains the `mask` aspects of the Julia package

# Packages needed here.

using MIRTjim: jim, prompt # must be first!
using ImageGeoms: ImageGeom, MaskCircle, MaskAllButEdge
using ImageGeoms: maskit, embed, embed!, getindex!, jim #, size
using ImageGeoms: maskit, embed, embed!, getindex! # +jim +size
using ImageGeoms: mask_outline
using MIRTjim: jim, prompt
using Unitful: mm


Expand Down
13 changes: 7 additions & 6 deletions src/jim.jl → ext/ImageGeoms_MIRTjim.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# jim.jl
# ImageGeoms_MIRTjim.jl

import .MIRTjim: jim
module ImageGeoms_MIRTjim

#using ImageGeoms: ImageGeom

export jim
using ImageGeoms: ImageGeom, axis, mask_or
import MIRTjim: jim


"""
jim(ig ; kwargs...)
Display the support mask.
Display the support mask (2D) or `mask_or` (3D).
Requires package `MIRTjim` to be loaded first.
"""
jim(ig::ImageGeom{2} ; kwargs...) =
Expand All @@ -18,3 +17,5 @@ jim(ig::ImageGeom{3} ; kwargs...) =
jim(axis(ig,1), axis(ig,2), mask_or(ig.mask) ;
title = "(dx,dy,dz)=$(ig.deltas)", kwargs...)
jim(ig::ImageGeom ; kwargs...) = throw("unsupported $(typeof(ig))")

end # module
7 changes: 0 additions & 7 deletions src/ImageGeoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Module for describing image geometries.
"""
module ImageGeoms

using Requires: @require

const RealU = Number # Union{Real, Unitful.Length}

"""
Expand All @@ -26,9 +24,4 @@ include("imresize.jl")
include("makemask.jl")
include("mask.jl")

function __init__()
# support MIRTjim iff user has loaded it
@require MIRTjim = "170b2178-6dee-4cb0-8729-b3e8b57834cc" include("jim.jl")
end

end # module
4 changes: 2 additions & 2 deletions src/mask.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ embed(v::AbstractVector{T}, mask::AbstractArray{Bool} ;
array = embed(matrix::AbstractMatrix{<:Number}, mask::AbstractArray{Bool})
Embed each column of `matrix` into `mask` then `cat` along next dimension
In:
# In:
* `matrix [count(mask) L]`
* `mask [(N)]`
Out:
# Out:
* `array [(N) L]`
"""
function embed(x::AbstractMatrix{<:Number}, mask::AbstractArray{Bool})
Expand Down

2 comments on commit 79e1c17

@JeffFessler
Copy link
Member 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/98090

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.10.1 -m "<description of version>" 79e1c17e852a5f623b368b756e106a1d5326ec7f
git push origin v0.10.1

Please sign in to comment.