Skip to content

Commit

Permalink
Fix ewald doctest again and remove unused members
Browse files Browse the repository at this point in the history
  • Loading branch information
GardevoirX committed Jan 7, 2025
1 parent 33c9705 commit e5644b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/torchpme/utils/tuning/ewald.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def tune_ewald(
-------
>>> import torch
>>> positions = torch.tensor(
... [[0.0, 0.0, 0.0], [0.5, 0.5, 0.5]], dtype=torch.float64
... [[0.0, 0.0, 0.0], [0.4, 0.4, 0.4]], dtype=torch.float64
... )
>>> charges = torch.tensor([[1.0], [-1.0]], dtype=torch.float64)
>>> cell = torch.eye(3, dtype=torch.float64)
Expand All @@ -181,7 +181,7 @@ def tune_ewald(
1.7140874893066034
>>> print(parameter)
{'lr_wavelength': 0.5}
{'lr_wavelength': 0.25}
>>> print(cutoff)
4.4
Expand Down
7 changes: 2 additions & 5 deletions src/torchpme/utils/tuning/grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,12 @@ def __init__(
neighbor_distances: Optional[torch.Tensor] = None,
):
self._validate_parameters(charges, cell, positions, exponent)
self.charges = charges
self.cell = cell
self.positions = positions
self.cutoff = cutoff
self.exponent = exponent
self.dtype = charges.dtype
self.device = charges.device
self.err_func = self.ErrorBounds(charges, cell, positions)

self._cell_dimensions = torch.linalg.norm(cell, dim=1)
self.err_func = self.ErrorBounds(charges, cell, positions)
self.time_func = self.Timings(
charges,
cell,
Expand Down

0 comments on commit e5644b4

Please sign in to comment.