Skip to content

Commit

Permalink
Merge pull request #67 from MagriLab/feature/it_cycle
Browse files Browse the repository at this point in the history
it.cycle to iter
  • Loading branch information
danielkelshaw authored Mar 15, 2022
2 parents 901f657 + 655540f commit fcd2349
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kolsol/numpy/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def dissip(self, u_hat: np.ndarray) -> np.ndarray:
w_hat = self.vorticity(u_hat)

# generate indices for each dimension
g = it.cycle(string.ascii_letters)
g = iter(string.ascii_letters)
idx = ''.join(next(g) for _ in range(self.ndim))

dissipation = oe.contract(f'...{idx} -> ...', w_hat * np.conj(w_hat))
Expand Down
2 changes: 1 addition & 1 deletion kolsol/torch/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def dissip(self, u_hat: torch.Tensor) -> torch.Tensor:
w_hat = self.vorticity(u_hat)

# generate indices for each dimension
g = it.cycle(string.ascii_letters)
g = iter(string.ascii_letters)
idx = ''.join(next(g) for _ in range(self.ndim))

dissipation = oe.contract(f'...{idx} -> ...', w_hat * torch.conj(w_hat))
Expand Down

0 comments on commit fcd2349

Please sign in to comment.