From b644dc5de3d5630b06210ba0ea56ffc538316a06 Mon Sep 17 00:00:00 2001 From: Anne Archibald Date: Mon, 23 Aug 2021 17:54:40 +0100 Subject: [PATCH] Fix up conflicts and isort again --- tests/test_datafiles.py | 4 +++- tests/test_density.py | 2 +- tests/test_derived_quantities.py | 8 ++++---- tests/test_downhill_fitter.py | 2 +- tests/test_fake_toas.py | 18 ++++++++++-------- tests/test_fitter.py | 4 +--- tests/test_fitter_compare.py | 2 +- tests/test_flagging_clustering.py | 9 ++++----- tests/test_infostrings.py | 12 ++++++------ tests/test_jump.py | 5 +++-- tests/test_model_derivatives.py | 4 ++-- tests/test_parametercovariancematrix.py | 2 +- tests/test_plk_widget.py | 4 +++- tests/test_pulse_number.py | 4 ++-- tests/test_random_models.py | 6 +----- tests/test_residuals.py | 2 +- tests/test_solar_wind.py | 4 ++-- tests/test_stigma.py | 8 +++----- tests/test_timing_model.py | 3 ++- tests/test_toa.py | 2 +- tests/test_toa_pickle.py | 3 +-- tests/test_toa_reader.py | 5 +---- tests/test_toa_writer.py | 6 +----- 23 files changed, 55 insertions(+), 64 deletions(-) diff --git a/tests/test_datafiles.py b/tests/test_datafiles.py index 4c693fe2a..32e0fe0e4 100644 --- a/tests/test_datafiles.py +++ b/tests/test_datafiles.py @@ -1,8 +1,10 @@ """Test installation of PINT data files""" import os +import tempfile + import pytest + import pint.config -import tempfile @pytest.fixture diff --git a/tests/test_density.py b/tests/test_density.py index 169b582d3..097873941 100644 --- a/tests/test_density.py +++ b/tests/test_density.py @@ -8,8 +8,8 @@ from astropy.time import Time from pylab import * -import pint.toa as toa import pint.simulation as simulation +import pint.toa as toa from pint.models import get_model diff --git a/tests/test_derived_quantities.py b/tests/test_derived_quantities.py index cf306e1ae..28e57dc60 100644 --- a/tests/test_derived_quantities.py +++ b/tests/test_derived_quantities.py @@ -28,17 +28,17 @@ from pint.derived_quantities import ( a1sini, companion_mass, + gamma, mass_funct, mass_funct2, + omdot, + omdot_to_mtot, + pbdot, pulsar_age, pulsar_B, pulsar_B_lightcyl, pulsar_edot, pulsar_mass, - omdot, - pbdot, - gamma, - omdot_to_mtot, ) diff --git a/tests/test_downhill_fitter.py b/tests/test_downhill_fitter.py index f844dbafe..747175d5a 100644 --- a/tests/test_downhill_fitter.py +++ b/tests/test_downhill_fitter.py @@ -13,8 +13,8 @@ import pint.fitter from pint.models import get_model from pint.models.timing_model import MissingTOAs -from pint.toa import merge_TOAs from pint.simulation import make_fake_toas_uniform +from pint.toa import merge_TOAs par_eccentric = """ PSR J1234+5678 diff --git a/tests/test_fake_toas.py b/tests/test_fake_toas.py index d4092542e..d51cb5208 100644 --- a/tests/test_fake_toas.py +++ b/tests/test_fake_toas.py @@ -1,15 +1,17 @@ -import astropy.units as u -import pint.simulation -from pint.models.model_builder import get_model, get_model_and_toas -from pint.toa import get_TOAs -import pint.residuals import io -import numpy as np -import tempfile import os +import tempfile + +import astropy.units as u +import numpy as np +from pinttestdata import datadir, testdir + import pint.config +import pint.residuals +import pint.simulation from pint.fitter import GLSFitter -from pinttestdata import datadir, testdir +from pint.models.model_builder import get_model, get_model_and_toas +from pint.toa import get_TOAs def test_noise_addition(): diff --git a/tests/test_fitter.py b/tests/test_fitter.py index b306738be..a3a6e55c9 100644 --- a/tests/test_fitter.py +++ b/tests/test_fitter.py @@ -11,10 +11,8 @@ from pinttestdata import datadir import pint.models as tm -from pint import fitter, toa, simulation -from pinttestdata import datadir import pint.models.parameter as param -from pint import ls +from pint import fitter, ls, simulation, toa from pint.models import get_model, get_model_and_toas diff --git a/tests/test_fitter_compare.py b/tests/test_fitter_compare.py index bf6664e53..d4aba4d26 100644 --- a/tests/test_fitter_compare.py +++ b/tests/test_fitter_compare.py @@ -19,8 +19,8 @@ WLSFitter, ) from pint.models.model_builder import get_model -from pint.toa import get_TOAs from pint.simulation import make_fake_toas_uniform +from pint.toa import get_TOAs @pytest.fixture diff --git a/tests/test_flagging_clustering.py b/tests/test_flagging_clustering.py index cf4b46eff..03fd19642 100644 --- a/tests/test_flagging_clustering.py +++ b/tests/test_flagging_clustering.py @@ -1,19 +1,18 @@ """Tests for clustering and flagging""" +import copy import logging import os import unittest -import pytest -import copy import astropy.units as u import numpy as np +import pytest +from pinttestdata import datadir import pint.models.model_builder as mb import pint.toa as toa +from pint.models import PhaseJump, parameter as p from pint.residuals import Residuals -from pinttestdata import datadir -from pint.models import parameter as p -from pint.models import PhaseJump class SimpleSetup: diff --git a/tests/test_infostrings.py b/tests/test_infostrings.py index 8c7859070..f641a5e84 100644 --- a/tests/test_infostrings.py +++ b/tests/test_infostrings.py @@ -1,20 +1,20 @@ """Tests for adding info strings to parfiles and tim files""" -import logging -import os -import unittest -import pytest import copy import io +import logging +import os import platform +import unittest import astropy.units as u import numpy as np +import pytest +from pinttestdata import datadir +import pint import pint.models.model_builder as mb import pint.toa as toa from pint.residuals import Residuals -from pinttestdata import datadir -import pint class SimpleSetup: diff --git a/tests/test_jump.py b/tests/test_jump.py index be222c285..fecfe0306 100644 --- a/tests/test_jump.py +++ b/tests/test_jump.py @@ -15,6 +15,7 @@ import pint.toa from pint.models import PhaseJump, get_model, parameter as p from pint.residuals import Residuals +from pint.simulation import make_fake_toas_uniform class SimpleSetup: @@ -248,7 +249,7 @@ def test_multiple_jumps_add(): first_jump = jmp else: second_jump = jmp - toas = pint.toa.make_fake_toas(57000, 60000 - 1, 10, m) + toas = make_fake_toas_uniform(57000, 60000 - 1, 10, m) first_jump.quantity = 100 * u.us second_jump.quantity = 0 * u.us @@ -323,7 +324,7 @@ def small(): """ ) ) - t = pint.toa.make_fake_toas(58000, 60000, 20, m) + t = make_fake_toas_uniform(58000, 60000, 20, m) class R: pass diff --git a/tests/test_model_derivatives.py b/tests/test_model_derivatives.py index 8c1348963..eb23e4a6e 100644 --- a/tests/test_model_derivatives.py +++ b/tests/test_model_derivatives.py @@ -8,13 +8,13 @@ import numdifftools import numpy as np import pytest +from astropy import units as u from hypothesis import HealthCheck, Verbosity, assume, given, settings from hypothesis.strategies import composite, floats, integers, sampled_from from numpy.testing import assert_allclose -from astropy import units as u -import pint.toa import pint.simulation +import pint.toa from pint.models import get_model diff --git a/tests/test_parametercovariancematrix.py b/tests/test_parametercovariancematrix.py index 536b9183c..b91417e38 100644 --- a/tests/test_parametercovariancematrix.py +++ b/tests/test_parametercovariancematrix.py @@ -17,8 +17,8 @@ WLSFitter, ) from pint.models.model_builder import get_model -from pint.toa import get_TOAs from pint.simulation import make_fake_toas_uniform +from pint.toa import get_TOAs @pytest.fixture diff --git a/tests/test_plk_widget.py b/tests/test_plk_widget.py index 00f6cdb94..ca0817c0e 100644 --- a/tests/test_plk_widget.py +++ b/tests/test_plk_widget.py @@ -1,7 +1,9 @@ +from tkinter import Frame + import astropy.units as u import pytest + from pint.pintk.plk import PlkWidget -from tkinter import Frame @pytest.fixture diff --git a/tests/test_pulse_number.py b/tests/test_pulse_number.py index 9c880f5f3..e47d42c56 100644 --- a/tests/test_pulse_number.py +++ b/tests/test_pulse_number.py @@ -11,9 +11,9 @@ import pint.fitter from pint.models import get_model -from pint.toa import get_TOAs -from pint.simulation import make_fake_toas_uniform from pint.residuals import Residuals +from pint.simulation import make_fake_toas_uniform +from pint.toa import get_TOAs parfile = os.path.join(datadir, "withpn.par") timfile = os.path.join(datadir, "withpn.tim") diff --git a/tests/test_random_models.py b/tests/test_random_models.py index 5a167f181..4cb73eb43 100644 --- a/tests/test_random_models.py +++ b/tests/test_random_models.py @@ -7,15 +7,11 @@ # matplotlib.use('TKAgg') import matplotlib.pyplot as plt import numpy as np -import astropy.units as u - -from pint.models import get_model, get_model_and_toas -from pint import fitter, toa, simulation import pytest from pinttestdata import datadir import pint.models.parameter as param -from pint import fitter, ls, toa, utils +from pint import fitter, ls, simulation, toa, utils from pint.models import get_model, get_model_and_toas diff --git a/tests/test_residuals.py b/tests/test_residuals.py index 856d1944b..ac7547d1b 100644 --- a/tests/test_residuals.py +++ b/tests/test_residuals.py @@ -16,8 +16,8 @@ from pint.models import get_model from pint.models.dispersion_model import Dispersion from pint.residuals import CombinedResiduals, Residuals, WidebandTOAResiduals -from pint.toa import get_TOAs from pint.simulation import make_fake_toas_uniform +from pint.toa import get_TOAs from pint.utils import weighted_mean os.chdir(datadir) diff --git a/tests/test_solar_wind.py b/tests/test_solar_wind.py index 2e2cf08a0..c8db21849 100644 --- a/tests/test_solar_wind.py +++ b/tests/test_solar_wind.py @@ -14,9 +14,9 @@ from pinttestdata import datadir from pint.fitter import WidebandTOAFitter -from pint.toa import get_TOAs +from pint.models import get_model from pint.simulation import make_fake_toas_uniform -from pinttestdata import datadir +from pint.toa import get_TOAs os.chdir(datadir) diff --git a/tests/test_stigma.py b/tests/test_stigma.py index 686a46d6d..512da742a 100644 --- a/tests/test_stigma.py +++ b/tests/test_stigma.py @@ -6,14 +6,12 @@ import astropy.units as u import numpy as np import pytest -import tempfile - -from pint.models import get_model -import pint.toa as toa -import pint.simulation as simulation import test_derivative_utils as tdu from pinttestdata import datadir +import pint.simulation as simulation +import pint.toa as toa +from pint.models import get_model from pint.residuals import Residuals stigma_template = """ diff --git a/tests/test_timing_model.py b/tests/test_timing_model.py index 5146bc75c..20724c4b7 100644 --- a/tests/test_timing_model.py +++ b/tests/test_timing_model.py @@ -11,14 +11,15 @@ from pint.simulation import make_fake_toas_uniform from pint.toa import get_TOAs from astropy.time import Time +from pinttestdata import datadir from pint.models import ( DEFAULT_ORDER, AstrometryEquatorial, BinaryELL1, + PhaseJump, Spindown, TimingModel, - PhaseJump, Wave, get_model, parameter as p, diff --git a/tests/test_toa.py b/tests/test_toa.py index 18bfeb2e4..b624de8f4 100644 --- a/tests/test_toa.py +++ b/tests/test_toa.py @@ -9,8 +9,8 @@ from pint.models import get_model from pint.observatory import get_observatory -from pint.toa import TOA, TOAs from pint.simulation import make_fake_toas_uniform +from pint.toa import TOA, TOAs class TestTOA(unittest.TestCase): diff --git a/tests/test_toa_pickle.py b/tests/test_toa_pickle.py index 50327719b..fbc6f4e21 100644 --- a/tests/test_toa_pickle.py +++ b/tests/test_toa_pickle.py @@ -13,8 +13,7 @@ import pint.models import pint.toa -from pint import toa -from pint import simulation +from pint import simulation, toa @pytest.fixture diff --git a/tests/test_toa_reader.py b/tests/test_toa_reader.py index 09211001a..58dbc38e3 100644 --- a/tests/test_toa_reader.py +++ b/tests/test_toa_reader.py @@ -11,13 +11,10 @@ from astropy.utils.iers import conf from hypothesis import given from hypothesis.extra.numpy import arrays -from pint import toa, simulation -from pint.observatory import bipm_default -from pint.models import get_model, get_model_and_toas from hypothesis.strategies import floats, integers, sampled_from from pinttestdata import datadir -from pint import toa +from pint import simulation, toa from pint.models import get_model, get_model_and_toas from pint.observatory import bipm_default diff --git a/tests/test_toa_writer.py b/tests/test_toa_writer.py index 33a17f78d..5062bd5c4 100644 --- a/tests/test_toa_writer.py +++ b/tests/test_toa_writer.py @@ -8,12 +8,8 @@ from astropy.time import Time from pinttestdata import datadir +from pint import simulation, toa from pint.models import get_model -from pint import toa, simulation -from pinttestdata import datadir -from astropy.time import Time -import numpy as np -import astropy.units as u def test_roundtrip_bary_toa_Tempo2format(tmpdir):