Skip to content

Commit

Permalink
formatting, remove unused stuff
Browse files Browse the repository at this point in the history
Co-authored-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
  • Loading branch information
coxipi and Zeitsperre authored Nov 6, 2024
1 parent d51c1fb commit ce43d51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
4 changes: 0 additions & 4 deletions src/xsdba/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@

logger = logging.getLogger("xsdba")

try:
from pytest_socket import SocketBlockedError
except ImportError:
SocketBlockedError = None


def test_cannon_2015_dist(): # noqa: D103
Expand Down
38 changes: 19 additions & 19 deletions src/xsdba/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,14 @@ def rank(
Parameters
----------
da: xr.DataArray
Source array.
da : xr.DataArray
Source array.
dim : str | list[str], hashable
Dimension(s) over which to compute rank.
Dimension(s) over which to compute rank.
pct : bool, optional
If True, compute percentage ranks, otherwise compute integer ranks.
Percentage ranks range from 0 to 1, in opposition to xarray's implementation,
where they range from 1/N to 1.
If True, compute percentage ranks, otherwise compute integer ranks.
Percentage ranks range from 0 to 1, in opposition to xarray's implementation,
where they range from 1/N to 1.
Returns
-------
Expand Down Expand Up @@ -583,12 +583,12 @@ def pc_matrix(arr: np.ndarray | dsk.Array) -> np.ndarray | dsk.Array:
Parameters
----------
arr : numpy.ndarray or dask.array.Array
2D array (M, N) of the M coordinates of N points.
2D array (M, N) of the M coordinates of N points.
Returns
-------
numpy.ndarray or dask.array.Array
MxM Array of the same type as arr.
MxM Array of the same type as arr.
"""
# Get appropriate math module
mod = dsk if isinstance(arr, dsk.Array) else np
Expand Down Expand Up @@ -624,17 +624,17 @@ def best_pc_orientation_simple(
Parameters
----------
R : np.ndarray
MxM Matrix defining the final transformation.
MxM Matrix defining the final transformation.
Hinv : np.ndarray
MxM Matrix defining the (inverse) first transformation.
MxM Matrix defining the (inverse) first transformation.
val : float
The coordinate of the test point (same for all axes). It should be much
greater than the largest furthest point in the array used to define B.
The coordinate of the test point (same for all axes). It should be much
greater than the largest furthest point in the array used to define B.
Returns
-------
np.ndarray
Mx1 vector of orientation correction (1 or -1).
Mx1 vector of orientation correction (1 or -1).
See Also
--------
Expand Down Expand Up @@ -674,20 +674,20 @@ def best_pc_orientation_full(
Parameters
----------
R : np.ndarray
MxM Matrix defining the final transformation.
MxM Matrix defining the final transformation.
Hinv : np.ndarray
MxM Matrix defining the (inverse) first transformation.
MxM Matrix defining the (inverse) first transformation.
Rmean : np.ndarray
M vector defining the target distribution center point.
M vector defining the target distribution center point.
Hmean : np.ndarray
M vector defining the original distribution center point.
M vector defining the original distribution center point.
hist : np.ndarray
MxN matrix of all training observations of the M variables/sites.
MxN matrix of all training observations of the M variables/sites.
Returns
-------
np.ndarray
M vector of orientation correction (1 or -1).
M vector of orientation correction (1 or -1).
References
----------
Expand Down

0 comments on commit ce43d51

Please sign in to comment.