Skip to content

Commit

Permalink
Fix doc, add TagBot [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
islent committed Apr 21, 2021
1 parent a2ea4fd commit 50ddd37
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
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 }}
10 changes: 10 additions & 0 deletions src/Constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ function Constant(::Nothing, units)
return Constant(nothing, Constant(units))
end

"""
Constant(::Type{BigFloat}, units::Vector{Unitful.FreeUnits{N, D, nothing} where D where N})
Construct an immutable struct storing basic physical constants in `BigFloat` corresponding to `units` (default is `uAstro`).
"""
function Constant(::Type{BigFloat}, units::Vector{Unitful.FreeUnits{N, D, nothing} where D where N})
println("Constructing BigFloat constants")
return Constant(
Expand All @@ -98,6 +103,11 @@ function Constant(::Type{BigFloat}, units::Vector{Unitful.FreeUnits{N, D, nothin
)
end

"""
Constant(::Type{Measurement}, units::Vector{Unitful.FreeUnits{N, D, nothing} where D where N})
Construct an immutable struct storing basic physical constants in `Measurement` corresponding to `units` (default is `uAstro`).
"""
function Constant(::Type{Measurement}, units::Vector{Unitful.FreeUnits{N, D, nothing} where D where N})
println("Constructing Unitless Measurement constants")
return Constant(
Expand Down
20 changes: 17 additions & 3 deletions src/Unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,16 @@ end
function ZeroValue(::Nothing)
function ZeroValue(units::Vector{Unitful.FreeUnits{N, D, nothing} where D where N} = uAstro)
Construct an immutable struct providing zero values in corresponding `units` (default is `uAstro`).
Useful for accumulated summation, array initialization, etc.
Construct an immutable struct providing zero `Measurement` values in corresponding `units` (default is `uAstro`).
Useful for accumulated summation, array initialization, etc.
# Examples
```
ZeroValue(nothing)
ZeroValue()
ZeroValue(uSI)
ZeroValue(uCGS)
```
"""
function ZeroValue(::Nothing)
return ZeroValue(0.0, PVector(), PVector(), PVector(), 0.0, 0.0, 0.0)
Expand All @@ -442,6 +443,19 @@ function ZeroValue(units::Vector{Unitful.FreeUnits{N, D, nothing} where D where
)
end

"""
ZeroValue(::Type{Measurement}, args...)
Construct an immutable struct providing zero values in corresponding `units` (default is `uAstro`).
# Examples
```jl
ZeroValue(Measurement, nothing)
ZeroValue(Measurement, )
ZeroValue(Measurement, uSI)
ZeroValue(Measurement, uCGS)
```
"""
function ZeroValue(::Type{Measurement}, args...)
z = ZeroValue(args...)
return ZeroValue(measurement.([getfield(z, i) for i in fieldnames(ZeroValue)])...)
Expand Down

2 comments on commit 50ddd37

@islent
Copy link
Member Author

@islent islent commented on 50ddd37 Apr 21, 2021

Choose a reason for hiding this comment

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

@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 updated: JuliaRegistries/General/34606

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 v1.2.2 -m "<description of version>" 50ddd37287bfb917962d76832fb233f370f5270e
git push origin v1.2.2

Please sign in to comment.