Skip to content

Commit

Permalink
Merge pull request #1619 from abhisrkckl/profiler-dl-data
Browse files Browse the repository at this point in the history
Download data file automatically in `high_level_benchmark.py`
  • Loading branch information
dlakaplan authored Aug 17, 2023
2 parents 7938a93 + e9bf1c7 commit 458fd07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions profiling/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
J0740+6620.cfr+19.tim
bench_*_summary
11 changes: 10 additions & 1 deletion profiling/high_level_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys
import os
import platform
import urllib.request
from prfparser import parse_file


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 458fd07

Please sign in to comment.