Skip to content

Commit

Permalink
minute change
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitha1201 committed Mar 3, 2025
1 parent 186a4d1 commit 94e837f
Show file tree
Hide file tree
Showing 77 changed files with 1,515 additions and 1,026 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/bridge.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: tardis-carsus-bridge

on:
on:
workflow_call: # to be called by save_atomic_files workflow
outputs:
ref-check-trig:
value: ${{ jobs.tardis-build.outputs.step-ref-check-trig}}
workflow_dispatch: # for running manually


env:
XUVTOP: /tmp/chianti
CHIANTI_DL_URL: https://download.chiantidatabase.org
Expand All @@ -17,9 +17,9 @@ env:
CMFGEN_DB_VER: atomic_data_15nov16.tar.gz
# original reference data
REF1_PATH: ${{ github.workspace }}/tardis-refdata/unit_test_data_org.h5
# generated reference data using the new atomic file
# generated reference data using the new atomic file
REF2_PATH: ${{ github.workspace }}/tardis-refdata/unit_test_data.h5
PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata
PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata
--generate-reference
CACHE_NUMBER: 1

Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v2
with:
path: carsus/

- uses: actions/cache@v3
with:
path: ${{ env.XUVTOP }}
Expand All @@ -47,7 +47,7 @@ jobs:
wget -q ${{ env.CHIANTI_DL_URL }}/${{ env.CHIANTI_DB_VER }} -O ${{ env.XUVTOP }}/chianti.tar.gz
tar -zxf ${{ env.XUVTOP }}/chianti.tar.gz -C ${{ env.XUVTOP }}
if: steps.chianti-cache.outputs.cache-hit != 'true'

- uses: actions/cache@v3
with:
path: /tmp/atomic
Expand All @@ -65,7 +65,7 @@ jobs:
environment-file: conda-lock.yml
init-shell: bash
cache-environment: true
cache-downloads: true
cache-downloads: true
environment-name: carsus

- name: Install package
Expand All @@ -76,13 +76,13 @@ jobs:
jupyter nbconvert ${{ env.NBCONVERT_FLAGS }} carsus/docs/tardis_atomdata_ref.ipynb
env:
CARSUS_REFDATA: ${{ github.workspace }}/carsus-refdata

- name: Upload Atom Data
uses: actions/upload-artifact@v2
with:
name: atom-data
path: carsus/docs/kurucz_cd23_chianti_H_He.h5

tardis-build:
needs: carsus-build
runs-on: ubuntu-latest
Expand All @@ -93,10 +93,10 @@ jobs:
- uses: actions/checkout@v2
with:
repository: tardis-sn/tardis

- name: Download refdata_compare notebook
run: wget https://raw.githubusercontent.com/tardis-sn/tardis-refdata/master/notebooks/ref_data_compare_from_paths.ipynb

- name: Clone tardis-sn/tardis-refdata
uses: actions/checkout@v2
with:
Expand All @@ -109,6 +109,7 @@ jobs:

- name: Restore LFS cache
uses: actions/cache@v3
id: lfs-cache
with:
path: tardis-refdata/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v${{ env.CACHE_NUMBER }}
Expand Down Expand Up @@ -139,32 +140,32 @@ jobs:

- name: Install package
run: pip install -e .

- name: Download atom data
uses: actions/[email protected]
with:
name: atom-data
path: carsus/docs/kurucz_cd23_chianti_H_He.h5

- name: Replace Atomic Data
run: cp carsus/docs/kurucz_cd23_chianti_H_He.h5/kurucz_cd23_chianti_H_He.h5 tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5

- name: Generate Reference Data Copy
run: cp tardis-refdata/unit_test_data.h5 tardis-refdata/unit_test_data_org.h5
run: cp tardis-refdata/unit_test_data.h5 tardis-refdata/unit_test_data_org.h5

- name: Generate New Reference Data
run: pytest tardis ${{ env.PYTEST_FLAGS }}

- name: Compare Reference Data
run: |
jupyter nbconvert ${{ env.NBCONVERT_FLAGS }} ref_data_compare_from_paths.ipynb
- name: Upload comparison notebook
uses: actions/upload-artifact@v2
with:
name: Comparison Notebook
path: ref_data_compare_from_paths.html

- name: Check if reference data are equal
id: ref-equal-check
continue-on-error: true
Expand All @@ -173,7 +174,7 @@ jobs:
# continue-on-error check would display a green tick even when the step passes
# but is necessary for other steps to run
# if the workflow was called by save-atomic-files workflow(the only other option)
# and refdata comparison failed this workflow would pass but the
# and refdata comparison failed this workflow would pass but the
# bridge-ref-check job in save-atomic-files about refdata comparison would fail
- name: Fail the workflow if reference data check fails
if: github.event_name == 'workflow_dispatch' && steps.ref-equal-check.outcome == 'failure'
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/carsus-data-repos-config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: carsus-data-repos-config

