-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from boutproject/cleanup
Cleanup some dead code as well as add GHA for linting
- Loading branch information
Showing
15 changed files
with
74 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: linting | ||
|
||
on: [push, pull_request] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
black: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install black | ||
run: | | ||
sudo apt update -y | ||
sudo apt -y install python3-pip python3-setuptools python3-wheel | ||
pip3 install black isort | ||
- name: Version | ||
run: | | ||
python3 --version | ||
$HOME/.local/bin/black --version | ||
$HOME/.local/bin/isort --version | ||
- name: Run black | ||
run: | | ||
pwd | ||
ls | ||
$HOME/.local/bin/black zoidberg | ||
$HOME/.local/bin/isort zoidberg | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: "[skip ci] Apply black/isort changes" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -317,22 +317,8 @@ def Rfunc(self, x, z, phi): | |
|
||
|
||
try: | ||
from sympy import ( | ||
Symbol, | ||
atan2, | ||
cos, | ||
sin, | ||
log, | ||
pi, | ||
sqrt, | ||
lambdify, | ||
Piecewise, | ||
Sum, | ||
gamma, | ||
And, | ||
factorial, | ||
diff, | ||
) | ||
from sympy import (And, Piecewise, Sum, Symbol, atan2, cos, diff, | ||
factorial, gamma, lambdify, log, pi, sin, sqrt) | ||
|
||
class StraightStellarator(MagneticField): | ||
"""A "rotating ellipse" stellarator without curvature | ||
|
@@ -1124,7 +1110,7 @@ def read_vmec_file(self, vmec_file, ntheta=None, nzeta=None): | |
|
||
def __init__(self, vmec_file, ntheta=None, nzeta=None, nr=32, nz=32): | ||
# Only needed here | ||
from scipy.interpolate import griddata, RegularGridInterpolator | ||
from scipy.interpolate import RegularGridInterpolator, griddata | ||
|
||
self.read_vmec_file(vmec_file, ntheta, nzeta) | ||
|
||
|
@@ -1433,8 +1419,8 @@ def __init__( | |
While the description are at: | ||
http://svvmec1.ipp-hgw.mpg.de:8080/vmecrest/v1/Coil_currents_1_AA_T_0011.pdf | ||
""" | ||
from scipy.interpolate import RegularGridInterpolator | ||
import numpy as np | ||
from scipy.interpolate import RegularGridInterpolator | ||
|
||
## create 1D arrays of cylindrical coordinates | ||
r = np.linspace(x_range[0], x_range[-1], nx) | ||
|
@@ -1497,13 +1483,14 @@ def field_values(r, phi, z, configuration=0, plot_poincare=False): | |
Contact [email protected] for questions | ||
""" | ||
from osa import Client | ||
import os.path | ||
import xarray as xr | ||
import pickle | ||
import matplotlib.pyplot as plt | ||
from time import sleep | ||
|
||
import matplotlib.pyplot as plt | ||
import xarray as xr | ||
from osa import Client | ||
|
||
tracer = Client("http://esb.ipp-hgw.mpg.de:8280/services/FieldLineProxy?wsdl") | ||
|
||
nx = r.shape[0] | ||
|
@@ -1684,10 +1671,11 @@ def plasma_field(r, phi, z, wout_file="wout.nc"): | |
Contact [email protected] for questions | ||
""" | ||
from osa import Client | ||
import os.path | ||
import pickle | ||
|
||
from osa import Client | ||
|
||
cl = Client("http://esb.ipp-hgw.mpg.de:8280/services/Extender?wsdl") | ||
|
||
vmecURL = "http://svvmec1.ipp-hgw.mpg.de:8080/vmecrest/v1/w7x_ref_1/wout.nc" | ||
|
@@ -1826,8 +1814,8 @@ def __init__( | |
phi_range=[0, 2 * np.pi], | ||
vmec_id="w7x_ref_171", | ||
): | ||
from scipy.interpolate import RegularGridInterpolator | ||
import numpy as np | ||
from scipy.interpolate import RegularGridInterpolator | ||
|
||
## create 1D arrays of cylindrical coordinates | ||
r = np.linspace(x_range[0], x_range[-1], nx) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
from __future__ import division | ||
|
||
import numpy as np | ||
|
||
# Import classes representing poloidal grids | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import numpy as np | ||
from .field import Slab, CurvedSlab | ||
|
||
from .field import CurvedSlab, Slab | ||
|
||
|
||
def test_slab(): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters