Skip to content

Commit d3b7e32

Browse files
committed
Lint fixes
1 parent 7ed2188 commit d3b7e32

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ jobs:
1111
python-version: [3.11]
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- name: Install uv with python version.
16-
uses: astral-sh/setup-uv@v5
16+
uses: astral-sh/setup-uv@v8
1717
with:
1818
python-version: ${{ matrix.python-version }}
1919
enable-cache: true
2020
cache-dependency-glob: "uv.lock"
2121
- name: Install dependencies
2222
run: |
23+
uv pip install dgl==2.4.0 -f https://data.dgl.ai/wheels/torch-2.4/repo.html
2324
uv sync --group lint
2425
2526
- name: ruff

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
3030

3131
steps:
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v6
3333
- name: Install uv with python version.
34-
uses: astral-sh/setup-uv@v5
34+
uses: astral-sh/setup-uv@v8
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737
enable-cache: true
@@ -45,7 +45,7 @@ jobs:
4545
uv run pytest tests --cov=maml
4646
- name: Upload coverage reports to Codecov
4747
if: matrix.os == 'ubuntu-latest'
48-
uses: codecov/codecov-action@v4
48+
uses: codecov/codecov-action@v6
4949
env:
5050
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5151

@@ -57,9 +57,9 @@ jobs:
5757
# For pypi trusted publishing
5858
id-token: write
5959
steps:
60-
- uses: actions/checkout@v4
60+
- uses: actions/checkout@v6
6161
- name: Install uv with python version.
62-
uses: astral-sh/setup-uv@v5
62+
uses: astral-sh/setup-uv@v8
6363
with:
6464
python-version: ${{ matrix.python-version }}
6565
enable-cache: true

src/maml/apps/bowsr/model/dft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def predict_energy(self, structure: Structure):
7373

7474
compat = MaterialsProjectCompatibility()
7575
vrun = Vasprun("vasprun.xml")
76-
entry = compat.process_entry(vrun.get_computed_entry())
76+
entry = compat.process_entry(vrun.get_computed_entry()) # type: ignore[arg-type]
7777
return (
7878
entry.energy # type: ignore[union-attr]
7979
- sum(elements[el]["energy_per_atom"] * amt for el, amt in el_amt_dict.items())

src/maml/apps/bowsr/optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def atoms_crowded(structure: Structure, cutoff_distance: float = 1.1) -> bool:
9494
"""
9595
distance_matrix = copy(structure.distance_matrix)
9696
distance_matrix[distance_matrix == 0] = np.inf
97-
return np.min(distance_matrix) < cutoff_distance
97+
return bool(np.min(distance_matrix) < cutoff_distance)
9898

9999

100100
class BayesianOptimizer:

src/maml/utils/_dummy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
DUMMY_OBJECTS = {
1111
"str": "H2O",
1212
"composition": Composition("H2O"),
13-
"structure": Structure(Lattice.cubic(3.167), ["Mo", "Mo"], [[0, 0, 0], [0.5, 0.5, 0.5]]),
14-
"molecule": Molecule(["C", "O"], [[0, 0, 0], [1, 0, 0]]),
13+
"structure": Structure(Lattice.cubic(3.167), ["Mo", "Mo"], [[0, 0, 0], [0.5, 0.5, 0.5]]), # type: ignore[arg-type]
14+
"molecule": Molecule(["C", "O"], [[0, 0, 0], [1, 0, 0]]), # type: ignore[arg-type]
1515
}
1616

1717

0 commit comments

Comments
 (0)