Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger Widget Panel #2872

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3c19523
Add widget in a separate cell
atharva-2001 Nov 11, 2024
1fdfd47
Add Panel based logger widget
atharva-2001 Nov 11, 2024
daa9ee9
Panel pyodide settings
atharva-2001 Nov 11, 2024
c75f066
Modify quickstart to embed the widget
atharva-2001 Nov 11, 2024
a92182b
Delete coloured logger and plasma dataframes output
atharva-2001 Nov 11, 2024
1a700fc
Install panel in actions
atharva-2001 Nov 11, 2024
73f07d3
Run workflow
atharva-2001 Nov 15, 2024
fd9ef3a
Add panel, watchfiles and nbsite to environment
atharva-2001 Nov 15, 2024
07ba56c
Change action.yml to use current lockfile
atharva-2001 Nov 15, 2024
045198b
Trigger documentation
atharva-2001 Nov 15, 2024
c67fa74
Widget works both in notebook and in vscode
atharva-2001 Nov 25, 2024
28b6c46
Remove extra functions
atharva-2001 Nov 25, 2024
66f48f7
Reset quickstart
atharva-2001 Nov 25, 2024
f3f9224
Reset setup_env
atharva-2001 Nov 25, 2024
fb77b09
replace recfromtext with genfromtxt
atharva-2001 Nov 25, 2024
74534f4
Rename TardisLogger to TARDISLogger
atharva-2001 Nov 27, 2024
1310121
Remove comment
atharva-2001 Nov 27, 2024
c07f2d7
Refactor code and make warnings module logger global
atharva-2001 Nov 27, 2024
3f7ffd0
Close loop and clean up tasks
atharva-2001 Nov 27, 2024
673e70f
Remove unused Future variable
atharva-2001 Nov 27, 2024
b24b528
Add option to disable widget and display logs without formatting
atharva-2001 Nov 29, 2024
80a1f3e
Replacing HTML with Panel terminal
atharva-2001 Dec 2, 2024
ebe2819
logger run_thread
atharva-2001 Dec 2, 2024
d54e415
Works without async in both environments
atharva-2001 Dec 2, 2024
d419c69
Remove test logger file
atharva-2001 Dec 2, 2024
e12e245
Add LOGGING_LEVELS back
atharva-2001 Dec 2, 2024
e7af98d
Ruff safe fixes
atharva-2001 Dec 2, 2024
5d58bfe
Ruff annotations fix
atharva-2001 Dec 2, 2024
c63b28d
Change parameter to display_logging_widget
atharva-2001 Dec 4, 2024
f72284d
Make docs build verbose
atharva-2001 Dec 4, 2024
b421822
Options for genfromtxt
atharva-2001 Dec 4, 2024
fdf9330
Replace panel.pane.HTML with panel Feed
atharva-2001 Dec 6, 2024
f020b34
Update all items all at once instead of modifying the list
atharva-2001 Dec 6, 2024
a6170d6
Modify conf.py for sphinx error due to update
atharva-2001 Dec 9, 2024
ac4da05
Update display mechanism
atharva-2001 Dec 16, 2024
422978e
New environment
atharva-2001 Dec 16, 2024
4de26b8
Reset Makefile
atharva-2001 Dec 16, 2024
6c20ff4
Minor bugfix
atharva-2001 Dec 16, 2024
f0005eb
Try conda as environment type asv for benchmarks
atharva-2001 Dec 16, 2024
294e7fd
Disable widget to test documentation
atharva-2001 Dec 16, 2024
95629a9
Replace feed with html for performance tests
atharva-2001 Dec 16, 2024
842706d
Reset lockfiles to master
atharva-2001 Jan 17, 2025
d9267da
Add new lockfiles
atharva-2001 Jan 17, 2025
e41364e
Add linux lockfiles
Jan 17, 2025
7a37553
Merge numpy_v2_2 into logger_widget_panel (squashed)
atharva-2001 Jan 17, 2025
6e826fd
Reset env files
atharva-2001 Jan 20, 2025
2e97822
Master lock files
atharva-2001 Jan 20, 2025
8fa6cf8
New lockfile
atharva-2001 Jan 20, 2025
ceb0f2d
New lockfile nbsite
atharva-2001 Jan 20, 2025
497b691
Add numpy to lockfiles
atharva-2001 Jan 20, 2025
3ddbb1a
Numpy linux lockfiles
Jan 20, 2025
cc449c4
Use conda lock for environment creation
Jan 21, 2025
e52c795
Test conda lock
Jan 21, 2025
36bcdc0
Test conda lock
Jan 21, 2025
b2f3e31
Specify environment name
Jan 21, 2025
12d8cdb
Test workflow changes
atharva-2001 Jan 24, 2025
9855204
Work on fork
atharva-2001 Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/actions/setup_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ runs:
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key
shell: bash
- uses: mamba-org/setup-micromamba@v1

- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-${{ inputs.os-label }}.lock
cache-environment-key: ${{ steps.cache-environment-key.outputs.file_hash }}
cache-downloads-key: ${{ steps.cache-environment-key.outputs.file_hash }}
environment-name: tardis
cache-environment: true
cache-downloads: true
init-shell: bash
create-args: conda-lock
environment-name: tardis-base

- name: Install packages
run: |
mkdir micromamba_tardis
conda-lock install --prefix micromamba_tardis conda-${{ inputs.os-label }}.lock
micromamba activate ./micromamba_tardis
shell: bash -el {0}
77 changes: 39 additions & 38 deletions .github/actions/setup_lfs/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Setup LFS"
description: "Pull LFS repositories and caches them"
description: "Downloads and extracts regression data from Zenodo"


inputs:
Expand All @@ -11,42 +11,43 @@ inputs:
runs:
using: "composite"
steps:
- name: Clone tardis-sn/tardis-regression-data
uses: actions/checkout@v4
with:
repository: ${{ inputs.regression-data-repo }}
path: tardis-regression-data

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
working-directory: tardis-regression-data
- name: Download regression data from Zenodo
run: |
wget --show-progress --progress=bar:force https://sandbox.zenodo.org/records/156229/files/tardis-regression-np.zip
mkdir -p tardis-regression-data
unzip -q tardis-regression-np.zip -d tardis-regression-data
shell: bash

- name: Restore LFS cache
uses: actions/cache/restore@v4
id: lfs-cache-regression-data
with:
path: tardis-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1

- name: Git LFS Pull
run: git lfs pull
working-directory: tardis-regression-data
if: steps.lfs-cache-regression-data.outputs.cache-hit != 'true'
shell: bash

- name: Git LFS Checkout
run: git lfs checkout
working-directory: tardis-regression-data
if: steps.lfs-cache-regression-data.outputs.cache-hit == 'true'
shell: bash

- name: Save LFS cache if not found
# uses fake ternary
# for reference: https://github.com/orgs/community/discussions/26738#discussioncomment-3253176
if: ${{ steps.lfs-cache-regression-data.outputs.cache-hit != 'true' && !contains(github.ref, 'merge') && always() || false }}
uses: actions/cache/save@v4
id: lfs-cache-regression-data-save
with:
path: tardis-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1
# - name: Create LFS file list
# run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
# working-directory: tardis-regression-data
# shell: bash

# - name: Restore LFS cache
# uses: actions/cache/restore@v4
# id: lfs-cache-regression-data
# with:
# path: tardis-regression-data/.git/lfs
# key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1

# - name: Git LFS Pull
# run: git lfs pull
# working-directory: tardis-regression-data
# if: steps.lfs-cache-regression-data.outputs.cache-hit != 'true'
# shell: bash

# - name: Git LFS Checkout
# run: git lfs checkout
# working-directory: tardis-regression-data
# if: steps.lfs-cache-regression-data.outputs.cache-hit == 'true'
# shell: bash

# - name: Save LFS cache if not found
# # uses fake ternary
# # for reference: https://github.com/orgs/community/discussions/26738#discussioncomment-3253176
# if: ${{ steps.lfs-cache-regression-data.outputs.cache-hit != 'true' && !contains(github.ref, 'merge') && always() || false }}
# uses: actions/cache/save@v4
# id: lfs-cache-regression-data-save
# with:
# path: tardis-regression-data/.git/lfs
# key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1
45 changes: 27 additions & 18 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ name: docs
on:
push:
branches:
- master
- '*'

# pull_request_target:
# branches:
# - master

pull_request_target:
branches:
- master

