Skip to content

Commit

Permalink
Linted
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWiedman committed Oct 3, 2023
1 parent 9d1f036 commit b03fa7d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
# Define the individual terms objective function:
Jf = SquaredFlux(s, bs)
Jls = [CurveLength(c) for c in base_curves]
Jccdist = CurveCurveDistance(curves, CC_THRESHOLD, num_basecurves=ncoils) #Error
Jccdist = CurveCurveDistance(curves, CC_THRESHOLD, num_basecurves=ncoils) # Error
Jcsdist = CurveSurfaceDistance(curves, s, CS_THRESHOLD)
Jcs = [LpCurveCurvature(c, 2, CURVATURE_THRESHOLD) for c in base_curves]
Jmscs = [MeanSquaredCurvature(c) for c in base_curves]
Expand All @@ -131,6 +131,7 @@
# are not in least-squares form, so we write a little wrapper function that we
# pass directly to scipy.optimize.minimize


def fun(dofs):
JF.x = dofs
J = JF.J()
Expand Down
3 changes: 2 additions & 1 deletion src/simsopt/geo/curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ def create_equally_spaced_curves(ncurves, nfp, stellsym, R0=1.0, R1=0.5, order=6
curves.append(curve)
return curves


def create_equally_spaced_planar_curves(ncurves, nfp, stellsym, R0=1.0, R1=0.5, order=6, numquadpoints=None):
"""
Create ``ncurves`` curves of type
Expand All @@ -906,7 +907,7 @@ def create_equally_spaced_planar_curves(ncurves, nfp, stellsym, R0=1.0, R1=0.5,
center = [R0 * cos(angle), R0 * sin(angle), 0]
rotation = [1, -cos(angle), -sin(angle), 0]
dofs = np.zeros(len(curve.get_dofs()))

Check warning on line 909 in src/simsopt/geo/curve.py

View check run for this annotation

Codecov / codecov/patch

src/simsopt/geo/curve.py#L904-L909

Added lines #L904 - L909 were not covered by tests

j = 0
for i in rcCoeffs:
dofs[j] = i
Expand Down
2 changes: 1 addition & 1 deletion src/simsopt/geo/curveplanarfourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CurvePlanarFourier(sopp.CurvePlanarFourier, Curve):
.. math::
[r_{c,0}, \cdots, r_{c,\text{order}}, r_{s,1}, \cdots, r_{s,\text{order}}, q_0, q_i, q_j, q_k, x_{\text{center}}, y_{\text{center}}, z_{\text{center}}]
"""

Expand Down
1 change: 1 addition & 0 deletions tests/geo/test_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_curve(curvetype, rotated, x=np.asarray([0.5])):
class Testing(unittest.TestCase):

curvetypes = ["CurveXYZFourier", "JaxCurveXYZFourier", "CurveRZFourier", "CurvePlanarFourier", "CurveHelical", "CurveHelicalInitx0"]

def test_curve_helical_xyzfourier(self):
x = np.asarray([0.6])
curve1 = CurveHelical(x, 2, 5, 2, 1.0, 0.3)
Expand Down

0 comments on commit b03fa7d

Please sign in to comment.