Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7a2d8fb
Author: Kyle Conroy <kyleconroy@gmail.com>
Date:   Wed Nov 20 16:06:44 2024 -0500

    prepare readme and changelog for 2.4.18 bugfix

commit 84f9585
Author: Kyle Conroy <kyleconroy@gmail.com>
Date:   Wed Nov 20 16:05:30 2024 -0500

    2.4.17 release (#985)

    * Fix support for numpy 2.0. [#982]

    ---------

    Co-authored-by: mwrona77 <125769279+mwrona77@users.noreply.github.com>
    Co-authored-by: Marcin Wrona <mwrona@villanova.edu>
  • Loading branch information
aprsa committed Dec 18, 2024
1 parent 15dff8f commit be0bd6a
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.2
env:
CIBW_SKIP: pp37-* pp38-* pp39-* pp31*-macosx*
CIBW_SKIP: pp37-* pp38-* pp39-* pp31*-macosx* *-manylinux_i686
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
Expand All @@ -56,4 +56,4 @@ jobs:
path: dist
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ PHOEBE 2.4

<p align="center">
<a href="https://pypi.org/project/phoebe/"><img src="https://img.shields.io/badge/pip-phoebe-blue.svg"/></a>
<a href="http://phoebe-project.org/install"><img src="https://img.shields.io/badge/python-3.6+-blue.svg"/></a>
<a href="http://phoebe-project.org/install"><img src="https://img.shields.io/badge/python-3.8+-blue.svg"/></a>
<a href="https://github.com/phoebe-project/phoebe2/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-GPL3-blue.svg"/></a>
<a href="https://github.com/phoebe-project/phoebe2/actions/workflows/on_pr.yml?query=branch%3Amaster"><img src="https://github.com/phoebe-project/phoebe2/actions/workflows/on_pr.yml/badge.svg?branch=master"/></a>
<a href="http://phoebe-project.org/docs/2.3"><img src="https://github.com/phoebe-project/phoebe2-docs/actions/workflows/build-docs.yml/badge.svg?branch=2.3"/></a>
<a href="http://phoebe-project.org/docs/2.4"><img src="https://github.com/phoebe-project/phoebe2-docs/actions/workflows/build-docs.yml/badge.svg?branch=2.4"/></a>
<br/>
<a href="https://ui.adsabs.harvard.edu/abs/2016ApJS..227...29P"><img src="https://img.shields.io/badge/ApJS-Prsa+2016-lightgrey.svg"/></a>
<a href="https://ui.adsabs.harvard.edu/abs/2018ApJS..237...26H"><img src="https://img.shields.io/badge/ApJS-Horvat+2018-lightgrey.svg"/></a>
<a href="https://ui.adsabs.harvard.edu/abs/2020ApJS..247...63J"><img src="https://img.shields.io/badge/ApJS-Jones+2020-lightgrey.svg"/></a>
<a href="https://ui.adsabs.harvard.edu/abs/2020ApJS..250...34C/"><img src="https://img.shields.io/badge/ApJS-Conroy+2020-lightgrey.svg"/></a>
<img src="https://img.shields.io/badge/Kochoska+2022-lightgrey.svg"/>
</p>

<p align="center">
Expand Down Expand Up @@ -57,15 +56,9 @@ To download the PHOEBE 2 source code, use git:

To install PHOEBE 2 from the source locally, go to the `phoebe2/` directory and issue:

python3 setup.py build
python3 setup.py install --user
pip install .

To install PHOEBE 2 from the source site-wide, go to the `phoebe2/` directory and issue:

python3 setup.py build
sudo python3 setup.py install

Note that as of the 2.3 release, PHOEBE requires Python 3.6 or later. For further details on pre-requisites consult the [PHOEBE project webpage](http://phoebe-project.org/install/2.4).
Note that as of the 2.4.16 release, PHOEBE requires Python 3.8 or later. For further details on pre-requisites consult the [PHOEBE project webpage](http://phoebe-project.org/install/2.4).


GETTING STARTED
Expand All @@ -85,6 +78,15 @@ To understand how to use PHOEBE, please consult the [tutorials, scripts and manu
CHANGELOG
----------

### 2.4.18



### 2.4.17

* Fix support for numpy 2.0. [#982]


### 2.4.16

* Fix handling of floating-point precision near the aligned case that used to result in error from libphoebe. [#965]
Expand Down
2 changes: 1 addition & 1 deletion phoebe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

__version__ = '2.4.16.dev+feature-blending'
__version__ = '2.4.18.dev+feature-blending'

import os as _os
import sys as _sys
Expand Down
4 changes: 2 additions & 2 deletions phoebe/backend/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2979,8 +2979,8 @@ def split_mesh(mesh, q, pot):
# a bit of array reshaping magic, but it works
triangind_primsec_f = mesh['triangles'][triangind_primsec].flatten().copy()
triangind_secprim_f = mesh['triangles'][triangind_secprim].flatten().copy()
indices_prim = np.where(np.in1d(triangind_primsec_f, vertind_primsec))[0]
indices_sec = np.where(np.in1d(triangind_secprim_f, vertind_secprim))[0]
indices_prim = np.where(np.isin(triangind_primsec_f, vertind_primsec))[0]
indices_sec = np.where(np.isin(triangind_secprim_f, vertind_secprim))[0]

triangind_primsec_f[indices_prim] = new_triangle_indices_prim
triangind_secprim_f[indices_sec] = new_triangle_indices_sec
Expand Down
2 changes: 1 addition & 1 deletion phoebe/dependencies/distl/distl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4714,7 +4714,7 @@ def dist_constructor_args(self):
# TODO: do we need to remove duplicates?
x.sort()
if self.math == '__and__':
pdf = _np.product([d.pdf(x) for d in self.dists], axis=0)
pdf = _np.prod([d.pdf(x) for d in self.dists], axis=0)
# unfortunately we'll need to integrate to get the cdf... we'll do that later
cdf = None
elif self.math == '__or__':
Expand Down
2 changes: 1 addition & 1 deletion phoebe/dependencies/ligeor/models/polyfit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from operator import itemgetter
from itertools import groupby
from numpy.core.fromnumeric import mean
from numpy import mean
from scipy.optimize import minimize
from phoebe.dependencies.ligeor.utils.lcutils import *
from phoebe.dependencies.ligeor.models import Model
Expand Down
10 changes: 8 additions & 2 deletions phoebe/frontend/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,14 @@ def load_legacy(filename, add_compute_legacy=True, add_compute_phoebe=True,
raise TypeError("filename must be string or file object, got {}".format(type(filename)))

# load the phoebe file
params = np.loadtxt(filename, dtype='str', delimiter='=',
converters={0: lambda s: s.strip(), 1: lambda s: s.strip()})
params = np.genfromtxt(
filename,
dtype='str',
delimiter='=',
comments='#',
filling_values='',
autostrip=True
)

morphology = params[:,1][list(params[:,0]).index('phoebe_model')]

Expand Down
15 changes: 12 additions & 3 deletions phoebe/parameters/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11924,9 +11924,18 @@ def eq_needs_builtin(eq, include_math=True):
def get_values(vars, safe_label=True, string_safe_arrays=False, use_distribution=None, needs_builtin=False):
def _single_value(quantity, string_safe_arrays=False):
if isinstance(quantity, u.Quantity):
v = u.to_solar(quantity).value if self.in_solar_units else quantity.si.value
# cast to np.float64 so that dividing by zero will result in a np.inf
v = v.astype(np.float64) if isinstance(v, np.ndarray) else np.float64(v)
if self.in_solar_units:
v = u.to_solar(quantity).value
else:
v = quantity.si.value

if isinstance(v, np.ndarray):
if v.size == 1:
v = np.float64(v[0]) # Convert single-element arrays to scalar avoid DeprecationWarning: Conversion of an array with ndim > 0 to a scalar
else:
v = np.float64(v)
else:
v = np.float64(v)

if isinstance(v, np.ndarray) and string_safe_arrays:
v = v.tolist()
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

[project]
name = "phoebe"
version = "2.4.16.dev+release-2.5"
version = "2.4.18.dev+release-2.5"
description = "PHOEBE: modeling and analysis of eclipsing binary stars"
readme = "README.md"
requires-python = ">=3.8"
Expand Down Expand Up @@ -58,7 +58,7 @@ classifiers = [
"Topic :: Software Development :: User Interfaces"
]
dependencies = [
"numpy < 2.0.0",
"numpy",
"scipy",
"astropy",
"pytest",
Expand All @@ -80,7 +80,7 @@ repository = "https://github.com/phoebe-project/phoebe2"
documentation = "http://phoebe-project.org/docs"

[build-system]
requires = ["setuptools", "numpy < 2.0.0", "wheel"]
requires = ["setuptools", "numpy", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
Expand Down
12 changes: 9 additions & 3 deletions tests/tests/test_legacy_parser/test_legacy_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ def _legacy_test(filename='default.phoebe', verbose=True):
# locate file
dir = os.path.dirname(os.path.realpath(__file__))
# load in phoebe parameter file
params = np.loadtxt(
os.path.join(dir, filename), dtype='str', delimiter='=',
converters={0: lambda s: s.strip(), 1: lambda s: s.strip()})
params = np.genfromtxt(
os.path.join(dir, filename),
dtype='str',
delimiter='=',
comments='#',
filling_values='',
autostrip=True
)


lcno = int(params[:,1][list(params[:,0]).index('phoebe_lcno')])
rvno = int(params[:,1][list(params[:,0]).index('phoebe_rvno')])
Expand Down

0 comments on commit be0bd6a

Please sign in to comment.