diff --git a/tests/test_datafiles.py b/tests/test_datafiles.py index 4c693fe2a2..32e0fe0e4b 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 169b582d34..0978739413 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 cf306e1ae0..28e57dc609 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 f844dbafe5..747175d5aa 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 d4092542e2..d51cb52087 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 b306738be1..a3a6e55c95 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 bf6664e53b..d4aba4d261 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 cf4b46effb..03fd19642c 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 8c78590706..f641a5e840 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 be222c2857..fecfe0306a 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 8c13489639..eb23e4a6e2 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 536b9183c1..b91417e384 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 00f6cdb945..ca0817c0ea 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 9c880f5f3e..e47d42c56a 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 5a167f1817..4cb73eb433 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 856d1944b8..ac7547d1b1 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 2e2cf08a00..c8db218494 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 686a46d6d7..512da742ae 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 3c4beee6cf..351cf4bb7c 100644 --- a/tests/test_timing_model.py +++ b/tests/test_timing_model.py @@ -6,22 +6,22 @@ import astropy.units as u import numpy as np import pytest -from pinttestdata import datadir -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, ) +from pint.simulation import make_fake_toas_uniform +from pint.toa import get_TOAs @pytest.fixture diff --git a/tests/test_toa.py b/tests/test_toa.py index 18bfeb2e43..b624de8f4a 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 50327719bb..fbc6f4e217 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 09211001a6..58dbc38e34 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 33a17f78d1..5062bd5c4e 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):