From c2d1c87a8e61fa94717af04965ac61f4ee928b17 Mon Sep 17 00:00:00 2001 From: Abhimanyu Susobhanan Date: Thu, 17 Aug 2023 10:31:08 -0500 Subject: [PATCH 1/2] download data file automatically --- profiling/.gitignore | 2 ++ profiling/high_level_benchmark.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 profiling/.gitignore diff --git a/profiling/.gitignore b/profiling/.gitignore new file mode 100644 index 000000000..f07669415 --- /dev/null +++ b/profiling/.gitignore @@ -0,0 +1,2 @@ +J0740+6620.cfr+19.tim +bench_*_summary \ No newline at end of file diff --git a/profiling/high_level_benchmark.py b/profiling/high_level_benchmark.py index 9049b7926..d9c8ad5d2 100644 --- a/profiling/high_level_benchmark.py +++ b/profiling/high_level_benchmark.py @@ -16,6 +16,7 @@ import sys import os import platform +import urllib.request from prfparser import parse_file @@ -67,11 +68,19 @@ def get_results(script, outfile): parser = argparse.ArgumentParser( description="High-level summary of python file timing." ) + + if not os.path.isfile("J0740+6620.cfr+19.tim"): + print("Downloading data file J0740+6620.cfr+19.tim ...") + urllib.request.urlretrieve( + "https://data.nanograv.org/static/data/J0740+6620.cfr+19.tim", + "J0740+6620.cfr+19.tim", + ) + + script1 = "bench_load_TOAs.py" script2 = "bench_chisq_grid.py" script3 = "bench_chisq_grid_WLSFitter.py" script4 = "bench_MCMC.py" - script1 = "bench_load_TOAs.py" # time scripts output1 = bench_file(script1) output2 = bench_file(script2) From e9bf1c7f5a5913d33c651ed53d753f90d02472f3 Mon Sep 17 00:00:00 2001 From: Abhimanyu Susobhanan Date: Thu, 17 Aug 2023 10:35:00 -0500 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40081dcee..57f52f546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ the unreleased changes. This file should only be changed while tagging a new ver - Unreleased CHANGELOG entries should now be entered in `CHANGELOG-unreleased.md` instead of `CHANGELOG.md`. Updated documentation accordingly. - Changed tests to remove `unittest` and use pure pytest format - Changed deprecated `sampler.chain` usage +- Download data automatically in the profiling script `high_level_benchmark.py` instead of silently giving wrong results. ### Added - `SpindownBase` as the abstract base class for `Spindown` and `PeriodSpindown` in the `How_to_build_a_timing_model_component.py` example. - `SolarWindDispersionBase` as the abstract base class for solar wind dispersion components.