Skip to content

Commit

Permalink
Merge pull request #285 from clawpack/no_py2
Browse files Browse the repository at this point in the history
Drop Python 2 support, remove imports of six and __future__
  • Loading branch information
mandli authored Nov 2, 2023
2 parents 7c799dc + 8422062 commit c88d0b8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
3 changes: 0 additions & 3 deletions dev/fix_maxmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
# Now supports wildcards in list of targetfiles.
#

from __future__ import absolute_import
from __future__ import print_function
import os,sys,glob
from six.moves import zip

rootdir = '.'
targetfiles = ['*.f*']
Expand Down
3 changes: 0 additions & 3 deletions dev/tests/run_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
"Test 2", etc.
"""

from __future__ import absolute_import
from __future__ import print_function
from setrun_regression import setrun
from setplot import setplot
from clawpack.clawutil.runclaw import runclaw
from clawpack.visclaw.plotclaw import plotclaw
from clawpack.clawutil.compare_regression_tests import compare_regression_tests
import os,sys
from six.moves import input


def run_regression_tests(regression_dir="_regression_tests", \
Expand Down
3 changes: 0 additions & 3 deletions dev/tests/run_regression_tests_mandli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
"Test 2", etc.
"""

from __future__ import absolute_import
from __future__ import print_function
import clawpack.clawutil.batch as batch
from six.moves import input

# from setrun_regression import setrun
# from setplot import setplot
Expand Down
3 changes: 0 additions & 3 deletions src/python/amrclaw/compare_gauges.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/usr/bin/env python

from __future__ import absolute_import
from __future__ import print_function
import sys

import numpy
import matplotlib.pyplot as plt

import clawpack.pyclaw.gauges as gauges
from six.moves import range

# Load all gauges

Expand Down
10 changes: 3 additions & 7 deletions src/python/amrclaw/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

"""Base AMRClaw data class for writing out data parameter files."""

from __future__ import print_function
from __future__ import absolute_import
import os

import clawpack.clawutil.data
import six
from six.moves import range

class AmrclawInputData(clawpack.clawutil.data.ClawData):
r"""
Expand Down Expand Up @@ -391,7 +387,7 @@ def __init__(self, num_dim=None):
super(GaugeData,self).__init__()
self.add_attribute('gauges',[])

for (value, default) in six.iteritems(self.defaults):
for (value, default) in self.defaults.items()):
self.add_attribute(value, default)


Expand Down Expand Up @@ -475,7 +471,7 @@ def write(self, num_eqn, num_aux, out_file='gauges.data',
self._out_file.write("# q fields\n")
for gauge_num in self.gauge_numbers:
# Handle special values of "all" and "none"
if isinstance(self.q_out_fields[gauge_num], six.string_types):
if isinstance(self.q_out_fields[gauge_num], str):
if self.q_out_fields[gauge_num].lower() == 'all':
self._out_file.write("%s\n" % " ".join(['True'] * num_eqn))
elif self.q_out_fields[gauge_num].lower() == 'none':
Expand All @@ -498,7 +494,7 @@ def write(self, num_eqn, num_aux, out_file='gauges.data',
self._out_file.write("# aux fields\n")
for gauge_num in self.gauge_numbers:
# Handle special values of "all" and "none"
if isinstance(self.aux_out_fields[gauge_num], six.string_types):
if isinstance(self.aux_out_fields[gauge_num], str):
if self.aux_out_fields[gauge_num].lower() == 'all':
self._out_file.write("%s\n" % " ".join(['True'] * num_aux))
elif self.aux_out_fields[gauge_num].lower() == 'none':
Expand Down

0 comments on commit c88d0b8

Please sign in to comment.