Skip to content

Commit

Permalink
fixed problematic list unpacking, updated flake8 args in action
Browse files Browse the repository at this point in the history
  • Loading branch information
wolearyc committed Aug 22, 2024
1 parent 91f8af5 commit 885b8ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: py-actions/flake8@v2
with:
max-line-length: "88"
args: "--docstring-convention=numpy"
args: "--docstring-convention=numpy --extend-ignore=E203"
plugins: "flake8-bugbear==24.4.26 flake8-docstrings"
- name: Test with pytest
run: |
Expand Down
4 changes: 3 additions & 1 deletion ramannoodle/polarizability/gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ def _get_batch_graph(
cart_displacement = displacement.matmul(expanded_lattice)
cart_distance_matrix = torch.sqrt(torch.sum(cart_displacement**2, dim=-1))

cart_unit_vectors = cart_displacement[*edge_indexes]
cart_unit_vectors = cart_displacement[
edge_indexes[0], edge_indexes[1], edge_indexes[2]
] # python 3.10 complains if we use the unpacking operator (*)
cart_unit_vectors /= torch.linalg.norm(cart_unit_vectors, dim=-1)[:, None]
distances = cart_distance_matrix[*edge_indexes].view(-1, 1)
ref_distances = self._ref_distances.repeat((num_samples, 1))
Expand Down

0 comments on commit 885b8ff

Please sign in to comment.