Skip to content

Commit

Permalink
Fixes for linter issue of unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mbkumar committed Oct 31, 2023
1 parent 7cc0dff commit ec471a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/simsopt/geo/qfmsurface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scipy.optimize import minimize, NonlinearConstraint
from scipy.optimize import minimize # , NonlinearConstraint

from .._core.json import GSONable
from .surfaceobjectives import QfmResidual
Expand Down
2 changes: 1 addition & 1 deletion src/simsopt/geo/surfacehenneberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def gammadash1_impl(self, data):
rho += self.get_rhomn(m, n) * cosangle
d_rho_d_phi -= self.get_rhomn(m, n) * sinangle * (nfp * n - alpha)
R0H2D = np.kron(R0H, np.ones((ntheta, 1)))
Z0H2D = np.kron(Z0H, np.ones((ntheta, 1)))
# Z0H2D = np.kron(Z0H, np.ones((ntheta, 1)))
b2D = np.kron(b, np.ones((ntheta, 1)))
zeta = b2D * np.sin(theta - alpha * phi)
d_R0H2D_d_phi = np.kron(d_R0H_d_phi, np.ones((ntheta, 1)))
Expand Down
8 changes: 4 additions & 4 deletions src/simsopt/util/permanent_magnet_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def run_Poincare_plots(s_plot, bs, b_dipole, comm, filename_poincare, out_dir=''
out_dir: Path or string for the output directory for saved files.
"""
from simsopt.field.magneticfieldclasses import InterpolatedField
from simsopt.objectives import SquaredFlux
# from simsopt.objectives import SquaredFlux

out_dir = Path(out_dir)

Expand All @@ -502,11 +502,11 @@ def run_Poincare_plots(s_plot, bs, b_dipole, comm, filename_poincare, out_dir=''
phirange = (0, 2 * np.pi / s_plot.nfp, n * 2)
zrange = (0, np.max(zs), n // 2)
degree = 4 # 2 is sufficient sometimes
nphi = len(s_plot.quadpoints_phi)
ntheta = len(s_plot.quadpoints_theta)
# nphi = len(s_plot.quadpoints_phi)
# ntheta = len(s_plot.quadpoints_theta)
bs.set_points(s_plot.gamma().reshape((-1, 3)))
b_dipole.set_points(s_plot.gamma().reshape((-1, 3)))
Bnormal = np.sum(bs.B().reshape((nphi, ntheta, 3)) * s_plot.unitnormal(), axis=2)
# Bnormal = np.sum(bs.B().reshape((nphi, ntheta, 3)) * s_plot.unitnormal(), axis=2)
# Bnormal_dipole = np.sum(b_dipole.B().reshape((nphi, ntheta, 3)) * s_plot.unitnormal(), axis=2)
# f_B = SquaredFlux(s_plot, b_dipole, -Bnormal).J()
make_Bnormal_plots(bs, s_plot, out_dir, "biot_savart_pre_poincare_check")
Expand Down
6 changes: 2 additions & 4 deletions tests/mhd/test_boozer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ def test_boozer_circular_tokamak(self):
# registered surface:
# Register a QP target at s = 1:
s = 0.9999
qs4 = Quasisymmetry(b, s, 0, 1)
Quasisymmetry(b, s, 0, 1)
self.assertEqual(b.s, {0.5, s, 1.0})
# residuals4 = qs4.J()
np.testing.assert_allclose(b.bx.compute_surfs, [7, 15])
self.assertEqual(b.s_to_index, {0.5: 0, 1.0: 1, s: 1})

Expand All @@ -206,8 +205,7 @@ def test_boozer_circular_tokamak(self):
def test_boozer_li383(self):
v = Vmec(os.path.join(TEST_DIR, "wout_li383_low_res_reference.nc"))
b = Boozer(v, mpol=32, ntor=16)
qs1 = Quasisymmetry(b, [0.0, 1.0], 1, 0)
# residuals = qs1.J()
Quasisymmetry(b, [0.0, 1.0], 1, 0)
np.testing.assert_allclose(b.bx.compute_surfs, [0, 14])
self.assertEqual(b.s_to_index, {0.0: 0, 1.0: 1})
bmnc = b.bx.bmnc_b
Expand Down

0 comments on commit ec471a7

Please sign in to comment.