Skip to content

Commit

Permalink
Merge branch 'v3' into hcga
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Jan 19, 2024
2 parents 1ea93f2 + 6bfa14b commit d7f68d6
Show file tree
Hide file tree
Showing 8 changed files with 645 additions and 538 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
python -m pip install . --no-build-isolation
- name: Run tutorial notebooks
run: |
py.test --nbmake docs/tutorials/*.ipynb
py.test --nbmake --nbmake-timeout=3000 docs/tutorials/*.ipynb
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ User Guide:
Changelog:
++++++++++

**3.0.0 (TBD)**

- discuss MCMC autocorrelation in MCMC tutorial (@michaelkmpoon)
- add time warning if OFTI doesn't accept an orbit in first 60 s (@michaelkmpoon)

**2.2.2 (2023-06-30)**

- tests now overwrite any generated text files (@sblunt)
Expand Down
211 changes: 93 additions & 118 deletions docs/tutorials/MCMC_tutorial.ipynb

Large diffs are not rendered by default.

275 changes: 99 additions & 176 deletions docs/tutorials/MCMC_vs_OFTI.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion orbitize/nbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def calc_orbit(
for j,t in enumerate(te):
sim.integrate(t/365.25)
#for the star and each planet in each epoch denoted by j,t find the RA, Dec, and RV
com = sim.calculate_com()
com = sim.com()
ra_reb[j,0] = -(ps[0].x-com.x)# ra is negative x
dec_reb[j,0] = ps[0].y-com.y
vz[j,0] = ps[0].vz
Expand Down
680 changes: 442 additions & 238 deletions orbitize/sampler.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/test_chi2_lnlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_log_vs_standard():
56.95,
)
s_standard = myDriver_standard.sampler
_ = s_standard.run_sampler(500)
_ = s_standard.run_sampler(750)

# initiate driver with log chi2
myDriver_log = orbitize.driver.Driver(
Expand All @@ -168,7 +168,7 @@ def test_log_vs_standard():
chi2_type="log",
)
s_log = myDriver_log.sampler
_ = s_log.run_sampler(500)
_ = s_log.run_sampler(750)

# take mean of result objects
myResults_standard = np.mean(s_standard.results.post, axis=0)
Expand All @@ -177,7 +177,7 @@ def test_log_vs_standard():
print(myResults_log[1], myResults_standard[1])

# check that the eccentricity means are about the same
assert myResults_log[1] == pytest.approx(myResults_standard[1], rel=0.1)
assert myResults_log[1] == pytest.approx(myResults_standard[1], rel=0.15)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hipparcos.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_iad_refitting():

# check that we get reasonable values for the posteriors of the refit IAD
# (we're only running the MCMC for a few steps, so these are not strict)
assert np.isclose(0, np.median(post[:, -1]), atol=0.5)
assert np.isclose(0, np.median(post[:, -1]), atol=0.7)
assert np.isclose(myHipLogProb.plx0, np.median(post[:, 0]), atol=0.5)


Expand Down

0 comments on commit d7f68d6

Please sign in to comment.