types:
- opened
- reopened
- synchronize
- labeled # requires the `build-docs` label
- ready_for_review
# types:
# - opened
# - reopened
# - synchronize
# - labeled # requires the `build-docs` label
# - ready_for_review

workflow_dispatch: # manual trigger

Expand All @@ -38,7 +39,7 @@ defaults:
jobs:
check-for-changes:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
# if: ${{ !github.event.pull_request.draft }} # Commented out to allow running on forks
outputs:
trigger-check-outcome: ${{ steps.trigger_check.outcome }}
docs-check-outcome: ${{ steps.docs_check.outcome }}
Expand Down Expand Up @@ -77,8 +78,10 @@ jobs:

build-docs:
runs-on: ubuntu-latest
needs: check-for-changes
if: needs.check-for-changes.outputs.trigger-check-outcome == 'success' || needs.check-for-changes.outputs.docs-check-outcome == 'success'
# needs: check-for-changes
# if: needs.check-for-changes.outputs.trigger-check-outcome == 'success' || needs.check-for-changes.outputs.docs-check-outcome == 'success'
permissions:
contents: write # Add permissions for deployment
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
Expand Down Expand Up @@ -108,14 +111,19 @@ jobs:
mkdir -p ~/Downloads/tardis-data && cp -a ./tardis-regression-data/atom_data/. ~/Downloads/tardis-data

- name: Install package
run: pip install -e .
run: |
micromamba activate ./micromamba_tardis
pip install -e .

- name: Install Sphinx extensions
run: |
micromamba activate ./micromamba_tardis
pip install sphinxcontrib-googleanalytics

- name: Build documentation
run: cd docs/ && make html NCORES=auto
run: |
micromamba activate ./micromamba_tardis
cd docs/ && make html NCORES=auto

- name: Set destination directory
run: |
Expand Down Expand Up @@ -160,14 +168,15 @@ jobs:
- name: Deploy ${{ env.DEST_DIR }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.BOT_TOKEN }}
# github_token: ${{ secrets.BOT_TOKEN }} # Comment out bot token
github_token: ${{ github.token }}
publish_branch: ${{ env.DEPLOY_BRANCH }}
publish_dir: ./docs/_build/html
destination_dir: ${{ env.DEST_DIR }}
keep_files: true
force_orphan: ${{ env.CLEAN_BRANCH }}
user_name: "TARDIS Bot"
user_email: "tardis.sn.bot@gmail.com"
user_name: "GitHub Actions" # change back to TARDIS Bot
user_email: "github-actions[bot]@users.noreply.github.com" # change back to TARDIS email

- name: Find comment
uses: peter-evans/find-comment@v1
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,34 +58,41 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup LFS
uses: ./.github/actions/setup_lfs

- name: Setup environment
uses: ./.github/actions/setup_env
with:
os-label: ${{ matrix.label }}

- name: Setup LFS
uses: ./.github/actions/setup_lfs

- name: Install package editable
if: ${{ !inputs.pip_git }}
run: |
micromamba activate ./micromamba_tardis
pip install -e . --user

- name: Install package git
if: ${{ inputs.pip_git }}
run: |
micromamba activate ./micromamba_tardis
pip install git+https://github.com/tardis-sn/tardis.git@master

- name: Install qgridnext
if: ${{ !inputs.pip_git }}
run: |
micromamba activate ./micromamba_tardis
pip install qgridnext

- name: Run tests
run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "${{ matrix.continuum }} continuum"
run: |
micromamba activate ./micromamba_tardis
pytest tardis ${{ env.PYTEST_FLAGS }} -m "${{ matrix.continuum }} continuum"

- name: Regression Data Generation tests
run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference -m "${{ matrix.continuum }} continuum"
run: |
micromamba activate ./micromamba_tardis
pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference -m "${{ matrix.continuum }} continuum"
if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master'

- run: mv .coverage .coverage.${{ strategy.job-index }}
Expand Down
2 changes: 1 addition & 1 deletion asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"origin/master",
"HEAD"
],
"environment_type": "mamba",
"environment_type": "conda",
"show_commit_url": "https://github.com/tardis-sn/tardis/commit/",
"conda_environment_file": "tardis_env3.yml",
"benchmark_dir": "benchmarks",
Expand Down
Loading
Loading