From 2c06c623c5ba18238794c71ec5f808a972a1b528 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:11:12 -0400 Subject: [PATCH 1/2] Use Path --- benchmarks/benchmarks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index 34b5daf..837fbc0 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -5,7 +5,7 @@ For more information on writing benchmarks: https://asv.readthedocs.io/en/stable/writing_benchmarks.html.""" -import os +from pathlib import Path import numpy as np import tdastro @@ -20,16 +20,16 @@ def _load_test_passbands(): """Load passbands to use in various benchmarks.""" - passbands_dir = os.path.join(tdastro._TDASTRO_TEST_DATA_DIR, "passbands") + passbands_dir = Path(tdastro._TDASTRO_TEST_DATA_DIR, "passbands") passbands = PassbandGroup( passband_parameters=[ { "filter_name": "g", - "table_path": f"{passbands_dir}/LSST/g.dat", + "table_path": passbands_dir / "LSST" / "g.dat", }, { "filter_name": "r", - "table_path": f"{passbands_dir}/LSST/r.dat", + "table_path": passbands_dir / "LSST" / "r.dat", }, ], survey="LSST", From a018bdd9faff6c0d98e268739e5fb2a0c44cfb57 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 16 Oct 2024 08:02:51 -0400 Subject: [PATCH 2/2] Update benchmarks.py --- benchmarks/benchmarks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index 837fbc0..f671a66 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -5,8 +5,6 @@ For more information on writing benchmarks: https://asv.readthedocs.io/en/stable/writing_benchmarks.html.""" -from pathlib import Path - import numpy as np import tdastro from astropy import units as u @@ -20,7 +18,7 @@ def _load_test_passbands(): """Load passbands to use in various benchmarks.""" - passbands_dir = Path(tdastro._TDASTRO_TEST_DATA_DIR, "passbands") + passbands_dir = tdastro._TDASTRO_TEST_DATA_DIR / "passbands" passbands = PassbandGroup( passband_parameters=[ {