From 3f1a45f2871b10685b579d3a10e19bd09256310a Mon Sep 17 00:00:00 2001 From: Aaron Wienkers Date: Wed, 6 Aug 2025 14:43:58 +0200 Subject: [PATCH 1/2] Fixes xarray skin() function argument ordering mismatch with apply_ufunc. Now consistent with aerobulk. --- source/aerobulk/flux.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/source/aerobulk/flux.py b/source/aerobulk/flux.py index af6c5ff..25b8635 100644 --- a/source/aerobulk/flux.py +++ b/source/aerobulk/flux.py @@ -309,9 +309,9 @@ def skin( hum_zt, u_zu, v_zu, - rad_sw, - rad_lw, slp=101000.0, + rad_sw=None, + rad_lw=None, algo="coare3p0", zt=2, zu=10, @@ -377,9 +377,14 @@ def skin( """ _check_algo(algo, VALID_ALGOS_SKIN) - - sst, t_zt, hum_zt, u_zu, v_zu, rad_sw, rad_lw, slp = xr.broadcast( - sst, t_zt, hum_zt, u_zu, v_zu, rad_sw, rad_lw, slp + + if rad_sw is None: + raise ValueError("rad_sw is required and cannot be None") + if rad_lw is None: + raise ValueError("rad_lw is required and cannot be None") + + sst, t_zt, hum_zt, u_zu, v_zu, slp, rad_sw, rad_lw = xr.broadcast( + sst, t_zt, hum_zt, u_zu, v_zu, slp, rad_sw, rad_lw ) if input_range_check: @@ -396,9 +401,9 @@ def skin( hum_zt, u_zu, v_zu, + slp, rad_sw, rad_lw, - slp, input_core_dims=[()] * 8, output_core_dims=[()] * 6, dask="parallelized", From c9427eab050b5c7200f0f6b8bb0175fcbb8ca5eb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 12:53:39 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/aerobulk/flux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/aerobulk/flux.py b/source/aerobulk/flux.py index 25b8635..094472f 100644 --- a/source/aerobulk/flux.py +++ b/source/aerobulk/flux.py @@ -377,7 +377,7 @@ def skin( """ _check_algo(algo, VALID_ALGOS_SKIN) - + if rad_sw is None: raise ValueError("rad_sw is required and cannot be None") if rad_lw is None: