diff --git a/.github/workflows/monthly-warning-test.yml b/.github/workflows/monthly-warning-test.yml index 544ee8e..1e5a9f9 100644 --- a/.github/workflows/monthly-warning-test.yml +++ b/.github/workflows/monthly-warning-test.yml @@ -5,6 +5,10 @@ on: schedule: # Runs "First of every month at 3:15am Central" - cron: '15 8 1 * *' + push: + branches: + - main + pull_request: null jobs: tests: diff --git a/dsps/utils.py b/dsps/utils.py index 5dc8436..6fe9fae 100644 --- a/dsps/utils.py +++ b/dsps/utils.py @@ -281,6 +281,27 @@ def cumtrapz(xarr, yarr): return cumtrapz +@jjit +def trapz(xarr, yarr): + """Trapezoidal integral + + Parameters + ---------- + xarr : ndarray, shape (n, ) + + yarr : ndarray, shape (n, ) + + Returns + ------- + result : float + + """ + res_init = xarr[0], yarr[0], 0.0 + scan_data = xarr, yarr + cumtrapz = scan(_cumtrapz_scan_func, res_init, scan_data)[1] + return cumtrapz[-1] + + @jjit def cumulative_mstar_formed(t_table, sfh_table): """Compute the cumulative stellar mass formed at each input time