Skip to content

Commit 898f556

Browse files
authored
Merge pull request #21 from lucascolley/windows
CI: test windows
2 parents 161fe3c + e6adf4b commit 898f556

File tree

14 files changed

+629
-715
lines changed

14 files changed

+629
-715
lines changed

.github/workflows/linux.yml renamed to .github/workflows/tests.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,27 @@ jobs:
1616
tests:
1717
name: ${{ matrix.environment }} ${{ matrix.runs-on }}
1818
runs-on: ${{ matrix.runs-on }}
19-
env:
20-
XSREF_TABLES_PATH: "${{ github.workspace }}/xsref/tables"
2119
strategy:
2220
fail-fast: false
2321
matrix:
2422
environment: [tests-ci]
25-
runs-on: [ubuntu-latest, macos-latest]
23+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
2624

2725
steps:
2826
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2927
- uses: prefix-dev/setup-pixi@92815284c57faa15cd896c4d5cfb2d59f32dc43d # v0.8.3
3028
with:
31-
pixi-version: v0.44.0
29+
pixi-version: v0.45.0
3230
cache: true
3331
environments: ${{ matrix.environment }}
32+
- name: Build xsf
33+
run: pixi run --environment=tests-ci build-tests-ci
3434
- name: Run tests
35-
run: pixi run --environment=tests-ci tests-coverage-ci
35+
run: pixi run --skip-deps --environment=tests-ci tests-ci
36+
- name: Generate converage
37+
run: pixi run --skip-deps --environment=tests-ci coverage
3638
- name: Upload HTML coverage report
3739
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
3840
with:
39-
name: cov-html
41+
name: cov-html-${{ matrix.runs-on }}
4042
path: build/coverage_report/**

include/xsf/binom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ XSF_HOST_DEVICE inline double binom(double n, double k) {
5454
}
5555

5656
// general case
57-
if (n >= 1E10 * k and k > 0) {
57+
if (n >= 1E10 * k && k > 0) {
5858
// avoid under/overflows intermediate results
5959
return std::exp(-cephes::lbeta(1 + n - k, 1 + k) - std::log(n + 1));
6060
}

include/xsf/digamma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ XSF_HOST_DEVICE inline std::complex<double> digamma(std::complex<double> z) {
163163
return detail::digamma_zeta_series(z, detail::digamma_negroot, detail::digamma_negrootval);
164164
}
165165

166-
if (z.real() < 0 and std::abs(z.imag()) < smallabsz) {
166+
if (z.real() < 0 && std::abs(z.imag()) < smallabsz) {
167167
/* Reflection formula for digamma. See
168168
*
169169
*https://dlmf.nist.gov/5.5#E4

include/xsf/hyp2f1.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,38 +151,38 @@ namespace detail {
151151

152152
if (std::abs(u) >= std::abs(w)) {
153153
// u has greatest absolute value. Absorb ugh into the others.
154-
if (std::abs((v_prime - u_prime) * (v - 0.5)) < 100 * ugh and v > 100) {
154+
if (std::abs((v_prime - u_prime) * (v - 0.5)) < 100 * ugh && v > 100) {
155155
/* Special case where base is close to 1. Condition taken from
156156
* Boost's beta function implementation. */
157157
result *= std::exp((v - 0.5) * std::log1p((v_prime - u_prime) / ugh));
158158
} else {
159159
result *= std::pow(vgh / ugh, v - 0.5);
160160
}
161161

162-
if (std::abs((u_prime - w_prime) * (w - 0.5)) < 100 * wgh and u > 100) {
162+
if (std::abs((u_prime - w_prime) * (w - 0.5)) < 100 * wgh && u > 100) {
163163
result *= std::exp((w - 0.5) * std::log1p((u_prime - w_prime) / wgh));
164164
} else {
165165
result *= std::pow(ugh / wgh, w - 0.5);
166166
}
167167

168-
if (std::abs((u_prime - x_prime) * (x - 0.5)) < 100 * xgh and u > 100) {
168+
if (std::abs((u_prime - x_prime) * (x - 0.5)) < 100 * xgh && u > 100) {
169169
result *= std::exp((x - 0.5) * std::log1p((u_prime - x_prime) / xgh));
170170
} else {
171171
result *= std::pow(ugh / xgh, x - 0.5);
172172
}
173173
} else {
174174
// w has greatest absolute value. Absorb wgh into the others.
175-
if (std::abs((u_prime - w_prime) * (u - 0.5)) < 100 * wgh and u > 100) {
175+
if (std::abs((u_prime - w_prime) * (u - 0.5)) < 100 * wgh && u > 100) {
176176
result *= std::exp((u - 0.5) * std::log1p((u_prime - w_prime) / wgh));
177177
} else {
178178
result *= pow(ugh / wgh, u - 0.5);
179179
}
180-
if (std::abs((v_prime - w_prime) * (v - 0.5)) < 100 * wgh and v > 100) {
180+
if (std::abs((v_prime - w_prime) * (v - 0.5)) < 100 * wgh && v > 100) {
181181
result *= std::exp((v - 0.5) * std::log1p((v_prime - w_prime) / wgh));
182182
} else {
183183
result *= std::pow(vgh / wgh, v - 0.5);
184184
}
185-
if (std::abs((w_prime - x_prime) * (x - 0.5)) < 100 * xgh and x > 100) {
185+
if (std::abs((w_prime - x_prime) * (x - 0.5)) < 100 * xgh && x > 100) {
186186
result *= std::exp((x - 0.5) * std::log1p((w_prime - x_prime) / xgh));
187187
} else {
188188
result *= std::pow(wgh / xgh, x - 0.5);
@@ -539,7 +539,7 @@ XSF_HOST_DEVICE inline std::complex<double> hyp2f1(double a, double b, double c,
539539
}
540540
bool a_neg_int = a == std::trunc(a) && a < 0;
541541
bool b_neg_int = b == std::trunc(b) && b < 0;
542-
bool c_non_pos_int = c == std::trunc(c) and c <= 0;
542+
bool c_non_pos_int = c == std::trunc(c) && c <= 0;
543543
/* Diverges when c is a non-positive integer unless a is an integer with
544544
* c <= a <= 0 or b is an integer with c <= b <= 0, (or z equals 0 with
545545
* c != 0) Cases z = 0, a = 0, or b = 0 have already been handled. We follow

include/xsf/loggamma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ XSF_HOST_DEVICE inline std::complex<double> loggamma(std::complex<double> z) {
113113
if (std::isnan(z.real()) || std::isnan(z.imag())) {
114114
return {std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
115115
}
116-
if (z.real() <= 0 and z == std::floor(z.real())) {
116+
if (z.real() <= 0 && z == std::floor(z.real())) {
117117
set_error("loggamma", SF_ERROR_SINGULAR, NULL);
118118
return {std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
119119
}

0 commit comments

Comments
 (0)