Skip to content

Commit 7bc4489

Browse files
kecnryjsinkbaekMichaelAbdul-MasihRaindogjonesaprsa
authored
2.4.11 bugfix release (#723)
* fix jktebop backend handling of mass-ratio and eccentricity for RVs. * bumps version requirements in pip for numpy, scipy, astropy. * allows sma@star and asini@star to flip to solve for q * fixes handling of spots on rotating single stars. * fixes constraint migration for 2.3 -> 2.4 --------- Co-authored-by: Jeppe Sinkbæk Thomsen <[email protected]> Co-authored-by: Michael Abdul-Masih <[email protected]> Co-authored-by: David Jones <[email protected]> Co-authored-by: Andrej Prsa <[email protected]>
1 parent 3d2032d commit 7bc4489

20 files changed

+856
-13
lines changed

.github/workflows/on_pr_test_python_31x.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,23 @@ jobs:
9797
- name: Test photodynam install
9898
run: |
9999
python -c "import photodynam"
100-
100+
101+
- name: Setup GNU Fortran
102+
uses: modflowpy/install-gfortran-action@v1
103+
104+
- name: Install jktebop
105+
run: |
106+
wget https://www.astro.keele.ac.uk/jkt/codes/jktebop-v43.tgz
107+
tar -xvzf jktebop-v43.tgz
108+
cd jktebop43
109+
gfortran -o jktebop jktebop.f
110+
echo $(pwd) >> $GITHUB_PATH
111+
cd ..
112+
113+
- name: Test jktebop install
114+
run: |
115+
jktebop
116+
101117
- name: Run tests
102118
run: |
103119
pytest --verbose --capture=no --full-trace tests/nosetests/

.github/workflows/on_pr_test_python_37.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ jobs:
8888
run: |
8989
python -c "import photodynam"
9090
91+
- name: Setup GNU Fortran
92+
uses: modflowpy/install-gfortran-action@v1
93+
94+
- name: Install jktebop
95+
run: |
96+
wget https://www.astro.keele.ac.uk/jkt/codes/jktebop-v43.tgz
97+
tar -xvzf jktebop-v43.tgz
98+
cd jktebop43
99+
gfortran -o jktebop jktebop.f
100+
echo $(pwd) >> $GITHUB_PATH
101+
cd ..
102+
103+
- name: Test jktebop install
104+
run: |
105+
jktebop
106+
91107
- name: Run tests
92108
run: |
93109
pytest --verbose --capture=no tests/nosetests/

.github/workflows/on_pr_test_python_38.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ jobs:
107107
run: |
108108
python -c "import photodynam"
109109
110+
- name: Setup GNU Fortran
111+
uses: modflowpy/install-gfortran-action@v1
112+
113+
- name: Install jktebop
114+
run: |
115+
wget https://www.astro.keele.ac.uk/jkt/codes/jktebop-v43.tgz
116+
tar -xvzf jktebop-v43.tgz
117+
cd jktebop43
118+
gfortran -o jktebop jktebop.f
119+
echo $(pwd) >> $GITHUB_PATH
120+
cd ..
121+
122+
- name: Test jktebop install
123+
run: |
124+
jktebop
125+
110126
- name: Run tests
111127
run: |
112128
pytest --verbose --capture=no tests/nosetests/

.github/workflows/on_pr_test_python_39.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ jobs:
8888
run: |
8989
python -c "import photodynam"
9090
91+
- name: Setup GNU Fortran
92+
uses: modflowpy/install-gfortran-action@v1
93+
94+
- name: Install jktebop
95+
run: |
96+
wget https://www.astro.keele.ac.uk/jkt/codes/jktebop-v43.tgz
97+
tar -xvzf jktebop-v43.tgz
98+
cd jktebop43
99+
gfortran -o jktebop jktebop.f
100+
echo $(pwd) >> $GITHUB_PATH
101+
cd ..
102+
103+
- name: Test jktebop install
104+
run: |
105+
echo $PATH
106+
jktebop
107+
91108
- name: Run tests
92109
run: |
93110
pytest --verbose --capture=no --full-trace tests/nosetests/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ MANIFEST
1818
*.log
1919
*.txt
2020
*.png
21+
*.so
22+
*.egg-info
2123
.DS_Store
22-
libphoebe.so
2324

2425
*.swp

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ To understand how to use PHOEBE, please consult the [tutorials, scripts and manu
8585
CHANGELOG
8686
----------
8787

88+
### 2.4.11
89+
90+
* fix jktebop backend handling of mass-ratio and eccentricity for RVs.
91+
* bumps version requirements in pip for numpy, scipy, astropy.
92+
* allows sma@star and asini@star to flip to solve for q
93+
* fixes handling of spots on rotating single stars.
94+
* fixes constraint migration for 2.3 -> 2.4
95+
8896
### 2.4.10
8997

9098
* fixes implementation of gravitational redshift.

phoebe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
"""
1919

20-
__version__ = '2.4.10'
20+
__version__ = '2.4.11'
2121

2222
import os as _os
2323
import sys as _sys

phoebe/backend/backends.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,8 +2145,11 @@ def _worker_setup(self, b, compute, infolist, **kwargs):
21452145
rA = b.get_value(qualifier='requiv', component=starrefs[0], context='component', unit=u.solRad, **_skip_filter_checks)
21462146
rB = b.get_value(qualifier='requiv', component=starrefs[1], context='component', unit=u.solRad, **_skip_filter_checks)
21472147
sma = b.get_value(qualifier='sma', component=orbitref, context='component', unit=u.solRad, **_skip_filter_checks)
2148+
sma_A = b.get_value(qualifier='sma', component=starrefs[0], context='component', unit=u.solRad, **_skip_filter_checks)
2149+
sma_B = b.get_value(qualifier='sma', component=starrefs[1], context='component', unit=u.solRad, **_skip_filter_checks)
21482150
incl = b.get_value(qualifier='incl', component=orbitref, context='component', unit=u.deg, **_skip_filter_checks)
21492151
q = b.get_value(qualifier='q', component=orbitref, context='component', **_skip_filter_checks)
2152+
ecc = b.get_value(qualifier='ecc', component=orbitref, context='component', **_skip_filter_checks)
21502153
ecosw = b.get_value(qualifier='ecosw', component=orbitref, context='component', **_skip_filter_checks)
21512154
esinw = b.get_value(qualifier='esinw', component=orbitref, context='component', **_skip_filter_checks)
21522155

@@ -2167,7 +2170,11 @@ def _worker_setup(self, b, compute, infolist, **kwargs):
21672170
ecosw=ecosw, esinw=esinw,
21682171
gravbA=gravbA, gravbB=gravbB,
21692172
period=period, t0_supconj=t0_supconj,
2170-
pblums=kwargs.get('pblums'))
2173+
pblums=kwargs.get('pblums'),
2174+
sma_A=sma_A,
2175+
sma_B=sma_B,
2176+
ecc=ecc
2177+
)
21712178

21722179
def _run_single_dataset(self, b, info, **kwargs):
21732180
"""
@@ -2183,12 +2190,15 @@ def _run_single_dataset(self, b, info, **kwargs):
21832190
rA = kwargs.get('rA')
21842191
rB = kwargs.get('rB')
21852192
sma = kwargs.get('sma')
2193+
sma_A = kwargs.get('sma_A')
2194+
sma_B = kwargs.get('sma_B')
21862195
incl = kwargs.get('incl')
21872196
q = kwargs.get('q')
21882197
if distortion_method == 'sphere':
21892198
q *= -1
21902199
ecosw = kwargs.get('ecosw')
21912200
esinw = kwargs.get('esinw')
2201+
ecc = kwargs.get('ecc')
21922202
gravbA = kwargs.get('gravbA')
21932203
gravbB = kwargs.get('gravbB')
21942204
period = kwargs.get('period')
@@ -2337,7 +2347,8 @@ def _run_single_dataset(self, b, info, **kwargs):
23372347
#~ fi.write('rv2 llaqr-rv2.dat llaqr-rv2.out 55.0 -10.0 0 0\n')
23382348
if info['kind'] == 'rv':
23392349
# NOTE: we disable systemic velocity as it will be added in bundle.run_compute
2340-
K = np.pi * (sma*u.solRad).to(u.km).value * np.sin((incl*u.deg).to(u.rad).value) / (period*u.d).to(u.s).value
2350+
sma_ = sma_A if info['component'] == starrefs[0] else sma_B
2351+
K = np.pi * 2*(sma_*u.solRad).to(u.km).value * np.sin((incl*u.deg).to(u.rad).value) / ((period*u.d).to(u.s).value * np.sqrt(1-ecc**2))
23412352
fi.write('{} {} {} {} {} 0 0\n'.format('rv1' if info['component'] == starrefs[0] else 'rv2', tmpfilenamervin, tmpfilenamervout, K, 0.0))
23422353

23432354

phoebe/backend/universe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2432,7 +2432,7 @@ def is_convex(self):
24322432
def needs_recompute_instantaneous(self):
24332433
# recompute instantaneous for asynchronous spots, even if meshing
24342434
# doesn't need to be recomputed
2435-
return self.needs_remesh or (len(self.features) and self.F != 1.0)
2435+
return self.needs_remesh or (not self.is_single and len(self.features) and self.F != 1)
24362436

24372437
@property
24382438
def needs_remesh(self):

phoebe/frontend/bundle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,9 @@ def existing_value(param):
989989
logger.warning("re-creating {} constraint".format(constraint.twig))
990990
solved_for = constraint.get_constrained_parameter()
991991
b.remove_constraint(uniqueid=constraint.uniqueid)
992-
new_constraint = b.add_constraint(constraint.constraint_func, component=constraint.component)
992+
new_constraint_ps = b.add_constraint(constraint.constraint_func, component=constraint.component)
993993
if solved_for.qualifier != constraint.constraint_func:
994-
new_constraint.flip_for(solved_for.twig)
994+
new_constraint_ps.get_parameter().flip_for(solved_for.twig)
995995

996996

997997
if conf_interactive_checks:

phoebe/parameters/constraint.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ def mass(b, component, solve_for=None, **kwargs):
17781778
#
17791779
# return lhs, rhs, [esinw, ecosw, ecc, per0], {'orbit': orbit}
17801780

1781-
_validsolvefor['comp_sma'] = ['sma@orbit', 'incl@orbit']
1781+
_validsolvefor['comp_sma'] = ['sma@orbit', 'incl@orbit', 'q']
17821782
def comp_sma(b, component, solve_for=None, **kwargs):
17831783
"""
17841784
Create a constraint for the star's semi-major axes WITHIN its
@@ -1854,12 +1854,20 @@ def comp_sma(b, component, solve_for=None, **kwargs):
18541854
lhs = sma
18551855
rhs = compsma * qthing
18561856

1857+
elif solve_for == q:
1858+
if hier.get_primary_or_secondary(component)=='primary':
1859+
lhs = q
1860+
rhs = 1.0 / ((sma / compsma) - 1.0)
1861+
else:
1862+
lhs = q
1863+
rhs = (sma / compsma) - 1.0
1864+
18571865
else:
18581866
raise NotImplementedError
18591867

18601868
return lhs, rhs, [], {'component': component}
18611869

1862-
_validsolvefor['comp_asini'] = ['asini@star', 'sma@orbit']
1870+
_validsolvefor['comp_asini'] = ['asini@star', 'sma@orbit', 'q']
18631871
def comp_asini(b, component, solve_for=None, **kwargs):
18641872
"""
18651873
Create a constraint for the star's projected semi-major axes WITHIN its
@@ -1934,6 +1942,13 @@ def comp_asini(b, component, solve_for=None, **kwargs):
19341942
lhs = sma
19351943
rhs = compasini / sin(incl) * qthing
19361944

1945+
elif solve_for == q:
1946+
if hier.get_primary_or_secondary(component)=='primary':
1947+
lhs = q
1948+
rhs = 1.0 / (((sma * sin(incl)) / compasini) - 1.0)
1949+
else:
1950+
lhs = q
1951+
rhs = ((sma * sin(incl)) / compasini) - 1.0
19371952
else:
19381953
raise NotImplementedError
19391954

phoebe/parameters/figure/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ def _figure_style_nosources(b, cycler='default', **kwargs):
205205

206206
params += [ChoiceParameter(qualifier='color', value=b._mplcolorcyclers.get(cycler).get(kwargs.get('color', None)), choices=_mplcolors, description='Default color when plotted via run_figure')]
207207

208-
params += [ChoiceParameter(qualifier='marker', value=b._mplmarkercyclers.get(cycler).get(kwargs.get('marker', None)) if kwargs.get('marker', None) is not "None" else "None", choices=["None"] + _mplmarkers, description='Default marker when plotted via run_figure')]
208+
params += [ChoiceParameter(qualifier='marker', value=b._mplmarkercyclers.get(cycler).get(kwargs.get('marker', None)) if kwargs.get('marker', None) != "None" else "None", choices=["None"] + _mplmarkers, description='Default marker when plotted via run_figure')]
209209

210-
params += [ChoiceParameter(qualifier='linestyle', value=b._mpllinestylecyclers.get(cycler).get(kwargs.get('linestyle', None)) if kwargs.get('linestyle', None) is not "None" else "None", choices=["None"] + _mpllinestyles, description='Default linestyle when plotted via run_figure')]
210+
params += [ChoiceParameter(qualifier='linestyle', value=b._mpllinestylecyclers.get(cycler).get(kwargs.get('linestyle', None)) if kwargs.get('linestyle', None) != "None" else "None", choices=["None"] + _mpllinestyles, description='Default linestyle when plotted via run_figure')]
211211

212212
return params
213213

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def _env_variable_bool(key, default):
405405
long_description = "\n".join(long_description_s[long_description_s.index("INTRODUCTION"):])
406406

407407
setup (name = 'phoebe',
408-
version = '2.4.10',
408+
version = '2.4.11',
409409
description = 'PHOEBE 2.4',
410410
long_description=long_description,
411411
author = 'PHOEBE development team',
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# TIME RV_STAR_A ERROR PHASE MODEL (O-C)
2+
0.000000 1.00000 -1.000000 0.00000000 0.00000 1.00000
3+
0.010101 1.00000 -1.000000 0.01010100 -8.50328 9.50328
4+
0.020202 1.00000 -1.000000 0.02020200 -16.97233 17.97233
5+
0.030303 1.00000 -1.000000 0.03030300 -25.37303 26.37303
6+
0.040404 1.00000 -1.000000 0.04040400 -33.67156 34.67156
7+
0.050505 1.00000 -1.000000 0.05050500 -41.83451 42.83451
8+
0.060606 1.00000 -1.000000 0.06060600 -49.82901 50.82901
9+
0.070707 1.00000 -1.000000 0.07070700 -57.62287 58.62287
10+
0.080808 1.00000 -1.000000 0.08080800 -65.18470 66.18470
11+
0.090909 1.00000 -1.000000 0.09090900 -72.48405 73.48405
12+
0.101010 1.00000 -1.000000 0.10101000 -79.49154 80.49154
13+
0.111111 1.00000 -1.000000 0.11111100 -86.17894 87.17894
14+
0.121212 1.00000 -1.000000 0.12121200 -92.51933 93.51933
15+
0.131313 1.00000 -1.000000 0.13131300 -98.48718 99.48718
16+
0.141414 1.00000 -1.000000 0.14141400 -104.05845 105.05845
17+
0.151515 1.00000 -1.000000 0.15151500 -109.21073 110.21073
18+
0.161616 1.00000 -1.000000 0.16161600 -113.92324 114.92324
19+
0.171717 1.00000 -1.000000 0.17171700 -118.17704 119.17704
20+
0.181818 1.00000 -1.000000 0.18181800 -121.95497 122.95497
21+
0.191919 1.00000 -1.000000 0.19191900 -125.24184 126.24184
22+
0.202020 1.00000 -1.000000 0.20202000 -128.02440 129.02440
23+
0.212121 1.00000 -1.000000 0.21212100 -130.29145 131.29145
24+
0.222222 1.00000 -1.000000 0.22222200 -132.03387 133.03387
25+
0.232323 1.00000 -1.000000 0.23232300 -133.24464 134.24464
26+
0.242424 1.00000 -1.000000 0.24242400 -133.91887 134.91887
27+
0.252525 1.00000 -1.000000 0.25252500 -134.05387 135.05387
28+
0.262626 1.00000 -1.000000 0.26262600 -133.64907 134.64907
29+
0.272727 1.00000 -1.000000 0.27272700 -132.70612 133.70612
30+
0.282828 1.00000 -1.000000 0.28282800 -131.22882 132.22882
31+
0.292929 1.00000 -1.000000 0.29292900 -129.22310 130.22310
32+
0.303030 1.00000 -1.000000 0.30303000 -126.69704 127.69704
33+
0.313131 1.00000 -1.000000 0.31313100 -123.66082 124.66082
34+
0.323232 1.00000 -1.000000 0.32323200 -120.12667 121.12667
35+
0.333333 1.00000 -1.000000 0.33333300 -116.10881 117.10881
36+
0.343434 1.00000 -1.000000 0.34343400 -111.62342 112.62342
37+
0.353535 1.00000 -1.000000 0.35353500 -106.68856 107.68856
38+
0.363636 1.00000 -1.000000 0.36363600 -101.32410 102.32410
39+
0.373737 1.00000 -1.000000 0.37373700 -95.55166 96.55166
40+
0.383838 1.00000 -1.000000 0.38383800 -89.39445 90.39445
41+
0.393939 1.00000 -1.000000 0.39393900 -82.87729 83.87729
42+
0.404040 1.00000 -1.000000 0.40404000 -76.02642 77.02642
43+
0.414141 1.00000 -1.000000 0.41414100 -68.86941 69.86941
44+
0.424242 1.00000 -1.000000 0.42424200 -61.43509 62.43509
45+
0.434343 1.00000 -1.000000 0.43434300 -53.75339 54.75339
46+
0.444444 1.00000 -1.000000 0.44444400 -45.85525 46.85525
47+
0.454545 1.00000 -1.000000 0.45454500 -37.77246 38.77246
48+
0.464646 1.00000 -1.000000 0.46464600 -29.53758 30.53758
49+
0.474747 1.00000 -1.000000 0.47474700 -21.18376 22.18376
50+
0.484848 1.00000 -1.000000 0.48484800 -12.74464 13.74464
51+
0.494949 1.00000 -1.000000 0.49494900 -4.25420 5.25420
52+
0.505051 1.00000 -1.000000 0.50505100 4.25420 -3.25420
53+
0.515152 1.00000 -1.000000 0.51515200 12.74464 -11.74464
54+
0.525253 1.00000 -1.000000 0.52525300 21.18376 -20.18376
55+
0.535354 1.00000 -1.000000 0.53535400 29.53758 -28.53758
56+
0.545455 1.00000 -1.000000 0.54545500 37.77246 -36.77246
57+
0.555556 1.00000 -1.000000 0.55555600 45.85525 -44.85525
58+
0.565657 1.00000 -1.000000 0.56565700 53.75339 -52.75339
59+
0.575758 1.00000 -1.000000 0.57575800 61.43509 -60.43509
60+
0.585859 1.00000 -1.000000 0.58585900 68.86941 -67.86941
61+
0.595960 1.00000 -1.000000 0.59596000 76.02642 -75.02642
62+
0.606061 1.00000 -1.000000 0.60606100 82.87729 -81.87729
63+
0.616162 1.00000 -1.000000 0.61616200 89.39445 -88.39445
64+
0.626263 1.00000 -1.000000 0.62626300 95.55166 -94.55166
65+
0.636364 1.00000 -1.000000 0.63636400 101.32410 -100.32410
66+
0.646465 1.00000 -1.000000 0.64646500 106.68856 -105.68856
67+
0.656566 1.00000 -1.000000 0.65656600 111.62342 -110.62342
68+
0.666667 1.00000 -1.000000 0.66666700 116.10881 -115.10881
69+
0.676768 1.00000 -1.000000 0.67676800 120.12667 -119.12667
70+
0.686869 1.00000 -1.000000 0.68686900 123.66082 -122.66082
71+
0.696970 1.00000 -1.000000 0.69697000 126.69704 -125.69704
72+
0.707071 1.00000 -1.000000 0.70707100 129.22310 -128.22310
73+
0.717172 1.00000 -1.000000 0.71717200 131.22882 -130.22882
74+
0.727273 1.00000 -1.000000 0.72727300 132.70612 -131.70612
75+
0.737374 1.00000 -1.000000 0.73737400 133.64907 -132.64907
76+
0.747475 1.00000 -1.000000 0.74747500 134.05387 -133.05387
77+
0.757576 1.00000 -1.000000 0.75757600 133.91887 -132.91887
78+
0.767677 1.00000 -1.000000 0.76767700 133.24464 -132.24464
79+
0.777778 1.00000 -1.000000 0.77777800 132.03387 -131.03387
80+
0.787879 1.00000 -1.000000 0.78787900 130.29145 -129.29145
81+
0.797980 1.00000 -1.000000 0.79798000 128.02440 -127.02440
82+
0.808081 1.00000 -1.000000 0.80808100 125.24184 -124.24184
83+
0.818182 1.00000 -1.000000 0.81818200 121.95497 -120.95497
84+
0.828283 1.00000 -1.000000 0.82828300 118.17704 -117.17704
85+
0.838384 1.00000 -1.000000 0.83838400 113.92324 -112.92324
86+
0.848485 1.00000 -1.000000 0.84848500 109.21073 -108.21073
87+
0.858586 1.00000 -1.000000 0.85858600 104.05845 -103.05845
88+
0.868687 1.00000 -1.000000 0.86868700 98.48718 -97.48718
89+
0.878788 1.00000 -1.000000 0.87878800 92.51933 -91.51933
90+
0.888889 1.00000 -1.000000 0.88888900 86.17894 -85.17894
91+
0.898990 1.00000 -1.000000 0.89899000 79.49154 -78.49154
92+
0.909091 1.00000 -1.000000 0.90909100 72.48405 -71.48405
93+
0.919192 1.00000 -1.000000 0.91919200 65.18470 -64.18470
94+
0.929293 1.00000 -1.000000 0.92929300 57.62287 -56.62287
95+
0.939394 1.00000 -1.000000 0.93939400 49.82901 -48.82901
96+
0.949495 1.00000 -1.000000 0.94949500 41.83451 -40.83451
97+
0.959596 1.00000 -1.000000 0.95959600 33.67156 -32.67156
98+
0.969697 1.00000 -1.000000 0.96969700 25.37303 -24.37303
99+
0.979798 1.00000 -1.000000 0.97979800 16.97233 -15.97233
100+
0.989899 1.00000 -1.000000 0.98989900 8.50328 -7.50328
101+
1.000000 1.00000 -1.000000 0.00000000 0.00000 1.00000

0 commit comments

Comments
 (0)