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

we're on python3, so importing from future should no longer be necessary #726

Merged
merged 5 commits into from
Oct 3, 2024
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
3 changes: 0 additions & 3 deletions development/DMPFOR/dmpfor_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from __future__ import absolute_import
from __future__ import print_function
from petsc4py import PETSc
import numpy as np
import DMPFOR
from six.moves import range



global_nx =3
global_ny =2
dof=4
Expand Down
2 changes: 0 additions & 2 deletions development/advect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import sys
from six.moves import range

Expand Down
2 changes: 0 additions & 2 deletions development/advect_annotated.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
from petsc4py import PETSc
from six.moves import range
Expand Down
2 changes: 0 additions & 2 deletions development/clawdata2pyclaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
If you try this out, please raise issues in the PyClaw tracker for
anything that doesn't work.
"""
from __future__ import absolute_import
from __future__ import print_function
import setrun
import six

Expand Down
2 changes: 0 additions & 2 deletions development/driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
from petsc4py import PETSc
from six.moves import range

Expand Down
5 changes: 0 additions & 5 deletions development/fPyWrapperExample.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
from __future__ import absolute_import
from __future__ import print_function
from numpy import *
from FRS import vec_rp
q = random.random((2,800))
aux = random.random((2,800))
waves, s = vec_rp(2,q[:,0:799],q[:,1:800],aux[:,0:799],aux[:,1:800])
print(waves)
print(s)



Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import
from __future__ import print_function
from numpy import random, empty,zeros
#from numpy import *
from FRS import vec_rp, pw_rp
Expand All @@ -9,7 +7,6 @@




class RiemannSolver:


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import
from __future__ import print_function
import RiemannSolver
from RiemannSolver import *
from numpy import load, absolute
Expand All @@ -23,4 +21,3 @@

assert (absolute(wavesRead - waves1)< tolerance).all()
assert (absolute(sRead -s1)< tolerance).all()

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

from __future__ import absolute_import
import RiemannSolver
from RiemannSolver import *
from pylab import plot, figure, suptitle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import
from __future__ import print_function
import RiemannSolver
from RiemannSolver import *
from numpy import empty
Expand Down Expand Up @@ -122,7 +120,3 @@
#figure(4)
#suptitle("Figure 4 shows the the execution time for different mx values\n for the pointwize solver, timeSteps = {0}".format(max_timeSteps))
plot(mxValues, timeResultsPointwise, "bo-")




1 change: 0 additions & 1 deletion development/rp_approaches/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""

#--------------------------
from __future__ import absolute_import
def setplot(plotdata):
#--------------------------

Expand Down
2 changes: 0 additions & 2 deletions development/rp_approaches/shockbubble.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python
# encoding: utf-8

from __future__ import absolute_import
import numpy as np
from scipy import integrate
from six.moves import range
Expand Down
3 changes: 0 additions & 3 deletions development/test_mpi4py.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import
from __future__ import print_function
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
Expand All @@ -9,4 +7,3 @@
max_x =comm.reduce( sendobj=x, op=MPI.MAX, root=0)
x = comm.bcast(max_x, root=0)
print('x after', x)

2 changes: 0 additions & 2 deletions development/test_rescale.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import sys

try:
Expand Down
1 change: 0 additions & 1 deletion fvmbook/chap11/burgers/burgers1D.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8

from __future__ import absolute_import
def burgers():
"""
Example from Chapter 11 of LeVeque, Figure 11.8.
Expand Down
1 change: 0 additions & 1 deletion fvmbook/chap22/inclusion/inclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
r"""
Variable-coefficient elasticity example.
"""
from __future__ import absolute_import
import numpy as np
from six.moves import range
t0wall = 0.025
Expand Down
3 changes: 1 addition & 2 deletions fvmbook/chap3/acousimple/acoustics_simple_waves.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8

from __future__ import absolute_import

def fig_31_38(iplot=False,htmlplot=False,outdir='./_output'):
r"""Produces the output shown in Figures 3.1 and 3.8 of the FVM book.
These involve simple waves in the acoustics system."""
Expand Down
1 change: 0 additions & 1 deletion fvmbook/chap6/advection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import
IC='gauss_square'
if IC=='gauss_square':
beta=200.; x0=0.3; mx=100
Expand Down
3 changes: 1 addition & 2 deletions fvmbook/chap6/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.

"""
from __future__ import absolute_import
"""
from advection import beta, x0, IC

#--------------------------
Expand Down
3 changes: 1 addition & 2 deletions fvmbook/chap7/standing/acoustics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8

from __future__ import absolute_import

def acoustics(iplot=False,htmlplot=False,outdir='./_output'):
"""
This example solves the 1-dimensional acoustics equations in a homogeneous
Expand Down
3 changes: 1 addition & 2 deletions fvmbook/chap9/acoustics/interface/acoustics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8

from __future__ import absolute_import

def acoustics(problem='figure 9.4'):
"""
This example solves the 1-dimensional variable-coefficient acoustics
Expand Down
1 change: 0 additions & 1 deletion fvmbook/chap9/acoustics/interface/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""

