diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..ce5a7b4f Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 56636f62..d2d98d6f 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,6 @@ ENV/ # setuptools-scm will bundled that in the sdist but we don't want it tracked xbitinfo/_version.py + +# macos folder visualisation +.DS_Store diff --git a/xbitinfo/xbitinfo.py b/xbitinfo/xbitinfo.py index 4450a98f..7c2afc4b 100644 --- a/xbitinfo/xbitinfo.py +++ b/xbitinfo/xbitinfo.py @@ -232,6 +232,10 @@ def get_bitinformation( # noqa: C901 info_per_bit = {} pbar = tqdm(ds.data_vars) for var in pbar: + # Check for non-finite values + if np.any(ds[var].isnull()): + warning_message = f"Warning: Variable {var} in the dataset contains non-finite values (NaNs or infs). Unexpected results may occur." + logging.warning(warning_message) pbar.set_description(f"Processing var: {var} for dim: {dim}") if implementation == "julia": info_per_bit_var = _jl_get_bitinformation(ds, var, axis, dim, kwargs)