Skip to content

Commit

Permalink
Try using pylintrc to suppress codacy irritation
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Sep 5, 2023
1 parent 7ce0ad8 commit c39e523
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[TYPECHECK]
# For some reason pylint is convinced that this particular Quantity is an ndarray
generated-members=cell_volume.to
9 changes: 5 additions & 4 deletions euphonic/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,11 @@ def mode_gradients_to_widths(mode_gradients: Quantity, cell_vectors: Quantity
raise ValueError(
f'Unexpected shape for mode_gradients {modg.shape}, '
f'expected (n_qpts, n_modes) or (n_qpts, n_modes, 3)')
cell_volume = (_cell_vectors_to_volume(cell_vectors)
).to('bohr**3').magnitude
q_spacing = 2/(np.cbrt(len(mode_gradients)*cell_volume))
mode_widths = q_spacing*modg

cell_volume = _cell_vectors_to_volume(cell_vectors) # type: Quantity
q_spacing = 2 / (np.cbrt(len(mode_gradients)
* cell_volume.to('bohr**3').magnitude))

Check failure on line 296 in euphonic/util.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

euphonic/util.py#L296

Instance of 'ndarray' has no 'to' member
mode_widths = q_spacing * modg
return mode_widths*ureg('hartree').to(
mode_gradients.units/cell_vectors.units)

Expand Down

0 comments on commit c39e523

Please sign in to comment.