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. 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)