-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is a good early draft
- Loading branch information
Showing
30 changed files
with
1,998 additions
and
900 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
tags: '*' | ||
|
||
# Needed to allow julia-actions/cache to delete old caches that it has created | ||
permissions: | ||
actions: write | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
climadiagnostics: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: | ||
- '1.9' | ||
- '1.10' | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.version }} | ||
- uses: julia-actions/cache@v1 | ||
- uses: julia-actions/julia-buildpkg@latest | ||
- uses: julia-actions/julia-runtest@latest | ||
- uses: julia-actions/julia-processcoverage@latest | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
files: lcov.info | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: CompatHelper | ||
|
||
on: | ||
schedule: | ||
- cron: '00 00 * * *' | ||
|
||
jobs: | ||
CompatHelper: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
tags: '*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: 1 | ||
- name: Install dependencies | ||
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | ||
- name: Build and deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token | ||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key | ||
run: julia --project=docs/ docs/make.jl |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: TagBot | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
name = "ClimaDiagnostics" | ||
uuid = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f" | ||
authors = ["Gabriele Bozzola <[email protected]>"] | ||
version = "0.1.0" | ||
version = "0.0.1" | ||
|
||
[deps] | ||
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" | ||
ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" | ||
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab" | ||
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" | ||
|
||
[compat] | ||
Aqua = "0.8" | ||
ClimaComms = "0.5" | ||
ClimaCore = "0.13" | ||
ClimaTimeSteppers = "0.7" | ||
Documenter = "1" | ||
JuliaFormatter = "1" | ||
NCDatasets = "0.13, 0.14" | ||
SafeTestsets = "0.1" | ||
SciMLBase = "1, 2" | ||
Test = "1" | ||
julia = "1.9" | ||
|
||
[extras] | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" | ||
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Aqua", "ClimaTimeSteppers", "Documenter", "JuliaFormatter", "SafeTestsets", "Test"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# `ClimaDiagnostics.jl` | ||
|
||
`ClimaDiagnostics.jl` | ||
`ClimaDiagnostics.jl` | ||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
## Accumulation | ||
|
||
Several diagnostics require performing reductions, such as taking the maximum or | ||
the average. Since it is not feasible to store all the lists of all the | ||
intermediate values, we aggregate the results in specific storage areas (e.g., | ||
we take `max(max(max(max(t1, t2), t3), t4), t5)` instead of `max(t1, t2, t3, t4, | ||
t5)` In this, it is convenient to preallocate the space where we want to | ||
accumulate the intermediate. | ||
|
||
Accumulation is accomplished by the `accumulate!` function. All this function | ||
does is applying the binary `reduction_time_func` to the previous accumulated | ||
value and the newly computed one and store the output to the accumulator. | ||
|
||
|
||
|
||
|
||
After an accumulated variable is output, the accumulator is reset to its natural | ||
state. This is achieved with the `reset_accumulator!` function. | ||
|
||
|
||
|
||
However, we have to fill the space with something | ||
that does not affect the reduction. This, by definition, is the identity of the | ||
operation. The identity of the operation `+` is `0` because `x + 0 = x` for | ||
every `x`. | ||
|
||
We have to know the identity for every operation we want to support. Of course, | ||
users are welcome to define their own by adding new methods to | ||
identity_of_reduction. | ||
|
||
For instance, to define the identity of the reduction `-`, one would write | ||
```julia | ||
function ClimaDiagnostics.Diagnostics.identity_of_reduction(::typeof(-)) | ||
return 0 | ||
end | ||
``` | ||
(Or add this to the `reduction_identities.jl` file.) | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Abstract types needed across submodules | ||
|
||
""" | ||
AbstractWriter | ||
An object that knows how to save some output. | ||
`AbstractWriter`s have to provide one function, `write_field!` | ||
The function has to have singature | ||
`write_field!(writer::Writer, field, diagnostic::ScheduledDiagnostic, u, p, t)` | ||
It is up to the writer to implment this | ||
""" | ||
abstract type AbstractWriter end |
Oops, something went wrong.
d8f5bc0
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
d8f5bc0
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/104161
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: