Skip to content

Commit 1b184ae

Browse files
author
Andrew Cheng-An Hsieh
committed
Merge main into deep-heating-dev; simplify heating to efficiency+flux modes only
- Merged origin/main (v1.8.6) into deep-heating-dev - Simplified DeepHeatingParams: kept only 8 fields (active, P_dep, sigma_P, efficiency, normalization, below_domain, power_mode, F_total) - Removed ohmic, tidal, and power modes entirely - Two supported power modes: efficiency (fraction of instellation) and flux (fixed W/m2) - Updated set_deep_heating, deep_heating, config parsing, and comments
2 parents 15d471e + f33d359 commit 1b184ae

91 files changed

Lines changed: 10836 additions & 5315 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Tutorial:
2+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
4+
# Main developer
5+
* @nichollsh

.github/CODE_OF_CONDUCT.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
* Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
* Trolling, insulting or derogatory comments, and personal or political attacks
23+
* Public or private harassment
24+
* Publishing others' private information, such as a physical or email address, without their explicit permission
25+
* Contacting individual members, contributors, or leaders privately, outside designated community mechanisms, without their explicit permission
26+
* Other conduct which could reasonably be considered inappropriate in a professional setting
27+
28+
## Enforcement Responsibilities
29+
30+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31+
32+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33+
34+
## Scope
35+
36+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37+
38+
## Enforcement
39+
40+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at opensource@github.com. All complaints will be reviewed and investigated promptly and fairly.
41+
42+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43+
44+
## Enforcement Guidelines
45+
46+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47+
48+
### 1. Correction
49+
50+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51+
52+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53+
54+
### 2. Warning
55+
56+
**Community Impact**: A violation through a single incident or series of actions.
57+
58+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59+
60+
### 3. Temporary Ban
61+
62+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63+
64+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65+
66+
### 4. Permanent Ban
67+
68+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69+
70+
**Consequence**: A permanent ban from any sort of public interaction within the community.
71+
72+
## Attribution
73+
74+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
75+
76+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
77+
78+
[homepage]: https://www.contributor-covenant.org
79+
80+
For answers to common questions about this code of conduct, see the FAQ at <https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.

