Skip to content

Commit

Permalink
Remove GHA keys (not supported by miniconda, only micromamba) and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
VeckoTheGecko committed Aug 27, 2024
1 parent 4dcd89e commit 5f85aa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/actions/install-parcels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ runs:
environment-file: ${{ inputs.environment-file }}
python-version: ${{ inputs.python-version }}
channels: conda-forge
cache-environment: true
cache-downloads: true
- name: MPI support
if: ${{ ! (runner.os == 'Windows') }}
run: conda install -c conda-forge mpich mpi4py
Expand Down
13 changes: 9 additions & 4 deletions parcels/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

__all__ = ["MPI", "KMeans"]

from typing import Any

MPI: Any | None = None
KMeans: Any | None = None

try:
from mpi4py import MPI
from mpi4py import MPI # type: ignore[no-redef]
except ModuleNotFoundError:
MPI = None
pass

# KMeans is used in MPI. sklearn not installed by default
try:
from sklearn.cluster import KMeans
from sklearn.cluster import KMeans # type: ignore[no-redef]
except ModuleNotFoundError:
KMeans = None
pass

0 comments on commit 5f85aa7

Please sign in to comment.