-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CliMA/ck/readme
Update docs + fixes
- Loading branch information
Showing
4 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
# NullBroadcasts.jl | ||
|
||
A small package for defining null broadcasted types and behaviors | ||
||| | ||
|---------------------:|:----------------------------------------------| | ||
| **Docs Build** | [![docs build][docs-bld-img]][docs-bld-url] | | ||
| **Documentation** | [![dev][docs-dev-img]][docs-dev-url] | | ||
| **GHA CI** | [![gha ci][gha-ci-img]][gha-ci-url] | | ||
| **Code Coverage** | [![codecov][codecov-img]][codecov-url] | | ||
|
||
[docs-bld-img]: https://github.com/CliMA/NullBroadcasts.jl/actions/workflows/docs.yml/badge.svg | ||
[docs-bld-url]: https://github.com/CliMA/NullBroadcasts.jl/actions/workflows/docs.yml | ||
|
||
[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg | ||
[docs-dev-url]: https://CliMA.github.io/NullBroadcasts.jl/dev/ | ||
|
||
[gha-ci-img]: https://github.com/CliMA/NullBroadcasts.jl/actions/workflows/ci.yml/badge.svg | ||
[gha-ci-url]: https://github.com/CliMA/NullBroadcasts.jl/actions/workflows/ci.yml | ||
|
||
[codecov-img]: https://codecov.io/gh/CliMA/NullBroadcasts.jl/branch/main/graph/badge.svg | ||
[codecov-url]: https://codecov.io/gh/CliMA/NullBroadcasts.jl | ||
|
||
This package defines `NullBroadcasted()`, which can be added to, subtracted | ||
from, or multiplied by any value in a broadcast expression without incurring a | ||
runtime performance penalty. | ||
|
||
# Example | ||
|
||
```julia | ||
using NullBroadcasts: NullBroadcasted | ||
using Test | ||
|
||
x = [1]; y = [1] | ||
a = NullBroadcasted() | ||
@. x = x + a + y | ||
@test x[1] == 2 # passes | ||
|
||
x = [1]; y = [1] | ||
@. x = x - a + y | ||
@test x[1] == 2 # passes | ||
|
||
@. x = x + (x * a) # equivalent to @. x = x | ||
|
||
@. x = x * a # not allowed, errors | ||
@. x = a # not allowed, errors | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# NullBroadcasts.jl | ||
|
||
Under construction. Please see the readme for the latest documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0523c23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
0523c23
There was a problem hiding this comment.
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/124106
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.
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: