Skip to content

Commit

Permalink
Merge branch 'planar' of https://github.com/AlexWiedman/simsopt into …
Browse files Browse the repository at this point in the history
…planar
  • Loading branch information
AlexWiedman committed Nov 24, 2023
2 parents 6678a9c + 1c439a4 commit 73637ae
Show file tree
Hide file tree
Showing 117 changed files with 367 additions and 1,357 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
pip install flake8
- name: Run ruff
uses: chartboost/ruff-action@v1

- name: Run linting tests
run: |
export EXCLUDE="E226,E265,E266,E4,E5,E7,W,F"
flake8 --ignore $EXCLUDE src/
flake8 --ignore $EXCLUDE tests/
flake8 --ignore $EXCLUDE examples/
7 changes: 5 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.8"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
Expand All @@ -11,9 +16,7 @@ sphinx:
# formats:
# - pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
- requirements: requirements.txt
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ else()
set(CMAKE_CXX_FLAGS "-O3 -ffp-contract=fast")
endif()
endif()
# Ensure all code used from Eigen does not have LGPL license:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_MPL2_ONLY")
message(STATUS "CMAKE_CXX_FLAGS are ${CMAKE_CXX_FLAGS}")

if(DEFINED ENV{CONDA_PREFIX})
Expand Down
674 changes: 0 additions & 674 deletions COPYING

This file was deleted.

165 changes: 0 additions & 165 deletions COPYING.LESSER

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Simsopt contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ requirements:
about:
home: {{ data.get('url') }}
summary: simplified framework for stellarator optimization
license: LGPL
license_file: ["COPYING", "COPYING.LESSER"]
license: MIT
license_file: "LICENSE"
description:
doc_url: https://simsopt.readthedocs.io/
dev_url: {{ data.get('url') }}
Expand Down
13 changes: 8 additions & 5 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ Optional Packages
-----------------

Several other optional packages are needed for certain aspects of
simsopt, such as visualization/graphics and building the documentation. These
requirements can be found in the ``[options.extras_require]`` section
of
`setup.cfg <https://github.com/hiddenSymmetries/simsopt/blob/master/setup.cfg>`_.
simsopt, such as running SPEC or VMEC, visualization/graphics, and building the
documentation. These requirements can be found in the
``[options.extras_require]`` section of `setup.cfg
<https://github.com/hiddenSymmetries/simsopt/blob/master/setup.cfg>`_.
Also,

- For MPI support:
* mpi4py
- For VMEC support:
* https://github.com/hiddenSymmetries/vmec2000
* https://github.com/hiddenSymmetries/vmec2000 Note that the
python extension in this repository is required to run VMEC or
optimize VMEC configurations, but is not needed for computing
properties of existing ``wout`` output files.
- For computing Boozer coordinates:
* `booz_xform <https://hiddensymmetries.github.io/booz_xform/>`_
- For SPEC support:
Expand Down
1 change: 0 additions & 1 deletion examples/1_Simple/just_a_quadratic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

import logging
from simsopt.objectives.functions import Identity
from simsopt.objectives import LeastSquaresProblem
from simsopt.solve import least_squares_serial_solve
Expand Down
1 change: 0 additions & 1 deletion examples/1_Simple/permanent_magnet_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from matplotlib import pyplot as plt
from simsopt.field import DipoleField, ToroidalField
from simsopt.geo import PermanentMagnetGrid, SurfaceRZFourier
from simsopt.objectives import SquaredFlux
from simsopt.solve import GPMO
from simsopt.util.permanent_magnet_helper_functions import *

Expand Down
2 changes: 1 addition & 1 deletion examples/1_Simple/stage_two_optimization_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def fun(dofs):
""")
res = minimize(fun, dofs, jac=True, method='L-BFGS-B',
options={'maxiter': MAXITER, 'maxcor': 300, 'iprint': 5}, tol=1e-15)
curves_to_vtk(curves, OUT_DIR + f"curves_opt", close=True)
curves_to_vtk(curves, OUT_DIR + "curves_opt", close=True)
pointData = {"B_N": np.sum(bs.B().reshape((nphi, ntheta, 3)) * s.unitnormal(), axis=2)[:, :, None]}
s.to_vtk(OUT_DIR + "surf_opt", extra_data=pointData)

Expand Down
1 change: 0 additions & 1 deletion examples/1_Simple/tracing_fieldlines_QA.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import time
import os
import logging
import sys
from pathlib import Path
import numpy as np

Expand Down
2 changes: 0 additions & 2 deletions examples/2_Intermediate/QSC.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python3

import logging
import numpy as np
from qsc import Qsc

from simsopt._core import Optimizable
Expand Down
6 changes: 3 additions & 3 deletions examples/2_Intermediate/boozerQA.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from simsopt.configs import get_ncsx_data
from simsopt.field import BiotSavart, coils_via_symmetries
from simsopt.geo import SurfaceXYZTensorFourier, BoozerSurface, curves_to_vtk, boozer_surface_residual, \
ToroidalFlux, Volume, MajorRadius, CurveLength, CurveCurveDistance, NonQuasiSymmetricRatio, Iotas
Volume, MajorRadius, CurveLength, NonQuasiSymmetricRatio, Iotas
from simsopt.objectives import QuadraticPenalty
from simsopt.util import in_github_actions

Expand Down Expand Up @@ -83,7 +83,7 @@
# sum the objectives together
JF = J_nonQSRatio + J_iotas + J_major_radius + Jls

curves_to_vtk(curves, OUT_DIR + f"curves_init")
curves_to_vtk(curves, OUT_DIR + "curves_init")
boozer_surface.surface.to_vtk(OUT_DIR + "surf_init")

# let's fix the coil current
Expand Down Expand Up @@ -144,7 +144,7 @@ def fun(dofs):
MAXITER = 50 if in_github_actions else 1e3

res = minimize(fun, dofs, jac=True, method='BFGS', options={'maxiter': MAXITER}, tol=1e-15)
curves_to_vtk(curves, OUT_DIR + f"curves_opt")
curves_to_vtk(curves, OUT_DIR + "curves_opt")
boozer_surface.surface.to_vtk(OUT_DIR + "surf_opt")

print("End of 2_Intermediate/boozerQA.py")
Expand Down
3 changes: 0 additions & 3 deletions examples/2_Intermediate/permanent_magnet_MUSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
https://github.com/akaptano/simsopt_permanent_magnet_advanced_scripts.git
"""

import os
import pickle
import time
from pathlib import Path

Expand Down Expand Up @@ -257,7 +255,6 @@
# surface is at least 64 x 64 resolution.
vmec_flag = False
if vmec_flag:
from mpi4py import MPI
from simsopt.mhd.vmec import Vmec
from simsopt.util.mpi import MpiPartition
mpi = MpiPartition(ngroups=1)
Expand Down
1 change: 0 additions & 1 deletion examples/2_Intermediate/permanent_magnet_PM4Stell.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
Ken Hammond and the PM4Stell + MAGPIE teams.
'''

import os
from pathlib import Path
import time

Expand Down
3 changes: 0 additions & 3 deletions examples/2_Intermediate/permanent_magnet_QA.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@
are available to OpenMP, e.g. through setting OMP_NUM_THREADS).
"""

import os
import time
from pathlib import Path

import numpy as np
from matplotlib import pyplot as plt

from simsopt.field import BiotSavart, DipoleField
from simsopt.geo import PermanentMagnetGrid, SurfaceRZFourier
Expand Down Expand Up @@ -242,7 +240,6 @@
# surface is at least 64 x 64 resolution.
vmec_flag = False
if vmec_flag:
from mpi4py import MPI
from simsopt.mhd.vmec import Vmec
from simsopt.util.mpi import MpiPartition
mpi = MpiPartition(ngroups=1)
Expand Down
Loading

0 comments on commit 73637ae

Please sign in to comment.