.github/CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Contributing to AGNI
2+
3+
Please visit the [contributing page](https://www.h-nicholls.space/AGNI/dev/contributing/) on the online documentation website.
4+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: For when something is going wrong
4+
title: ''
5+
labels: 'Bug'
6+
assignees: ''
7+
8+
---
9+
10+
## Problem description
11+
A description of what is happening, and steps outlining what causes it to happen.
12+
13+
## Expected behavior
14+
A description of what you would have expected to happen.
15+
16+
## Evidence
17+
Add screenshots and logs to help explain your problem.
18+
19+
## My computer
20+
Describe the computer used to run the code when the bug was found; e.g Fedora Linux with Python 3.12
21+
22+
## Additional notes
23+
Add any other context about the problem here; e.g. suggest potential solutions
24+
25+
## Relevant people
26+
Tag relevant people here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: For when something needs to be changed, added, or removed
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Feature description
11+
A short description of what you would like to be done; e.g. a new feature to be added.
12+
13+
## Preferred solution
14+
Your suggested or preferred solution for implementing this feature or change.
15+
16+
## Additional information
17+
Any other additional context; e.g. more details, related papers, other solutions.
18+
19+
## Relevant people
20+
Tag people who should know about this request.

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Description
2+
A short summary of the changes made in this pull-request.
3+
4+
Tag the [related issue](https://github.com/nichollsh/AGNI/issues); e.g. closes #xxx
5+
6+
Include screenshots or log files if appropriate.
7+
8+
## Validation of changes
9+
Describe what you did to verify that these changes address the tagged issue.
10+
11+
Outline your test configuration; e.g. MacOS with Python 3.13.
12+
13+
14+
## Checklist
15+
16+
- [ ] I have followed the [contributing guidelines](https://www.h-nicholls.space/AGNI/dev/contributing/)
17+
- [ ] My code follows the style guidelines of this project
18+
- [ ] I have performed a self-review of my code
19+
- [ ] My changes generate no new warnings or errors
20+
- [ ] I have checked that the tests still pass on my computer
21+
- [ ] I have updated the docs, as appropriate
22+
- [ ] I have added tests for these changes, as appropriate
23+
- [ ] I have checked that all dependencies have been updated, as required
24+
25+
## Relevant people
26+
Tag people who should know about this PR here

.github/workflows/documentation.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
3737
- uses: julia-actions/setup-julia@v2
3838
with:
39-
version: '1.10'
39+
version: '1.11'
4040
- uses: julia-actions/cache@v1
4141

4242
- name: Install Documenter
@@ -78,4 +78,6 @@ jobs:
7878
- name: Build docs and deploy
7979
env:
8080
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
81-
run: julia --project="./" docs/make.jl
81+
run: |
82+
export RAD_DIR="/home/runner/work/AGNI/AGNI/SOCRATES"
83+
julia --project="./" docs/make.jl

.github/workflows/install_and_test.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
name: Tests
55

6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
610
on:
711
pull_request:
812
branches: [main]
@@ -14,7 +18,8 @@ jobs:
1418
runs-on: ubuntu-latest
1519
name: install_and_test
1620
steps:
17-
- uses: actions/checkout@v4
21+
- name: Checkout repository
22+
uses: actions/checkout@v6
1823

1924
# Setup system
2025
- name: NetCDF
@@ -33,12 +38,13 @@ jobs:
3338

3439
# Setup SOCRATES
3540
- name: Get SOCRATES
36-
uses: actions/checkout@v4
41+
uses: actions/checkout@v6
3742
with:
3843
repository: 'nichollsh/SOCRATES'
3944
path: 'SOCRATES'
4045

41-
- uses: actions/cache@v4
46+
- name: Restore SOCRATES from cache
47+
uses: actions/cache@v4
4248
id: cache-socrates
4349
with:
4450
path: |
@@ -47,7 +53,7 @@ jobs:
4753
SOCRATES/set_rad_env
4854
key: socrates-${{ hashFiles('SOCRATES/version') }}
4955

50-
- name: Build SOCRATES
56+
- name: Build SOCRATES if required
5157
if: steps.cache-socrates.outputs.cache-hit != 'true'
5258
run: |
5359
export LD_LIBRARY_PATH=""
@@ -64,10 +70,39 @@ jobs:
6470
export LD_LIBRARY_PATH=""
6571
julia --project=. -e 'using Pkg; Pkg.build()'
6672
67-
- name: Test AGNI
73+
# Run the tests
74+
- name: Run AGNI test suite
6875
run: |
6976
export RAD_DIR="/home/runner/work/AGNI/AGNI/SOCRATES"
7077
export LD_LIBRARY_PATH=""
71-
julia --project=. -e 'using Pkg; Pkg.test()'
78+
cd test/
79+
julia --project=.. --code-coverage runtests.jl
80+
81+
- name: Get coverage
82+
run: |
83+
julia --project=. test/get_coverage.jl
84+
export total=$(cat coverage.total)
85+
echo "total=$total" >> $GITHUB_ENV
7286
87+
# Upload output dir for inspection by user
88+
- name: Upload result as artifact
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: test-artifact
92+
path: |
93+
out/*
94+
coverage.*
95+
96+
# Make badge
97+
- name: Create coverage badge
98+
uses: schneegans/dynamic-badges-action@v1.7.0
99+
with:
100+
auth: ${{ secrets.GIST_TOKEN }}
101+
gistID: e20f4fa3c7811c75d34005311fef3696
102+
filename: covbadge.svg
103+
label: Coverage
104+
message: ${{ env.total }}%
105+
minColorRange: 50
106+
maxColorRange: 90
107+
valColorRange: ${{ env.total }}
73108

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ deps/*.log
1414
test/out/
1515
Manifest.toml
1616
*.cov
17+
coverage.*
1718

1819
# Docs
1920
docs/build
@@ -34,18 +35,26 @@ res/thermodynamics/*.nc.chk
3435
index.html
3536

3637
# Output files
38+
scratch
39+
scratch/
3740
test/out/
3841
out/*
3942
runtime.sf
4043
runtime.sf_k
4144
socstar.dat
45+
slurm*.out
46+
slurm*.log
47+
sbatch*.out
48+
sbatch*.log
4249

4350
# Misc files
4451
.DS_Store
4552
__pycache__
4653
debug/
4754
nogit*
4855
.osfcli.config
56+
.venv
57+
.conda
4958

5059
# RFM
5160
rfm

0 commit comments

Comments
 (0)