cyjoelchen / php-sweph

PHP Extension for Swiss Ephemeris
Other
63 stars 29 forks source link

Resolve precision issues in tests. #98

Closed kevindecapite closed 11 months ago

kevindecapite commented 1 year ago

These tests were failing on ARM chipsets. Reducing the precision resolved the issue due to what I assume are minor calculation discrepancies between different architectures.

The swe_heliacal_ut() test was especially problematic. Removing the usage of the SE_HELFLAG_OPTICAL_PARAMS flag bit resolved the issue. I've been unable to create a passing test using this flag bit, however, which may mean that this flag is not properly supported by this extension.

Here's a swetest example which uses observer data:

https://www.astro.com/cgi/swetest.cgi?b=1.1.2002&n=1&s=1&p=p&e=-eswe&f=&arg=-hev1+-p3+-b1.1.2002+-geopos121.34%2C43.57%2C100+-at0%2C0%2C0%2C0+-obs50%2C1%2C0%2C0%2C0%2C0

When I set this flag bit and the corresponding observer data in the PHP tests, I see very different results:

swetest: 2452586.41891
php test: 2452587.410627

Refs:

kevindecapite commented 11 months ago

For some bizarre reason, only the swe_sol_eclipse.phpt test was failing and only under the following conditions:

This means that the test was passing under all of these other conditions:

It was also passing in these test environments:

Given that, at the time of this comment, PHP 7.2 reached EOL in January of 2021 (and PHP 7.1 isn't even mentioned on the support timeline anymore), there is no reason to continue to support this older version of PHP.

For now, I am removing all versions of PHP 7 except for the latest (7.4), which did reach EOL as of January of 2023.