Skip to content

Commit

Permalink
reorder imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Dec 1, 2023
1 parent 9223eaf commit 58fd5f9
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 13 deletions.
11 changes: 8 additions & 3 deletions gflex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
along with gFlex. If not, see <http://www.gnu.org/licenses/>.
"""

import sys, os
import configparser
import os
import sys
import warnings

import numpy as np
from matplotlib import pyplot as plt
import warnings

from ._version import __version__


class Utility:

"""
Expand Down Expand Up @@ -428,8 +432,8 @@ def xyzinterp(self, x, y, z, titletext):
if self.Verbose:
print("Starting to interpolate grid for plotting -- can be a slow process!")

from scipy.interpolate import griddata
import numpy.ma as ma
from scipy.interpolate import griddata

# define grid.
xmin = np.min(self.xw)
Expand Down Expand Up @@ -809,6 +813,7 @@ def outputDeflections(self):
save(self.wOutFile,self.w)
else:
from numpy import savetxt

# Shouldn't need more than mm precision, at very most
savetxt(self.wOutFile,self.w,fmt='%.3f')
if self.Verbose:
Expand Down
5 changes: 3 additions & 2 deletions gflex/f1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
along with gFlex. If not, see <http://www.gnu.org/licenses/>.
"""

from gflex.base import Flexure
from scipy.sparse import spdiags
from scipy.sparse.linalg import spsolve, isolve
from scipy.sparse.linalg import isolve, spsolve

from gflex.base import Flexure


class F1D(Flexure):
Expand Down
4 changes: 3 additions & 1 deletion gflex/f2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
along with gFlex. If not, see <http://www.gnu.org/licenses/>.
"""

from gflex.base import Flexure
import scipy
from scipy.special import kei

from gflex.base import Flexure


# class F2D inherits Flexure and overrides __init__ therefore setting up the same
# three parameters as class Isostasy; and it then sets up more parameters specific
# to its own type of simulation.
Expand Down
1 change: 1 addition & 0 deletions gflex/gflex.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import os.path
import sys

from gflex.f1d import F1D
from gflex.f2d import F2D

Expand Down
3 changes: 2 additions & 1 deletion input/grid2D.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex

flex = gflex.F2D()

flex.Quiet = False
Expand Down
3 changes: 2 additions & 1 deletion input/run_in_script_1D.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex

flex = gflex.F1D()

flex.Quiet = True
Expand Down
3 changes: 2 additions & 1 deletion input/run_in_script_2D.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex

flex = gflex.F2D()

flex.Quiet = False
Expand Down
3 changes: 2 additions & 1 deletion input/test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex

flex = gflex.F1D()

flex.Quiet = True
Expand Down
4 changes: 3 additions & 1 deletion tests/test_1D_FD.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex


def test_main():
flex = gflex.f1d.F1D()

Expand Down
4 changes: 3 additions & 1 deletion tests/test_1D_SAS.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex


def test_main():
flex = gflex.f2d.F1D()

Expand Down
4 changes: 3 additions & 1 deletion tests/test_2D_FD.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#! /usr/bin/env python

import gflex
import numpy as np
from matplotlib import pyplot as plt

import gflex


def test_main():
flex = gflex.f2d.F2D()

Expand Down

0 comments on commit 58fd5f9

Please sign in to comment.