diff --git a/halotools/empirical_models/composite_models/hod_models/tests/test_zu_mandelbaum16.py b/halotools/empirical_models/composite_models/hod_models/tests/test_zu_mandelbaum16.py index 38a01a1f5..7498e739f 100644 --- a/halotools/empirical_models/composite_models/hod_models/tests/test_zu_mandelbaum16.py +++ b/halotools/empirical_models/composite_models/hod_models/tests/test_zu_mandelbaum16.py @@ -11,9 +11,9 @@ # This will be used to select tests whose # returned values depend on the configuration # of my personal cache directory files -from astropy.config.paths import _find_home +from pathlib import Path aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/empirical_models/factories/tests/test_hod_mock_factory.py b/halotools/empirical_models/factories/tests/test_hod_mock_factory.py index 5b6e66314..eab6086df 100644 --- a/halotools/empirical_models/factories/tests/test_hod_mock_factory.py +++ b/halotools/empirical_models/factories/tests/test_hod_mock_factory.py @@ -6,7 +6,7 @@ import numpy as np import pytest -from astropy.config.paths import _find_home +from pathlib import Path from ....custom_exceptions import HalotoolsError from ....empirical_models import ( @@ -26,7 +26,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/empirical_models/factories/tests/test_prebuilt_hod_model_factory.py b/halotools/empirical_models/factories/tests/test_prebuilt_hod_model_factory.py index ef01c67de..ee78d200d 100644 --- a/halotools/empirical_models/factories/tests/test_prebuilt_hod_model_factory.py +++ b/halotools/empirical_models/factories/tests/test_prebuilt_hod_model_factory.py @@ -4,7 +4,7 @@ import numpy as np import pytest -from astropy.config.paths import _find_home +from pathlib import Path from ...factories import PrebuiltHodModelFactory @@ -19,7 +19,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_biased_nfw/test_biased_nfw_consistency_mockpop.py b/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_biased_nfw/test_biased_nfw_consistency_mockpop.py index ac8d0ad5a..2e1bf48ea 100644 --- a/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_biased_nfw/test_biased_nfw_consistency_mockpop.py +++ b/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_biased_nfw/test_biased_nfw_consistency_mockpop.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np -from astropy.config.paths import _find_home +from pathlib import Path import pytest from ...biased_nfw_phase_space import BiasedNFWPhaseSpace @@ -17,7 +17,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_conc_mass_inheritance/test_direct_from_halo_catalog.py b/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_conc_mass_inheritance/test_direct_from_halo_catalog.py index 6427e0a94..e9aa148f6 100644 --- a/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_conc_mass_inheritance/test_direct_from_halo_catalog.py +++ b/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_conc_mass_inheritance/test_direct_from_halo_catalog.py @@ -17,9 +17,9 @@ # This will be used to select tests whose # returned values depend on the configuration # of my personal cache directory files -from astropy.config.paths import _find_home +from pathlib import Path aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_3d.py b/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_3d.py index e67adcf4b..744f409a3 100644 --- a/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_3d.py +++ b/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_3d.py @@ -5,7 +5,7 @@ import numpy as np import pytest from astropy.utils.misc import NumpyRNGContext -from astropy.config.paths import _find_home +from pathlib import Path from ..pairs import wnpairs as pure_python_weighted_pairs from ..marked_npairs_3d import marked_npairs_3d, _func_signature_int_from_wfunc @@ -30,7 +30,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_xy_z.py b/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_xy_z.py index ef483a871..f0a93bf20 100644 --- a/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_xy_z.py +++ b/halotools/mock_observables/pair_counters/test_pair_counters/test_marked_npairs_xy_z.py @@ -5,7 +5,7 @@ import numpy as np import pytest from astropy.utils.misc import NumpyRNGContext -from astropy.config.paths import _find_home +from pathlib import Path from ..pairs import xy_z_wnpairs as pure_python_weighted_pairs from ..marked_npairs_xy_z import marked_npairs_xy_z @@ -33,7 +33,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/mock_observables/pair_counters/test_pair_counters/test_npairs_3d.py b/halotools/mock_observables/pair_counters/test_pair_counters/test_npairs_3d.py index e010a33e5..b33c4293a 100644 --- a/halotools/mock_observables/pair_counters/test_pair_counters/test_npairs_3d.py +++ b/halotools/mock_observables/pair_counters/test_pair_counters/test_npairs_3d.py @@ -5,7 +5,7 @@ import numpy as np import pytest from astropy.utils.misc import NumpyRNGContext -from astropy.config.paths import _find_home +from pathlib import Path from ..npairs_3d import npairs_3d from ..pairs import npairs as pure_python_brute_force_npairs_3d @@ -22,7 +22,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/mock_observables/two_point_clustering/tests/locate_external_unit_testing_data.py b/halotools/mock_observables/two_point_clustering/tests/locate_external_unit_testing_data.py index 842d65faa..fcf50c20f 100644 --- a/halotools/mock_observables/two_point_clustering/tests/locate_external_unit_testing_data.py +++ b/halotools/mock_observables/two_point_clustering/tests/locate_external_unit_testing_data.py @@ -5,8 +5,8 @@ from __future__ import absolute_import, division, print_function, unicode_literals import os -from astropy.config.paths import _find_home -halotools_cache_dirname = os.path.join(_find_home(), '.astropy', 'cache', 'halotools') +from pathlib import Path +halotools_cache_dirname = os.path.join(Path.home(), '.astropy', 'cache', 'halotools') halotool_unit_testing_dirname = os.path.join(halotools_cache_dirname, 'unit_testing_files') diff --git a/halotools/sim_manager/__init__.py b/halotools/sim_manager/__init__.py index fb6123b4c..3bc4011c2 100644 --- a/halotools/sim_manager/__init__.py +++ b/halotools/sim_manager/__init__.py @@ -8,10 +8,10 @@ unicode_literals) import os -from astropy.config.paths import _find_home +from pathlib import Path try: - halotools_cache_dirname = os.path.join(_find_home(), '.astropy', 'cache', 'halotools') + halotools_cache_dirname = os.path.join(Path.home(), '.astropy', 'cache', 'halotools') os.makedirs(halotools_cache_dirname) except OSError: pass diff --git a/halotools/sim_manager/tests/helper_functions.py b/halotools/sim_manager/tests/helper_functions.py index 7fdadc2f0..92d5c09da 100644 --- a/halotools/sim_manager/tests/helper_functions.py +++ b/halotools/sim_manager/tests/helper_functions.py @@ -8,9 +8,9 @@ from astropy.table import Table from astropy.table import vstack as table_vstack -from astropy.config.paths import _find_home +from pathlib import Path -detected_home = _find_home() +detected_home = Path.home() __all__ = ('add_new_row_to_cache_log', ) diff --git a/halotools/sim_manager/tests/test_cached_halo_catalog.py b/halotools/sim_manager/tests/test_cached_halo_catalog.py index ed160faa1..a9ba81287 100644 --- a/halotools/sim_manager/tests/test_cached_halo_catalog.py +++ b/halotools/sim_manager/tests/test_cached_halo_catalog.py @@ -6,7 +6,7 @@ import shutil from unittest import TestCase -from astropy.config.paths import _find_home +from pathlib import Path from astropy.table import Table from astropy.tests.helper import pytest @@ -35,7 +35,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_download_manager.py b/halotools/sim_manager/tests/test_download_manager.py index ce0390d2a..0d75ab849 100644 --- a/halotools/sim_manager/tests/test_download_manager.py +++ b/halotools/sim_manager/tests/test_download_manager.py @@ -6,7 +6,7 @@ from unittest import TestCase import numpy as np -from astropy.config.paths import _find_home +from pathlib import Path from astropy.table import Table from astropy.tests.helper import pytest @@ -20,7 +20,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: @@ -32,7 +32,7 @@ class TestDownloadManager(TestCase): def setUp(self): - homedir = _find_home() + homedir = Path.home() self.downman = DownloadManager() diff --git a/halotools/sim_manager/tests/test_halo_table_cache.py b/halotools/sim_manager/tests/test_halo_table_cache.py index 972ba00d3..8407ec382 100644 --- a/halotools/sim_manager/tests/test_halo_table_cache.py +++ b/halotools/sim_manager/tests/test_halo_table_cache.py @@ -17,7 +17,7 @@ except ImportError: HAS_H5PY = False -from astropy.config.paths import _find_home +from pathlib import Path from . import helper_functions @@ -31,7 +31,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_halo_table_cache_log_entry.py b/halotools/sim_manager/tests/test_halo_table_cache_log_entry.py index 51d81f542..8e6374403 100644 --- a/halotools/sim_manager/tests/test_halo_table_cache_log_entry.py +++ b/halotools/sim_manager/tests/test_halo_table_cache_log_entry.py @@ -12,7 +12,7 @@ from astropy.table import Table -from astropy.config.paths import _find_home +from pathlib import Path try: import h5py @@ -28,7 +28,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_load_default_halocat.py b/halotools/sim_manager/tests/test_load_default_halocat.py index add483cae..8ec369b99 100644 --- a/halotools/sim_manager/tests/test_load_default_halocat.py +++ b/halotools/sim_manager/tests/test_load_default_halocat.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals -from astropy.config.paths import _find_home +from pathlib import Path import pytest from ..cached_halo_catalog import CachedHaloCatalog @@ -13,7 +13,7 @@ from ...utils.python_string_comparisons import compare_strings_py23_safe aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_ptcl_table_cache.py b/halotools/sim_manager/tests/test_ptcl_table_cache.py index 009c859f4..96a9433d2 100644 --- a/halotools/sim_manager/tests/test_ptcl_table_cache.py +++ b/halotools/sim_manager/tests/test_ptcl_table_cache.py @@ -16,7 +16,7 @@ except ImportError: HAS_H5PY = False -from astropy.config.paths import _find_home +from pathlib import Path from astropy.table import Table from . import helper_functions @@ -33,7 +33,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_ptcl_table_cache_log_entry.py b/halotools/sim_manager/tests/test_ptcl_table_cache_log_entry.py index e13cde2fd..65a4cf300 100644 --- a/halotools/sim_manager/tests/test_ptcl_table_cache_log_entry.py +++ b/halotools/sim_manager/tests/test_ptcl_table_cache_log_entry.py @@ -15,7 +15,7 @@ except ImportError: HAS_H5PY = False -from astropy.config.paths import _find_home +from pathlib import Path from . import helper_functions from ..ptcl_table_cache_log_entry import PtclTableCacheLogEntry @@ -25,7 +25,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_rockstar_hlist_reader.py b/halotools/sim_manager/tests/test_rockstar_hlist_reader.py index ee0c8dbd7..fb4e1a11c 100644 --- a/halotools/sim_manager/tests/test_rockstar_hlist_reader.py +++ b/halotools/sim_manager/tests/test_rockstar_hlist_reader.py @@ -9,7 +9,7 @@ import pytest from astropy.table import Table from astropy.utils.misc import NumpyRNGContext -from astropy.config.paths import _find_home +from pathlib import Path from astropy.utils.data import get_pkg_data_filename from collections import OrderedDict @@ -30,7 +30,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: @@ -59,7 +59,7 @@ class TestRockstarHlistReader(TestCase): def setUp(self): - self.tmpdir = os.path.join(_find_home(), '.tmp_testingdir') + self.tmpdir = os.path.join(Path.home(), '.tmp_testingdir') try: os.makedirs(self.tmpdir) except OSError: diff --git a/halotools/sim_manager/tests/test_supported_sims.py b/halotools/sim_manager/tests/test_supported_sims.py index 957962f20..870f74327 100644 --- a/halotools/sim_manager/tests/test_supported_sims.py +++ b/halotools/sim_manager/tests/test_supported_sims.py @@ -4,7 +4,7 @@ import numpy as np import pytest -from astropy.config.paths import _find_home +from pathlib import Path from ...custom_exceptions import HalotoolsError from ..cached_halo_catalog import CachedHaloCatalog, InvalidCacheLogEntry @@ -12,7 +12,7 @@ slow = pytest.mark.slow aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_tabular_ascii_reader.py b/halotools/sim_manager/tests/test_tabular_ascii_reader.py index b6565b3f9..3ce86567c 100644 --- a/halotools/sim_manager/tests/test_tabular_ascii_reader.py +++ b/halotools/sim_manager/tests/test_tabular_ascii_reader.py @@ -7,7 +7,7 @@ import pytest from astropy.table import Table -from astropy.config.paths import _find_home +from pathlib import Path from ..tabular_ascii_reader import TabularAsciiReader @@ -17,7 +17,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: @@ -39,7 +39,7 @@ class TestTabularAsciiReader(TestCase): def setUp(self): - self.tmpdir = os.path.join(_find_home(), '.temp_halotools_testing_dir') + self.tmpdir = os.path.join(Path.home(), '.temp_halotools_testing_dir') try: os.makedirs(self.tmpdir) except OSError: diff --git a/halotools/sim_manager/tests/test_user_supplied_halo_catalog.py b/halotools/sim_manager/tests/test_user_supplied_halo_catalog.py index ca918b391..91054fc13 100644 --- a/halotools/sim_manager/tests/test_user_supplied_halo_catalog.py +++ b/halotools/sim_manager/tests/test_user_supplied_halo_catalog.py @@ -7,7 +7,7 @@ import os import shutil -from astropy.config.paths import _find_home +from pathlib import Path import pytest try: @@ -35,7 +35,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/sim_manager/tests/test_user_supplied_ptcl_catalog.py b/halotools/sim_manager/tests/test_user_supplied_ptcl_catalog.py index 55831005c..c0a1429c8 100644 --- a/halotools/sim_manager/tests/test_user_supplied_ptcl_catalog.py +++ b/halotools/sim_manager/tests/test_user_supplied_ptcl_catalog.py @@ -6,7 +6,7 @@ import os import shutil -from astropy.config.paths import _find_home +from pathlib import Path import pytest try: @@ -32,7 +32,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = '/Users/aphearin' -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: diff --git a/halotools/tests/docs_code_block_tests/test_preloaded_mockpop.py b/halotools/tests/docs_code_block_tests/test_preloaded_mockpop.py index ba2703625..a150033cc 100644 --- a/halotools/tests/docs_code_block_tests/test_preloaded_mockpop.py +++ b/halotools/tests/docs_code_block_tests/test_preloaded_mockpop.py @@ -3,7 +3,7 @@ to ensure the still get executed. """ import numpy as np -from astropy.config.paths import _find_home +from pathlib import Path from ...sim_manager import FakeSim from ...empirical_models import PrebuiltHodModelFactory, PrebuiltSubhaloModelFactory @@ -13,7 +13,7 @@ # returned values depend on the configuration # of my personal cache directory files aph_home = "/Users/aphearin" -detected_home = _find_home() +detected_home = Path.home() if aph_home == detected_home: APH_MACHINE = True else: