Skip to content

Commit

Permalink
cover surfacecopy cases
Browse files Browse the repository at this point in the history
  • Loading branch information
smiet committed Jul 30, 2024
1 parent 3cff8b3 commit 8dee6dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/simsopt/geo/surfacerzfourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,11 @@ def copy(self, **kwargs):
"""
ntheta = kwargs.pop("ntheta", None)
nphi = kwargs.pop("nphi", None)
otherntheta = self.quadpoints_theta.size
othernphi = self.quadpoints_phi.size

ntheta = kwargs.pop("ntheta", otherntheta)
nphi = kwargs.pop("nphi", othernphi)
grid_range = kwargs.pop("range", None)
mpol = kwargs.pop("mpol", self.mpol)
ntor = kwargs.pop("ntor", self.ntor)
Expand All @@ -448,8 +451,6 @@ def copy(self, **kwargs):
quadpoints_theta = kwargs.pop("quadpoints_theta", None)
quadpoints_phi = kwargs.pop("quadpoints_phi", None)

otherntheta = self.quadpoints_theta.size
othernphi = self.quadpoints_phi.size
# recalculate the quadpoints if necessary (grid_range is not stored in the
# surface object, so assume that if it is given, the gridpoints should be
# recalculated to the specified size)
Expand Down
2 changes: 2 additions & 0 deletions tests/geo/test_surface_rzfourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@ def test_copy_method(self):
s8 = s.copy(mpol=5, ntor=6)
self.assertEqual(s8.mpol, 5)
self.assertEqual(s8.ntor, 6)
s9 = s.copy()
s10 = s.copy(quadpoints_phi=Surface.get_phi_quadpoints(nphi=100,range='field period'), ntheta=82)

class SurfaceRZPseudospectralTests(unittest.TestCase):
def test_names(self):
Expand Down

0 comments on commit 8dee6dc

Please sign in to comment.