Skip to content

Commit

Permalink
2.4.16 bugfix release (#970)
Browse files Browse the repository at this point in the history
* Fix handling of floating-point precision near the aligned case that used to result in error from libphoebe. [#965]
* Updates to phoebe-server to be compatible with modern browser requirements. [#959]
* Fix support for python 3.13, remove official support for python 3.7. [#968]

---------

Co-authored-by: Martin Horvat <[email protected]>
  • Loading branch information
kecnry and horvatm authored Oct 25, 2024
1 parent 0af34c1 commit f28a5a4
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-22.04, macos-13, macos-14] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-13, macos-14, macos-latest] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
toolchain:
- {compiler: gcc, version: 13} # https://github.com/fortran-lang/setup-fortran

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ To understand how to use PHOEBE, please consult the [tutorials, scripts and manu
CHANGELOG
----------

### 2.4.16

* Fix handling of floating-point precision near the aligned case that used to result in error from libphoebe. [#965]
* Updates to phoebe-server to be compatible with modern browser requirements. [#959]
* Fix support for python 3.13, remove official support for python 3.7. [#968]


### 2.4.15

* Fix handling of include_times for RVs with compute_times/phases. [#889]
Expand Down
49 changes: 28 additions & 21 deletions client-server/phoebe-server
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ import subprocess
from time import sleep
from collections import OrderedDict
from datetime import datetime
from distutils.version import StrictVersion
from packaging.version import parse

from phoebe.parameters.unit_choices import unit_choices as _unit_choices

Expand Down Expand Up @@ -502,21 +502,28 @@ def _get_failed_constraints(b):


############################ HTTP ROUTES ######################################
def _get_request(request):
if request.content_type == 'application/json':
return request.get_json()
else:
return request.form

def _get_response(data, status_code=200, api=False, **metawargs):
d = {}
d['data'] = data
d['meta'] = metawargs
if api:
resp = jsonify(d)
resp.status_code = status_code
resp.headers.set('Content-Type', 'application/json')
return resp
else:
return d

@app.route("/info", methods=['GET', 'POST'])
@crossdomain(origin='*')
def info():
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -538,9 +545,9 @@ def info():

client_warning = None
if client_version is not None:
if StrictVersion(client_version) < StrictVersion('1.0.0'):
if parse(client_version) < parse('1.0.0'):
client_warning = 'client still in development'
elif StrictVersion(client_version) < StrictVersion('1.1.0'):
elif parse(client_version) < parse('1.1.0'):
client_warning = 'client does not support adding or editing servers'


Expand Down Expand Up @@ -576,7 +583,7 @@ def new_bundle(type):
type: 'binary:detached'
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -625,7 +632,7 @@ def new_bundle(type):
def open_bundle(type):
"""
"""
j = request.get_json()
j = _get_request(request)
if j is None:
j = request.form
clientid = j.get('clientid', None)
Expand Down Expand Up @@ -692,7 +699,7 @@ def open_bundle(type):
def json_bundle(bundleid):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -712,7 +719,7 @@ def json_bundle(bundleid):
def save_bundle(bundleid):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -738,7 +745,7 @@ def save_bundle(bundleid):
@app.route('/export_script/<string:bundleid>', methods=['GET', 'POST'])
@crossdomain(origin='*')
def export_script(bundleid):
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -776,7 +783,7 @@ def export_script(bundleid):
def export_compute(bundleid, compute, model=None):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -806,7 +813,7 @@ def export_compute(bundleid, compute, model=None):
def export_solver(bundleid, solver, solution=None):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -835,7 +842,7 @@ def export_solver(bundleid, solver, solution=None):
def export_params(bundleid, params):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -862,7 +869,7 @@ def export_params(bundleid, params):
def bundle(bundleid):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -895,7 +902,7 @@ def bundle(bundleid):
def parameter(bundleid, uniqueid):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -923,7 +930,7 @@ def parameter(bundleid, uniqueid):
def adjustable_parameters(bundleid):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -945,7 +952,7 @@ def adjustable_parameters(bundleid):
def run_checks(bundleid, run_checks_method, label):
"""
"""
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -967,7 +974,7 @@ def run_checks(bundleid, run_checks_method, label):
@app.route('/nparray/<string:input>', methods=['GET', 'POST'])
@crossdomain(origin='*')
def nparray(input):
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -1010,7 +1017,7 @@ def nparray(input):
@app.route('/distl/<string:input>/<float:current_face_value>', methods=['GET', 'POST'])
@crossdomain(origin='*')
def distl_convert(input, current_face_value):
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand Down Expand Up @@ -1047,7 +1054,7 @@ def distl_convert(input, current_face_value):

@app.route("/<string:bundleid>/figure/<string:figure>", methods=['GET', 'POST'])
def serve_figure(bundleid, figure):
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -1058,7 +1065,7 @@ def serve_figure(bundleid, figure):

@app.route("/<string:bundleid>/figure_afig/<string:figure>", methods=['GET', 'POST'])
def serve_figure_afig(bundleid, figure):
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

Expand All @@ -1069,7 +1076,7 @@ def serve_figure_afig(bundleid, figure):

@app.route('/<string:bundleid>/distribution_plot/<string:parameter_uniqueid>/<string:distribution>', methods=['GET', 'POST'])
def serve_distribution_plot(bundleid, parameter_uniqueid, distribution):
j = request.get_json()
j = _get_request(request)
clientid = j.get('clientid', None) if j is not None else None
client_version = j.get('client_version', None) if j is not None else None

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.15'
__version__ = '2.4.16'

import os as _os
import sys as _sys
Expand Down
10 changes: 5 additions & 5 deletions phoebe/lib/bodies.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

/*
Examples of implicitely defined closed and connected surfaces in 3D
using standard Euclidian coordinate system (x,y,z).
Examples of implicitly defined closed and connected surfaces in 3D
using standard Euclidean coordinate system (x,y,z).
The gradient should be outward from the surface, but it is not
an requirement.
Expand All @@ -26,7 +26,7 @@
(x^2 + y^2 + z^2 + R^2 - A^2)^2 - 4 R^2 (x^2 + y^2) = 0
Explicitely it is defined as
Explicitly it is defined as
[x,y,z] = R_z(phi_1) [R + A cos(phi_2), 0, A cos(phi_2) ]
Expand Down Expand Up @@ -777,7 +777,7 @@ struct Tmisaligned_rot_star {


/* ===================================================================
Generalizd Roche potential with misaligned binary system in rotated
Generalized Roche potential with misaligned binary system in rotated
coordinate system.
Defined of implicitly by a constrain
Expand Down Expand Up @@ -982,7 +982,7 @@ struct Tmisaligned_rotated_roche {


/* ===================================================================
Generalizd Roche potential with misaligned binary system in canonical
Generalized Roche potential with misaligned binary system in canonical
coordinate system.
Defined of implicitly by a constrain
Expand Down
4 changes: 2 additions & 2 deletions phoebe/lib/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/*
String hashing for fast switching based on string argument.
Implemenation of FNV (Fowler–Noll–Vo hash)-1a hash based on the references.
Implementation of FNV (Fowler–Noll–Vo hash)-1a hash based on the references.
Author: Martin Horvat, August 2016
Expand Down Expand Up @@ -65,7 +65,7 @@ constexpr unsigned long long operator "" _hash64(char const* p, size_t)


/* ====================================================================
Hasking into 32bit integer
Hashing into 32bit integer
======================================================================*/
namespace fnv1a_32 {

Expand Down
2 changes: 1 addition & 1 deletion phoebe/lib/ld_models.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* Claret, A., 2000, A&A, 363, 1081
* Kallrath, Josef, Milone, Eugene F., Eclipsing Binary Stars: Modeling and Analysis (Spinger Verlag, 2009)
* Kallrath, Josef, Milone, Eugene F., Eclipsing Binary Stars: Modeling and Analysis (Springer Verlag, 2009)
* A. Claret, On the irradiated stellar atmospheres in close binary systems: Improvements and uncertainties, A&A 422, 665–673 (2004) DOI: 10.1051/0004-6361:20047056
*/
Expand Down
Loading

0 comments on commit f28a5a4

Please sign in to comment.