Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
28453c5
Add PINT autofitter option
tcromartie May 7, 2024
c24f101
Merge pull request #60 from nanograv/feature/autofitter
rossjjennings May 7, 2024
d68ecab
Also run tests on PRs targeting NG20 branch
rossjjennings May 7, 2024
e831c12
Add config module
rossjjennings May 8, 2024
a726635
Replace one last instance of pint_pal.defaults
rossjjennings May 8, 2024
5ee27a7
Actually use DATA_ROOT to resolve paths
rossjjennings May 8, 2024
37794c4
Can't import config vars directly
rossjjennings May 9, 2024
964e4ec
Resolve paths according to latest config
rossjjennings May 9, 2024
6a7c214
Resolve paths using current config
rossjjennings May 9, 2024
29dfcc7
Use set_data_root() in tests
rossjjennings May 9, 2024
ae80f8d
Convert DATA_ROOT into absolute path
rossjjennings May 9, 2024
778075e
set_data_root(): add reset, allow ~ in paths
rossjjennings May 9, 2024
e898655
Accept ~ in YAML path too
rossjjennings May 9, 2024
63c2725
Merge pull request #62 from nanograv/ng20-tests
JPGlaser May 9, 2024
c64aada
Merge remote-tracking branch 'origin/NG20' into feature/data-repo-config
rossjjennings May 9, 2024
6dfec40
Merge pull request #63 from nanograv/feature/data-repo-config
tcromartie May 9, 2024
6637bf0
Don't let tc barf if excise-tim is there but unset
tcromartie Jun 13, 2024
d895ab7
Merge pull request #65 from nanograv/feature/excisetim_fix
rossjjennings Jun 13, 2024
f599064
Merge pull request #68 from nanograv/tcb2tdb_hotfix
rossjjennings Jul 25, 2024
4b33ffa
add convert_tcb2tdb=False flags
Aug 10, 2024
5f93bda
Merge pull request #72 from nanograv/tcb2tdb_noise_utils_hotfix
JPGlaser Aug 15, 2024
2ca0f35
tcb2tdb fix in lite_utils
Aug 19, 2024
1d2a0d8
Merge pull request #73 from nanograv/tcb2tdb_lite_utils_hotfix
rossjjennings Aug 19, 2024
90cec1d
add VEGAS to plot_utils
Aug 20, 2024
5f1fd30
add VEGAS marker styles
Aug 20, 2024
e860e5b
Merge pull request #74 from nanograv/feature/vegas_colors
tcromartie Aug 20, 2024
4ed9834
More VEGAS defaults, pta no longer default scheme
tcromartie Aug 22, 2024
a7cff71
Take out print statements for testing
tcromartie Aug 22, 2024
01b0f99
allow bin_width as argument to setup_dmx; introduce type hinting
Aug 23, 2024
137f5e8
switch | to Union for earlier python support
Aug 23, 2024
294b864
switch | to Union for earlier python support
Aug 23, 2024
768d017
Merge pull request #75 from nanograv/feature/vegasplotcolor
mtlam Aug 23, 2024
382c240
Merge pull request #76 from nanograv/feature/dmx_bin_argument
rossjjennings Aug 23, 2024
b86c019
Merge remote-tracking branch 'nanograv/NG20' into NG20
Aug 25, 2024
816599a
adding a gibbs sampler for noise analyses
Aug 25, 2024
d609d11
i initially added the wrong version of the gibbs sampler -- lol
Aug 25, 2024
3e4629e
adding gibbs to noise_utils
jeremy-baier Aug 25, 2024
14f848b
un-hard-coding model inclusion
jeremy-baier Aug 25, 2024
2be8f09
fix sampler import bug
jeremy-baier Aug 28, 2024
6eb337e
initial changes to plot_utils incl. adding plot_settings.yaml
tcromartie Sep 4, 2024
0d652e4
Removed commented entries from yaml
tcromartie Sep 4, 2024
f30616e
moving gibbs sampler to enterprise extensions; adding some initial di…
jeremy-baier Sep 11, 2024
8c6a839
getting back onnnit
jeremy-baier Oct 18, 2024
86c8c74
adding discovery to noise utils
jeremy-baier Oct 18, 2024
8fd746b
commiting what i have rn
jeremy-baier Oct 19, 2024
f0aa78d
adding solar wind stuff
jeremy-baier Oct 20, 2024
7920c13
bug fixes
Oct 21, 2024
7a0b140
more bug fix
Oct 21, 2024
59c890d
swapping some kwargs & adding some logs
Oct 22, 2024
16bfa71
random fixes
Oct 23, 2024
70b846f
Transfering new fix.
JPGlaser Oct 24, 2024
48d323a
Adding uploading to commits.
JPGlaser Oct 24, 2024
2d812e5
Merge pull request #85 from nanograv/hotfix/ng20-tests
rossjjennings Oct 24, 2024
3218cc3
Fix setter function names
rossjjennings Oct 24, 2024
60ce16d
fix list comprehension in apply_ignore() for poor-febe check
Sep 27, 2024
d37f9af
Merge pull request #80 from nanograv/hotfix/apply_ignore_poor_febe
JPGlaser Oct 30, 2024
e348aa8
Merge pull request #86 from nanograv/hotfix/setter-functions
JPGlaser Oct 30, 2024
336414b
Merge pull request #78 from nanograv/feature/plot_utils_fix1
mtlam Nov 1, 2024
88cbb27
Merge branch 'main' into NG20
JPGlaser Nov 18, 2024
5e7e419
Adjusting to deal with the `created_time` bug introduced in `pint@v1.1`.
JPGlaser Nov 18, 2024
760f230
Fixing syntax error in pint_pulsar versioning by pinning the version …
JPGlaser Nov 18, 2024
19f9731
Merge pull request #88 from nanograv/NG20
rossjjennings Nov 26, 2024
00b1b59
Merge branch 'nanograv:main' into feature/gibbs_sampler
jeremy-baier Nov 26, 2024
993ae5e
Update pyproject.toml to fix missing plot_settings.yaml
golamshaifullah Dec 5, 2024
d842420
Merge pull request #91 from golamshaifullah/patch-plot-settings-yaml
rossjjennings Dec 10, 2024
6a64600
Avoid slicing toas objects
rossjjennings Dec 11, 2024
c92a175
Fix call sites
rossjjennings Dec 11, 2024
997879d
Slice after array conversion
rossjjennings Dec 11, 2024
2520c2c
Let Numpy do the mins and maxes
rossjjennings Dec 11, 2024
54f964e
Add initial values
rossjjennings Dec 11, 2024
bf81a06
Also avoid slicing TOAs for log messages
rossjjennings Dec 13, 2024
ac2335a
Merge branch 'nanograv:main' into feature/gibbs_sampler
jeremy-baier Dec 17, 2024
2597a7a
move import try/except; add empirical distributions
Dec 17, 2024
5d1e58f
pulling changes to master
Dec 17, 2024
5029029
fix typo
Dec 17, 2024
e316f56
add laforge, arviz to pyproject.toml
Dec 17, 2024
e2dae64
changes to noise utils
Dec 17, 2024
6fbeef6
fixing stuff in noise utils
Dec 17, 2024
1cd26cf
Merge pull request #93 from nanograv/hotfix/faster-setup-dmx
JPGlaser Dec 17, 2024
a5f421f
Moving "created_time" to the meta attribute of PINT.TimingModel
JPGlaser Dec 18, 2024
f3f4c2e
Update to use new version of PINT.
JPGlaser Dec 18, 2024
1eac987
Fix syntax to use ' instead of "
JPGlaser Dec 18, 2024
40162e5
Switching m.file_mtime to be a key of m.meta
JPGlaser Dec 18, 2024
a4c204a
Change model.noise_mtime to be a key inside of model.meta
JPGlaser Dec 18, 2024
4b2c5cb
Update to require PINT>=1.1.1 and use notebook over jupyter.
JPGlaser Dec 18, 2024
703613d
Merge pull request #95 from nanograv/hotfix/use-metadata
rossjjennings Dec 18, 2024
7d7fda6
updating to la-forge in the pyproject
Dec 18, 2024
e2077f0
changing test nb
Dec 18, 2024
ff32910
change enterprise to lowercase; add noise_run section to test config …
Dec 19, 2024
fe1aaf5
delete 'num noise iter' from notebook
Dec 19, 2024
382110c
fixing SW GP in addition to noise model
Dec 19, 2024
738a06e
Added a few frozen params to frozen ignore list
tcromartie Feb 17, 2025
a79c1f7
Get rid of bad warnings for noise chain directories
tcromartie Feb 18, 2025
7264d93
Reverted behavior of noise chain search, changed date format in PDF f…
tcromartie Feb 19, 2025
a80a7c9
Allow for noise date directories of format YYYY-MM-DD(a,b,c,etc.). Di…
tcromartie Feb 20, 2025
8bf6c55
Support for home directory nosie runs
tcromartie Feb 25, 2025
5279fe0
Merge pull request #97 from nanograv/feature/QOL/htc
rossjjennings Feb 25, 2025
8c63ad5
Add fastshermanmorrison to requirements
rossjjennings Mar 2, 2025
760d3f0
Merge pull request #101 from nanograv/feature/fastshermanmorrison
JPGlaser Mar 3, 2025
887b0be
pulling and resolving merge conflicts in pyproject, noise_utils
jeremy-baier Mar 6, 2025
9630b40
yonking the discovery changes into another PR
jeremy-baier Mar 6, 2025
c37dc33
fix notebook; fix typo in nu
jeremy-baier Mar 6, 2025
c3094f1
add mean large likelihoods function; implementation errors
jeremy-baier Mar 6, 2025
7cac3ff
10->50 likelihoods to average
jeremy-baier Mar 6, 2025
01b96e3
remove dmgp compatibility :(
jeremy-baier Mar 7, 2025
73db40c
add extra prints
jeremy-baier Mar 7, 2025
0ecc3aa
turns out you cant make empirical distributions like that
jeremy-baier Mar 7, 2025
2ee428f
removing chain accept
jeremy-baier Mar 7, 2025
1502c84
removing lnlike
jeremy-baier Mar 7, 2025
537040e
fix bug
jeremy-baier Mar 7, 2025
7e13871
fix bug
jeremy-baier Mar 7, 2025
9ef6bb3
fix bug
jeremy-baier Mar 7, 2025
036a167
fix bug
jeremy-baier Mar 7, 2025
b367d3c
fix bug
jeremy-baier Mar 7, 2025
18b4a6c
extra logger statements
jeremy-baier Mar 7, 2025
ec807c3
adding legend to fig
Mar 7, 2025
3cc6679
fix bug in chain comparison
Mar 7, 2025
d068f9a
Merge pull request #77 from jeremy-baier/feature/gibbs_sampler
rossjjennings Mar 7, 2025
85ec7d9
Quick fix for finding old noise runs
tcromartie Mar 10, 2025
68500e4
Fixed recentness checking to handle cases outside the expected noise-…
tcromartie Mar 10, 2025
b5bde65
Changed warning-->info for non-standard directory case
tcromartie Mar 10, 2025
a199d07
Merge pull request #103 from nanograv/feature/noise_hotfix/htc
rossjjennings Mar 11, 2025
f21d709
Added path to noise-dir warnings. See simultaneous MR in NG20 repo (n…
tcromartie Mar 11, 2025
c9c1ae5
Merge pull request #104 from nanograv/feature/log_hotfix/htc
rossjjennings Mar 11, 2025
d16e658
fix integer bug
Mar 14, 2025
1849ffd
add print statements
Mar 14, 2025
de53cfd
adding single likelihood evaluation timer
Mar 14, 2025
e3e425d
rename empirical distribuition key
Mar 14, 2025
98175ec
add additional instructions for adding empirical distributions
Mar 14, 2025
a32ddc6
Merge pull request #105 from jeremy-baier/bug-fix/noise-updates-patch
scottransom Mar 14, 2025
4b74b21
Add PINT autofitter option
tcromartie May 7, 2024
d50b83a
Add config module
rossjjennings May 8, 2024
5c18585
Replace one last instance of pint_pal.defaults
rossjjennings May 8, 2024
37d8c09
Actually use DATA_ROOT to resolve paths
rossjjennings May 8, 2024
f34f281
Can't import config vars directly
rossjjennings May 9, 2024
2962884
Resolve paths according to latest config
rossjjennings May 9, 2024
d0b6312
Resolve paths using current config
rossjjennings May 9, 2024
87536aa
Use set_data_root() in tests
rossjjennings May 9, 2024
75d6db6
Convert DATA_ROOT into absolute path
rossjjennings May 9, 2024
49db4ea
set_data_root(): add reset, allow ~ in paths
rossjjennings May 9, 2024
774580b
Accept ~ in YAML path too
rossjjennings May 9, 2024
4fbf2c7
Also run tests on PRs targeting NG20 branch
rossjjennings May 7, 2024
cf52288
Don't let tc barf if excise-tim is there but unset
tcromartie Jun 13, 2024
a51814d
add convert_tcb2tdb=False flags
Aug 10, 2024
2d28f50
tcb2tdb fix in lite_utils
Aug 19, 2024
2bdcc05
add VEGAS to plot_utils
Aug 20, 2024
726c7a0
add VEGAS marker styles
Aug 20, 2024
76a0cf6
More VEGAS defaults, pta no longer default scheme
tcromartie Aug 22, 2024
bdb8d8f
Take out print statements for testing
tcromartie Aug 22, 2024
21fab4e
allow bin_width as argument to setup_dmx; introduce type hinting
Aug 23, 2024
becf6a9
switch | to Union for earlier python support
Aug 23, 2024
a9ff97b
switch | to Union for earlier python support
Aug 23, 2024
1cdd9f7
adding a gibbs sampler for noise analyses
Aug 25, 2024
39e7202
i initially added the wrong version of the gibbs sampler -- lol
Aug 25, 2024
1a9de59
adding gibbs to noise_utils
jeremy-baier Aug 25, 2024
44f63c3
un-hard-coding model inclusion
jeremy-baier Aug 25, 2024
0e83379
fix sampler import bug
jeremy-baier Aug 28, 2024
841cb8e
moving gibbs sampler to enterprise extensions; adding some initial di…
jeremy-baier Sep 11, 2024
467b6fa
getting back onnnit
jeremy-baier Oct 18, 2024
1579c74
adding discovery to noise utils
jeremy-baier Oct 18, 2024
df7c03c
commiting what i have rn
jeremy-baier Oct 19, 2024
096ef57
adding solar wind stuff
jeremy-baier Oct 20, 2024
ebc6283
bug fixes
Oct 21, 2024
feeddc9
more bug fix
Oct 21, 2024
583fe3e
swapping some kwargs & adding some logs
Oct 22, 2024
144f570
random fixes
Oct 23, 2024
c4d3ab2
move import try/except; add empirical distributions
Dec 17, 2024
d0f37b9
Transfering new fix.
JPGlaser Oct 24, 2024
a689d2b
fix list comprehension in apply_ignore() for poor-febe check
Sep 27, 2024
69a25d1
Fix setter function names
rossjjennings Oct 24, 2024
00c2a4d
initial changes to plot_utils incl. adding plot_settings.yaml
tcromartie Sep 4, 2024
99b7a69
Removed commented entries from yaml
tcromartie Sep 4, 2024
ec37c29
Fixing syntax error in pint_pulsar versioning by pinning the version …
JPGlaser Nov 18, 2024
861534b
Update pyproject.toml to fix missing plot_settings.yaml
golamshaifullah Dec 5, 2024
a321ac1
fix typo
Dec 17, 2024
329d0fd
add laforge, arviz to pyproject.toml
Dec 17, 2024
3446447
changes to noise utils
Dec 17, 2024
edb1f1c
fixing stuff in noise utils
Dec 17, 2024
5f39b56
updating to la-forge in the pyproject
Dec 18, 2024
91c5350
changing test nb
Dec 18, 2024
7728611
change enterprise to lowercase; add noise_run section to test config …
Dec 19, 2024
010a263
delete 'num noise iter' from notebook
Dec 19, 2024
8f4275b
fixing SW GP in addition to noise model
Dec 19, 2024
bb34a95
Avoid slicing toas objects
rossjjennings Dec 11, 2024
e22bbe2
Fix call sites
rossjjennings Dec 11, 2024
3d52152
Slice after array conversion
rossjjennings Dec 11, 2024
573e7f7
Let Numpy do the mins and maxes
rossjjennings Dec 11, 2024
76603ae
Add initial values
rossjjennings Dec 11, 2024
1e93d15
Also avoid slicing TOAs for log messages
rossjjennings Dec 13, 2024
da3b9af
Update to use new version of PINT.
JPGlaser Dec 18, 2024
5770351
Added a few frozen params to frozen ignore list
tcromartie Feb 17, 2025
8418456
Get rid of bad warnings for noise chain directories
tcromartie Feb 18, 2025
9091b6c
Reverted behavior of noise chain search, changed date format in PDF f…
tcromartie Feb 19, 2025
010c8dd
Allow for noise date directories of format YYYY-MM-DD(a,b,c,etc.). Di…
tcromartie Feb 20, 2025
dc0039e
Support for home directory nosie runs
tcromartie Feb 25, 2025
eb0c8e9
Add fastshermanmorrison to requirements
rossjjennings Mar 2, 2025
b373889
yonking the discovery changes into another PR
jeremy-baier Mar 6, 2025
5fbf664
fix notebook; fix typo in nu
jeremy-baier Mar 6, 2025
68ec8e6
add mean large likelihoods function; implementation errors
jeremy-baier Mar 6, 2025
67e88e7
10->50 likelihoods to average
jeremy-baier Mar 6, 2025
3603c4f
remove dmgp compatibility :(
jeremy-baier Mar 7, 2025
a7bc128
add extra prints
jeremy-baier Mar 7, 2025
819f9f6
turns out you cant make empirical distributions like that
jeremy-baier Mar 7, 2025
a9f85c5
removing chain accept
jeremy-baier Mar 7, 2025
acabed9
removing lnlike
jeremy-baier Mar 7, 2025
08d0751
fix bug
jeremy-baier Mar 7, 2025
2ba70e3
fix bug
jeremy-baier Mar 7, 2025
5caf7dd
fix bug
jeremy-baier Mar 7, 2025
48fafbf
fix bug
jeremy-baier Mar 7, 2025
c186e32
fix bug
jeremy-baier Mar 7, 2025
2e8bc47
extra logger statements
jeremy-baier Mar 7, 2025
eebeecf
adding legend to fig
Mar 7, 2025
d47da30
fix bug in chain comparison
Mar 7, 2025
1ec7a3a
Quick fix for finding old noise runs
tcromartie Mar 10, 2025
9e1ac7c
Fixed recentness checking to handle cases outside the expected noise-…
tcromartie Mar 10, 2025
9e9abd2
Changed warning-->info for non-standard directory case
tcromartie Mar 10, 2025
1781e1e
Added path to noise-dir warnings. See simultaneous MR in NG20 repo (n…
tcromartie Mar 11, 2025
0854e3e
fix integer bug
Mar 14, 2025
269fc96
add print statements
Mar 14, 2025
538a579
adding single likelihood evaluation timer
Mar 14, 2025
755ba75
rename empirical distribuition key
Mar 14, 2025
a854302
add additional instructions for adding empirical distributions
Mar 14, 2025
51b47be
Added LOFAR, NenuFaR, CPTA colors. Changed CHIME color
gooddc Jul 17, 2025
90139fd
Resolved merge conflicts with plot settings and pyproject.toml
gooddc Jul 29, 2025
f95c71c
Resolved additional merge conflict in pyproject.toml
gooddc Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
39 changes: 38 additions & 1 deletion .github/workflows/test_notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@ on:
pull_request:
branches:
- main
- NG20

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # Once we get the tex packages changed, we should include "macos-13"
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest] # Once we get the tex packages changed, we should include "macos-13"
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Install Required Ubuntu Packages
- name: Install Required Ubuntu Packages
run: |
sudo apt-get update
sudo apt-get install texlive-latex-base cm-super-minimal pdftk latex2html
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
Expand All @@ -49,6 +56,31 @@ jobs:
jupyter
seaborn
gitpython
- name: Install Main Code
init-shell: bash
environment-name: pulsar
cache-environment: true
cache-downloads: true
create-args: >-
-c conda-forge
python=${{ matrix.python-version }}
pytest
cython
pint-pulsar
tempo2
libstempo
enterprise-pulsar
enterprise_extensions
scikit-sparse
scikit-learn
ruamel.yaml
nbconvert
ipywidgets>=7.6.3
weasyprint
pytest-xdist>=2.3.0
jupyter
seaborn
gitpython
- name: Install Main Code
shell: bash -el {0}
run: |
Expand All @@ -61,13 +93,18 @@ jobs:
pytest tests/test_run_notebook.py -k $PULSAR_NAME
ls -lah
mv tmp* nb_outputs
export JUPYTER_PLATFORM_DIRS=1
pytest tests/test_run_notebook.py -k $PULSAR_NAME
ls -lah
mv tmp* nb_outputs
- name: Archive Notebook Output Files
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
with:
name: TestNB-OutputFiles_${{ matrix.python-version }}_${{ matrix.os }}_${{ steps.date.outputs.date }}
name: TestNB-OutputFiles_${{ matrix.python-version }}_${{ matrix.os }}_${{ steps.date.outputs.date }}
path: |
nb_outputs/*/*.pdf
nb_outputs/*/*.tim
nb_outputs/*/*.par
compression-level: 6

2 changes: 1 addition & 1 deletion nb_templates/process_v1.1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
" # to temporarily address current inconsistency between enterprise <= v3.1.0 and pint implementations\n",
" mo_new = lu.convert_enterprise_equads(mo_new)\n",
" \n",
" except OSError as e:\n",
" except (OSError, ValueError) as e:\n",
" log.warning(f\"Unable to read noise chains from {tc.get_noise_dir()}: {e}\")\n",
" else:\n",
" mo = mo_new\n",
Expand Down
10 changes: 7 additions & 3 deletions nb_templates/process_v1.2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"autorun = False\n",
"run_Ftest = True # Set to False if you don't need F-tests and want a faster notebook run!\n",
"check_excision = True\n",
"num_noise_iter = 2e5\n",
"\n",
"if not autorun:\n",
" run_noise_analysis = False \n",
Expand Down Expand Up @@ -257,12 +256,17 @@
"if run_noise_analysis or use_existing_noise_dir:\n",
" mo_new = copy.deepcopy(mo)\n",
" lu.remove_noise(mo_new)\n",
" nu.model_noise(mo_new, to, using_wideband = using_wideband, run_noise_analysis = run_noise_analysis, n_iter = num_noise_iter)\n",
" nu.model_noise(mo_new, to,\n",
" using_wideband = using_wideband,\n",
" run_noise_analysis = run_noise_analysis,\n",
" model_kwargs=tc.config['noise_run']['model'],\n",
" sampler_kwargs=tc.config['noise_run']['inference'],\n",
" )\n",
" try:\n",
" mo_new = nu.add_noise_to_model(mo_new, using_wideband = using_wideband, base_dir=tc.get_noise_dir(), \n",
" compare_dir=tc.get_compare_noise_dir(), no_corner_plot=tc.get_no_corner())\n",
" \n",
" except OSError as e:\n",
" except (OSError, ValueError) as e:\n",
" log.warning(f\"Unable to read noise chains from {tc.get_noise_dir()}: {e}\")\n",
" else:\n",
" mo = mo_new\n",
Expand Down
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ authors = [
{ name="Anne Archibald", email="anne.archibald@nanograv.org" },
{ name="Kevin Wilson", email="kevin.wilson@nanograv.org" },
{ name="Ross Jennings", email="ross.jennings@nanograv.org" },
{ name="Jeremy Baier", email="jeremy.baier@nanograv.org"}
]
description = "A long-lived repository for NANOGrav Pulsar Timing analysis work."
readme = "README.md"
Expand All @@ -31,14 +32,19 @@ dependencies = [
"pytest-xdist[psutil]>=2.3.0",
"notebook",
"seaborn",
"gitpython",
"la-forge",
"arviz",
"fastshermanmorrison-pulsar",
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[tool.setuptools.package-data]
pint_pal = ["defaults.yaml", "plot_settings.yaml"]

[project.urls]
"Homepage" = "https://github.com/nanograv/pint_pal"
"Bug Tracker" = "https://github.com/nanograv/pint_pal/issues"
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions src/pint_pal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pint_pal.checkin
import pint_pal.config
from pint_pal.config import set_data_root, reset_data_root

from . import _version
__version__ = _version.get_versions()['version']
69 changes: 69 additions & 0 deletions src/pint_pal/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from ruamel.yaml import YAML
import os.path
yaml = YAML(typ='safe')
PACKAGE_DIR = os.path.dirname(__file__)
DATA_ROOT = '.'

def set_data_root(path):
"""
Set the root directory of the data repository to be used with PINT Pal.
PINT Pal will search this directory for a configuration file specifying settings
such as the appropriate JPL ephemeris and version of TT(BIPM) to check for when
validating timing models.

It will also be treated as the base directory when resolving paths in YAML
configuration files. This allows notebooks (or scripts) using YAML files within
the data repository, which specify paths relative to the data root, to be run
from other locations.

The default value of `data_root` is '.' (the current working directory), which
is sufficient in cases where either (1) no data repository is in use, or
(2) all scripts and notebooks are run from the root of the data repository.
"""
global DATA_ROOT
DATA_ROOT = os.path.realpath(os.path.expanduser(path))
try:
read_config_file(os.path.join(DATA_ROOT, 'pint_pal_project.yaml'))
except FileNotFoundError:
pass

def reset_data_root():
"""
Reset the data root and config variables to the default values.
"""
global DATA_ROOT
DATA_ROOT = '.'
read_config_file(os.path.join(PACKAGE_DIR, 'defaults.yaml'))

def read_config_file(config_file):
"""
Read a configuration file, along the lines of `defaults.yaml`, and load the results
into a location that can be accessed by other PINT Pal code.
"""
with open(config_file, 'r') as f:
config = yaml.load(f)

global LATEST_BIPM
global LATEST_EPHEM
global PLANET_SHAPIRO
global CORRECT_TROPOSPHERE
global FREQUENCY_RATIO
global MAX_SOLARWIND_DELAY
global LATEST_TOA_RELEASE

if 'LATEST_BIPM' in config:
LATEST_BIPM = config['LATEST_BIPM']
if 'LATEST_EPHEM' in config:
LATEST_EPHEM = config['LATEST_EPHEM']
if 'PLANET_SHAPIRO' in config:
PLANET_SHAPIRO = config['PLANET_SHAPIRO']
if 'CORRECT_TROPOSPHERE' in config:
CORRECT_TROPOSPHERE = config['CORRECT_TROPOSPHERE']
if 'FREQUENCY_RATIO' in config:
FREQUENCY_RATIO = config['FREQUENCY_RATIO']
if 'MAX_SOLARWIND_DELAY' in config:
MAX_SOLARWIND_DELAY = config['MAX_SOLARWIND_DELAY']
if 'LATEST_TOA_RELEASE' in config:
LATEST_TOA_RELEASE = config['LATEST_TOA_RELEASE']

read_config_file(os.path.join(PACKAGE_DIR, 'defaults.yaml'))
16 changes: 0 additions & 16 deletions src/pint_pal/defaults.py

This file was deleted.

21 changes: 21 additions & 0 deletions src/pint_pal/defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Here we keep track of global default settings
#
# These can be overridden on a per-project basis by placing a file
# called `pint_pal_project.yaml` in the `data_root` location (this
# defaults to the current working directory, but can be configured
# with `pint_pal.set_data_root()`).

# Choice of clock, SSE
LATEST_BIPM: "BIPM2021" # latest clock realization to use
LATEST_EPHEM: "DE440" # latest solar system ephemeris to use

# Toggle various corrections
PLANET_SHAPIRO: True # correct for Shapiro delay from planets
CORRECT_TROPOSPHERE: True # correct for tropospheric delays

# DMX model defaults
FREQUENCY_RATIO: 1.1 # set the high/low frequency ratio for DMX bins
MAX_SOLARWIND_DELAY: 0.1 # set the maximum permited 'delay' from SW [us]

# Desired TOA release tag
LATEST_TOA_RELEASE: "2021.08.25-9d8d617" # current set of TOAs available
Loading