Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 28 additions & 4 deletions .github/workflows/install-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,35 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python 3.13
id: setup-python
uses: actions/setup-python@v6
with:
python-version: 3.13
cache: ${{ matrix.package_manager == 'pip' && 'pip' || '' }}

- name : Install uv (if applicable)
if: matrix.package_manager == 'uv'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Generate lock file if missing
if: matrix.package_manager == 'uv'
run: |
if [ ! -f uv.lock ]; then
echo "Generating uv.lock for cache key computation..."
uv lock
else
echo "uv.lock already exists"
fi

- name: Cache virtual environment
if: matrix.package_manager == 'uv'
id: cache-venv
uses: actions/cache@v4
with:
path: .venv
key: uv-venv-${{ runner.os }}-${{ matrix.device }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('uv.lock') }}

- name: Create virtual environment (pip GPU)
if: matrix.package_manager == 'pip' && matrix.device == 'gpu'
Expand Down Expand Up @@ -79,10 +101,12 @@ jobs:
- name: Setup environment with uv (if applicable)
if: matrix.package_manager == 'uv'
run: |
uv venv --no-project
source .venv/bin/activate
uv pip install torch --index-url ${{ matrix.torch_index }}
uv pip install --group dev -e .
if [ "${{ steps.cache-venv.outputs.cache-hit }}" != "true" ]; then
rm -rf .venv
uv venv --no-project
uv pip install torch --index-url ${{ matrix.torch_index }}
uv pip install --group dev -e .
fi
uv pip list
echo "$PWD/.venv/bin" >> $GITHUB_PATH

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ This release introduces new features including GIF animation support, wandb run

- Initialize `da_forcing_mean` and `da_forcing_std` to `None` when forcing data is absent, fixing `AttributeError` in `WeatherDataset` with `standardize=True` [\#369](https://github.com/mllam/neural-lam/issues/369) @Sir-Sloth-The-Lazy

### Maintenance

- Add two-layer caching to install-and-test CI workflow (pip download cache + uv venv cache) to reduce build times by 80-95% [\#606](https://github.com/mllam/neural-lam/pull/606) @Sharkyii

- Ensure proper sorting of `analysis_time` in `NpyFilesDatastoreMEPS._get_analysis_times` independent of the order in which files are processed with glob [\#386](https://github.com/mllam/neural-lam/pull/386) @Gopisokk

- Replace `shell=True` subprocess call in `compute_standardization_stats.py` with a safe argument list and Python-side hostname parsing to prevent command injection via `SLURM_JOB_NODELIST` [\#264](https://github.com/mllam/neural-lam/pull/264) @ashum9
Expand Down
Loading