on:
workflow_dispatch:
on:
workflow_dispatch:

env:
NBCONVERT_FLAGS: --execute --ExecutePreprocessor.timeout=600 --to html

Expand Down Expand Up @@ -35,14 +35,14 @@ jobs:
with:
path: carsus-data-nist
key: ${{ runner.os }}-cache-${{ hashFiles('carsus-data-nist/**/*.lock') }}

- run: |
for repo in carsus-data-cmfgen carsus-data-kurucz carsus-data-nist; do
repo_path="$repo"
if [ ! -d $repo_path ] ; then
git clone https://github.com/tardis-sn/$repo $repo_path
else
git clone https://github.com/tardis-sn/$repo $repo_path
else
cd $repo_path
git fetch
git checkout origin/main
Expand All @@ -55,20 +55,20 @@ jobs:
environment-file: conda-lock.yml
init-shell: bash
cache-environment: true
cache-downloads: true
cache-downloads: true
environment-name: carsus

- name: Install package
run: pip install -e carsus/

- name: Run notebooks
run: |
jupyter nbconvert ${{ env.NBCONVERT_FLAGS }} carsus/docs/tardis_atomdata_ref.ipynb
env:
CARSUS_REFDATA: ${{ github.workspace }}/carsus-refdata

- name: Upload Atom Data
uses: actions/upload-artifact@v3
with:
name: atom-data
path: carsus/docs/kurucz_cd23_cmfgen_H_Si.h5
path: carsus/docs/kurucz_cd23_cmfgen_H_Si.h5
32 changes: 16 additions & 16 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults:
shell: bash -l {0}

jobs:
ruff:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -31,13 +31,13 @@ jobs:

- name: Download Lock File
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-linux-64.lock

- name: Generate Cache Key
run: |
run: |
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-linux-64.lock
Expand All @@ -46,19 +46,19 @@ jobs:
environment-name: tardis
cache-environment: true
cache-downloads: true

- name: Show statistics pull request
if: github.event_name == 'pull_request_target'
run: ruff check --statistics --show-fixes $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_stats.txt

- name: Show entire output pull request
if: github.event_name == 'pull_request_target'
run: ruff check --output-format=concise $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_full.txt

- name: Show statistics push
if: github.event_name == 'push'
run: ruff check --statistics --show-fixes . | tee ruff_stats.txt

- name: Show entire output push
if: github.event_name == 'push'
run: ruff check --output-format=concise . | tee ruff_full.txt
Expand All @@ -70,19 +70,19 @@ jobs:
path: ruff_stats.txt

- name: Entire output read
id: ruff_complete
id: ruff_complete
uses: juliangruber/[email protected]
with:
path: ruff_full.txt

- name: Find Comment
if: always() && github.event_name == 'pull_request_target'
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: I ran ruff on the latest commit

- name: Post comment
if: github.event_name == 'pull_request_target'
uses: peter-evans/create-or-update-comment@v2
Expand All @@ -93,10 +93,10 @@ jobs:
edit-mode: replace
body: |
*\*beep\* \*bop\**
Hi human,
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}).
Hi human,
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}).
Here are the outputs produced.
Results can also be downloaded as artifacts [**here**](${{ env.URL }}).
Results can also be downloaded as artifacts [**here**](${{ env.URL }}).
Summarised output:
<details>
Expand All @@ -112,16 +112,16 @@ jobs:
```diff
${{ steps.ruff_complete.outputs.content }}
```
</details>
env:
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true

- name: Save results artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: ruff-results
path: |
ruff_full.txt
ruff_stats.txt
ruff_stats.txt
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
environment-file: conda-lock.yml
init-shell: bash
cache-environment: true
cache-downloads: true
cache-downloads: true
environment-name: carsus

- name: Install package
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/save_atomic_files.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: save-atomic-files

on:
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # run at midnight every Sunday

jobs:
create-artifacts:
uses: ./.github/workflows/bridge.yml

zip_artifacts:
needs: create-artifacts
runs-on: ubuntu-latest
Expand All @@ -34,13 +34,13 @@ jobs:
password: ${{ secrets.GH_DROPOFF_PASSWORD }}
source: '*_*_*.zip'
target: "/storage/github_dropoffs/tardis/"

bridge-ref-check:
needs: create-artifacts
runs-on: ubuntu-latest
if: needs.create-artifacts.outputs.ref-check-trig == 'failure'
# fails if refdata comparison failed in the bridge
# continue-on-error wouldn't put a red cross
# continue-on-error wouldn't put a red cross
# even if the bridge passes on refdata compare step
steps:
- run: exit 1
- run: exit 1
Loading

0 comments on commit 94e837f

Please sign in to comment.