#--------------------------
from __future__ import absolute_import
def setplot(plotdata):
#--------------------------

Expand Down
2 changes: 0 additions & 2 deletions src/forestclaw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Additions for ForestClaw support"""

from __future__ import absolute_import
import os
import logging
import logging.config
Expand Down
2 changes: 0 additions & 2 deletions src/forestclaw/fileio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# encoding: utf-8

"""I/O support for ForestClaw"""

from __future__ import absolute_import
import logging
logger = logging.getLogger('pyclaw.fileio')

Expand Down
4 changes: 0 additions & 4 deletions src/forestclaw/fileio/ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
r"""
Routines for reading and writing an ascii output file from ForestClaw
"""

from __future__ import absolute_import
from __future__ import print_function

import logging
import numpy as np
# import clawpack.forestclaw as forestclaw
Expand Down
3 changes: 0 additions & 3 deletions src/forestclaw/fileio/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Test suite for forestclaw.io
"""

from __future__ import absolute_import
from __future__ import print_function

import os
import shutil
import tempfile
Expand Down
3 changes: 0 additions & 3 deletions src/forestclaw/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Module containing forestclaw.geometry.
All we do here is override the pyclaw.Patch class to add a block_number and mpi_rank.
"""

from __future__ import absolute_import

from clawpack import pyclaw
from clawpack.pyclaw import geometry as pyclaw_geometry
from clawpack.pyclaw.geometry import Dimension
Expand Down
1 change: 0 additions & 1 deletion src/forestclaw/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration

Expand Down
3 changes: 0 additions & 3 deletions src/forestclaw/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
r"""
Test suite for forestclaw
"""

from __future__ import absolute_import

from .geometry import Patch
from clawpack.pyclaw.geometry import Dimension

Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Main petclaw package"""

from __future__ import absolute_import
import os
import logging, logging.config

Expand Down
5 changes: 1 addition & 4 deletions src/petclaw/cfl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
r"""
Module for the CFL object.
"""
from __future__ import absolute_import
class CFL(object):
""" Parallel CFL object, responsible for computing the
Courant-Friedrichs-Lewy condition across all processes.
Expand All @@ -12,11 +11,10 @@ def __init__(self, global_max):
self._local_max = global_max
self._global_max = global_max
self._reduce_vec = PETSc.Vec().createWithArray([0])

def get_global_max(self):
r"""
Compute the maximum CFL number over all processes for the current step.

This is used to determine whether the CFL condition was
violated and adjust the timestep.
"""
Expand All @@ -36,4 +34,3 @@ def set_global_max(self,new_global_max):
def update_global_max(self,new_local_max):
self._reduce_vec.array = new_local_max
self._global_max = max(self._global_max,self._reduce_vec.max()[1])

1 change: 0 additions & 1 deletion src/petclaw/classic/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('classic', parent_package, top_path)
Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/classic/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
__module__ property, used by pyclaw.solver.Solver.__init__ to
determine the containing claw_package to use.
"""

from __future__ import absolute_import
from clawpack import pyclaw

class ClawSolver1D(pyclaw.ClawSolver1D):
Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/controller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Module for PetClaw controller class.
"""

from __future__ import absolute_import
from clawpack import pyclaw

class Controller(pyclaw.controller.Controller):
Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/fileio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
"""Output package for PetClaw"""

from __future__ import absolute_import
import logging
from clawpack.pyclaw.fileio import ascii
__all__ = ['ascii.read','ascii.write']
Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/fileio/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
To install h5py, you must also install the hdf5 library from the website:
http://www.hdfgroup.org/HDF5/release/obtain5.html
"""

from __future__ import absolute_import
from mpi4py import MPI
import os
import logging
Expand Down
3 changes: 0 additions & 3 deletions src/petclaw/fileio/petsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
PETSc's parallel i/o capabilities to allow for parallel reads and writes of
frame data.
"""

from __future__ import absolute_import
from __future__ import print_function
from petsc4py import PETSc
import pickle
import os
Expand Down
1 change: 0 additions & 1 deletion src/petclaw/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Module containing petclaw.geometry.
"""

from __future__ import absolute_import
from clawpack import pyclaw
from clawpack.pyclaw import geometry as pyclaw_geometry

Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/limiters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

# This __init__ script only imports common utilities, most of the import
# should be done depending on the solver needed

from __future__ import absolute_import
from clawpack.riemann import *

__all__ = ['tvd']
Expand Down
1 change: 0 additions & 1 deletion src/petclaw/plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from six.moves import range
def interactive_plot(outdir='./_output',file_format='petsc',setplot=None):
"""
Expand Down
1 change: 0 additions & 1 deletion src/petclaw/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration

Expand Down
2 changes: 0 additions & 2 deletions src/petclaw/sharpclaw/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python

from __future__ import absolute_import
import os

def configuration(parent_package='',top_path=None):
Expand Down
1 change: 0 additions & 1 deletion src/petclaw/sharpclaw/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Module containing SharpClaw solvers for PetClaw
"""

from __future__ import absolute_import
from clawpack import pyclaw

class SharpClawSolver1D(pyclaw.SharpClawSolver1D):
Expand Down
Loading
Loading