Skip to content

Commit 2629298

Browse files
committed
optimizing imports
1 parent b9c84c7 commit 2629298

File tree

230 files changed

+520
-723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+520
-723
lines changed

pySDC/core/BaseTransfer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import logging
2-
import scipy.sparse as sp
2+
33
import numpy as np
4+
import scipy.sparse as sp
45

5-
from pySDC.helpers.pysdc_helper import FrozenClass
66
from pySDC.core.Errors import UnlockError
7+
from pySDC.helpers.pysdc_helper import FrozenClass
78

89

910
# short helper class to add params as attributes

pySDC/core/Collocation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from scipy.interpolate import BarycentricInterpolator
2-
from scipy.integrate import quad
3-
import numpy as np
41
import logging
52

3+
import numpy as np
4+
from scipy.integrate import quad
5+
from scipy.interpolate import BarycentricInterpolator
6+
67
from pySDC.core.Errors import CollocationError
78

89

pySDC/core/Controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import logging
12
import os
23
import sys
3-
import logging
44

5-
from pySDC.helpers.pysdc_helper import FrozenClass
65
from pySDC.core import Hooks as hookclass
76
from pySDC.core.BaseTransfer import base_transfer
7+
from pySDC.helpers.pysdc_helper import FrozenClass
88

99

1010
# short helper class to add params as attributes

pySDC/core/Step.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import logging
22

33
from pySDC.core import Level as levclass
4-
from pySDC.helpers.pysdc_helper import FrozenClass
54
from pySDC.core.BaseTransfer import base_transfer
65
from pySDC.core.Errors import ParameterError
6+
from pySDC.helpers.pysdc_helper import FrozenClass
77

88

99
# short helper class to add params as attributes
@@ -86,10 +86,10 @@ def __generate_hierarchy(self, descr):
8686
"""
8787

8888
if 'dtype_u' in descr:
89-
raise ParameterError('Deprecated parameter dtype_u, please remove from description dictionary and specify'
89+
raise ParameterError('Deprecated parameter dtype_u, please remove from description dictionary and specify '
9090
'directly in the problem class')
9191
if 'dtype_f' in descr:
92-
raise ParameterError('Deprecated parameter dtype_f, please remove from description dictionary and specify'
92+
raise ParameterError('Deprecated parameter dtype_f, please remove from description dictionary and specify '
9393
'directly in the problem class')
9494

9595
# assert the existence of all the keys we need to set up at least on level

pySDC/core/Sweeper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import logging
2+
23
import numpy as np
34
import scipy.linalg
45
import scipy.optimize as opt
56

7+
from pySDC.core.Errors import ParameterError
68
from pySDC.core.Level import level
79
from pySDC.helpers.pysdc_helper import FrozenClass
8-
from pySDC.core.Errors import ParameterError
9-
1010
from pySDC.implementations.collocation_classes.equidistant_right import EquidistantNoLeft
1111
from pySDC.implementations.collocation_classes.gauss_lobatto import CollGaussLobatto
1212
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right

pySDC/helpers/plot_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
mpl.use('pgf')
33
import matplotlib.pyplot as plt
44

5-
import numpy as np
6-
75

86
def figsize(textwidth, scale, ratio):
97
fig_width_pt = textwidth # Get this from LaTeX using \the\textwidth

pySDC/implementations/controller_classes/controller_MPI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from mpi4py import MPI
33

44
from pySDC.core.Controller import controller
5-
from pySDC.core.Step import step
65
from pySDC.core.Errors import ControllerError
6+
from pySDC.core.Step import step
77

88

99
class controller_MPI(controller):

pySDC/implementations/controller_classes/controller_nonMPI.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import itertools
21
import copy as cp
3-
import numpy as np
2+
import itertools
3+
44
import dill
5+
import numpy as np
56

6-
from pySDC.core.Controller import controller
77
from pySDC.core import Step as stepclass
8+
from pySDC.core.Controller import controller
89
from pySDC.core.Errors import ControllerError, CommunicationError
910

1011

pySDC/implementations/datatype_classes/complex_mesh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import numpy as np
21
import copy as cp
32

3+
import numpy as np
4+
45
from pySDC.core.Errors import DataError
56

67

pySDC/implementations/datatype_classes/fenics_mesh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from pySDC.core.Errors import DataError
21
import dolfin as df
32

3+
from pySDC.core.Errors import DataError
4+
45

56
class fenics_mesh(object):
67
"""

0 commit comments

Comments
 (0)