Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isort and mypy tidyup #122

Merged
merged 6 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple
from typing import Tuple

from paramak import RotateMixedShape


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple

from paramak import RotateMixedShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/blanket_cutter_parallels.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional

from paramak import ExtrudeStraightShape
from paramak.utils import cut_solid

Expand Down
5 changes: 3 additions & 2 deletions paramak/parametric_components/blanket_cutters_star.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional
from typing import Optional, List, Union

from paramak import ExtrudeStraightShape


Expand All @@ -25,7 +26,7 @@ def __init__(
distance: float,
height: Optional[float] = 2000.,
width: Optional[float] = 2000.,
azimuth_placement_angle: Optional[float] = [
azimuth_placement_angle: Optional[Union[float, List[float]]] = [
0.,
36.,
72.,
Expand Down
5 changes: 3 additions & 2 deletions paramak/parametric_components/blanket_fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

import mpmath
import numpy as np
import paramak
import sympy as sp
from scipy.interpolate import interp1d

import paramak
from paramak import RotateMixedShape, diff_between_angles
from paramak.parametric_components.tokamak_plasma_plasmaboundaries import \
PlasmaBoundaries
from scipy.interpolate import interp1d


class BlanketFP(RotateMixedShape):
Expand Down
5 changes: 3 additions & 2 deletions paramak/parametric_components/blanket_poloidal_segment.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

import warnings
from typing import List, Optional, Tuple, Union, Callable
from typing import Callable, List, Optional, Tuple, Union

import numpy as np
from scipy.optimize import minimize

from paramak import BlanketFP, RotateStraightShape
from paramak.utils import (cut_solid, distance_between_two_points, extend,
rotate)
from scipy.optimize import minimize


class BlanketFPPoloidalSegments(BlanketFP):
Expand Down
3 changes: 2 additions & 1 deletion paramak/parametric_components/capsule_vacuum_vessel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import math
from typing import Optional, Tuple

from paramak import RotateMixedShape
import math


class CapsuleVacuumVessel(RotateMixedShape):
Expand Down
36 changes: 19 additions & 17 deletions paramak/parametric_components/center_column_circular.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Optional, Union, Tuple

from typing import Optional, Tuple
from paramak import RotateMixedShape


Expand All @@ -16,21 +16,23 @@ class CenterColumnShieldCircular(RotateMixedShape):
name: Defaults to "center_column_shield".
"""

def __init__(
self,
height: float,
inner_radius: float,
mid_radius: float,
outer_radius: float,
color: Optional[Tuple[float, float, float,
Optional[float]]] = (0., 0.333, 0.),
**kwargs
) -> None:

super().__init__(
color=color,
**kwargs
)
def __init__(self,
height: float,
inner_radius: float,
mid_radius: float,
outer_radius: float,
color: Optional[Union[Tuple[float,
float,
float],
Tuple[float,
float,
float,
float]]] = (0.0,
0.333,
0.0),
**kwargs) -> None:

super().__init__(color=color, **kwargs)

self.height = height
self.inner_radius = inner_radius
Expand Down Expand Up @@ -79,7 +81,7 @@ def find_points(self):
(self.outer_radius, self.height / 2, "circle"),
(self.mid_radius, 0, "circle"),
(self.outer_radius, -self.height / 2, "straight"),
(self.inner_radius, -self.height / 2, "straight")
(self.inner_radius, -self.height / 2, "straight"),
]

self.points = points
1 change: 1 addition & 0 deletions paramak/parametric_components/center_column_cylinder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Optional, Tuple

from paramak import RotateStraightShape


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple

from paramak import RotateMixedShape


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple

from paramak import RotateMixedShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/center_column_hyperbola.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple

from paramak import RotateMixedShape


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional

from paramak import Plasma, RotateMixedShape


Expand Down
2 changes: 2 additions & 0 deletions paramak/parametric_components/coolant_channel_ring_curved.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

from typing import Optional

import numpy as np

from paramak import SweepCircleShape


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

from typing import Optional

import numpy as np

from paramak import ExtrudeCircleShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/cutting_wedge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional

from paramak import RotateStraightShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/divertor_ITER.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import math

import numpy as np

from paramak import (RotateMixedShape, distance_between_two_points, extend,
rotate)

Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/extrude_rectangle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple

from paramak import ExtrudeStraightShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/hollow_cube.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import cadquery as cq

from paramak import Shape


Expand Down
2 changes: 1 addition & 1 deletion paramak/parametric_components/inboard_firstwall_fccs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from collections.abc import Iterable
from typing import List, Optional, Tuple

import paramak
from paramak import (CenterColumnShieldCircular, CenterColumnShieldCylinder,
CenterColumnShieldFlatTopCircular,
CenterColumnShieldFlatTopHyperbola,
CenterColumnShieldHyperbola,
CenterColumnShieldPlasmaHyperbola, RotateMixedShape)
import paramak


class InboardFirstwallFCCS(RotateMixedShape):
Expand Down
2 changes: 2 additions & 0 deletions paramak/parametric_components/inner_tf_coils_circular.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

import math
from typing import Optional

import numpy as np

from paramak import ExtrudeMixedShape


Expand Down
2 changes: 2 additions & 0 deletions paramak/parametric_components/inner_tf_coils_flat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

import math
from typing import Optional

import numpy as np

from paramak import ExtrudeStraightShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/poloidal_field_coil.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from typing import Optional, Tuple

from paramak import RotateStraightShape


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional, Tuple

import cadquery as cq

from paramak import RotateStraightShape


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional, Tuple

import cadquery as cq

from paramak import PoloidalFieldCoilSet, RotateStraightShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/poloidal_field_coil_set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import cadquery as cq

from paramak import RotateStraightShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/poloidal_segmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import math

import cadquery as cq

from paramak import RotateStraightShape
from paramak.utils import (coefficients_of_line_from_points, intersect_solid,
rotate)
Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/shell_fs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import cadquery as cq

from paramak import CuttingWedgeFS, Shape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/tokamak_plasma.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import numpy as np

from paramak import RotateSplineShape


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

from paramak import Plasma
from plasmaboundaries import get_separatrix_coordinates

from paramak import Plasma


class PlasmaBoundaries(Plasma):
"""Creates a double null tokamak plasma shape that is controlled
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

import math

from typing import Optional, Tuple

import cadquery as cq
import numpy as np

from paramak import ExtrudeStraightShape
from paramak.utils import calculate_wedge_cut, rotate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from typing import Optional, Tuple

import numpy as np
from paramak import ExtrudeMixedShape
from paramak.utils import add_thickness
from scipy import integrate
from scipy.optimize import minimize

from paramak import ExtrudeMixedShape
from paramak.utils import add_thickness


class ToroidalFieldCoilPrincetonD(ExtrudeMixedShape):
"""Toroidal field coil based on Princeton-D curve
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

from typing import Optional, Tuple

import cadquery as cq
import numpy as np

from paramak import ExtrudeStraightShape
from paramak.utils import calculate_wedge_cut

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cadquery as cq
import numpy as np

from paramak.parametric_shapes.extruded_mixed_shape import ExtrudeMixedShape
from paramak.utils import calculate_wedge_cut

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

from typing import Optional, Tuple

import numpy as np

from paramak import ExtrudeMixedShape


Expand Down
1 change: 1 addition & 0 deletions paramak/parametric_components/vacuum_vessel_inner_leg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional

import cadquery as cq

from paramak import RotateStraightShape


Expand Down
2 changes: 1 addition & 1 deletion paramak/parametric_reactors/ball_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __init__(
self.rotation_angle = rotation_angle

# adds self.input_variable_names from the Reactor class
self.input_variable_names = self.input_variable_names + [
self.input_variable_names: List[str] = self.input_variable_names + [
'inner_bore_radial_thickness',
'inboard_tf_leg_radial_thickness',
'center_column_shield_radial_thickness',
Expand Down
3 changes: 2 additions & 1 deletion paramak/parametric_reactors/center_column_study_reactor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import warnings
from typing import List

import paramak

Expand Down Expand Up @@ -85,7 +86,7 @@ def __init__(
self.triangularity = triangularity

# adds self.input_variable_names from the Reactor class
self.input_variable_names = self.input_variable_names + [
self.input_variable_names: List[str] = self.input_variable_names + [
'inner_bore_radial_thickness',
'inboard_tf_leg_radial_thickness',
'center_column_shield_radial_thickness_mid',
Expand Down
Loading