Skip to content

Commit 2dd835c

Browse files
selipotPhilippe Miron
andauthored
subset docstring edit (#364)
* subset docstring edit * black v24 --------- Co-authored-by: Philippe Miron <[email protected]>
1 parent bd1037d commit 2dd835c

File tree

9 files changed

+25
-25
lines changed

9 files changed

+25
-25
lines changed

clouddrift/adapters/gdp1h.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,11 +601,11 @@ def to_raggedarray(
601601
)
602602

603603
# set dynamic global attributes
604-
ra.attrs_global[
605-
"time_coverage_start"
606-
] = f"{datetime(1970,1,1) + timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
607-
ra.attrs_global[
608-
"time_coverage_end"
609-
] = f"{datetime(1970,1,1) + timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
604+
ra.attrs_global["time_coverage_start"] = (
605+
f"{datetime(1970,1,1) + timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
606+
)
607+
ra.attrs_global["time_coverage_end"] = (
608+
f"{datetime(1970,1,1) + timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
609+
)
610610

611611
return ra

clouddrift/adapters/gdp6h.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@ def to_raggedarray(
488488
)
489489

490490
# update dynamic global attributes
491-
ra.attrs_global[
492-
"time_coverage_start"
493-
] = f"{datetime(1970,1,1) + timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
494-
ra.attrs_global[
495-
"time_coverage_end"
496-
] = f"{datetime(1970,1,1) + timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
491+
ra.attrs_global["time_coverage_start"] = (
492+
f"{datetime(1970,1,1) + timedelta(seconds=int(np.min(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
493+
)
494+
ra.attrs_global["time_coverage_end"] = (
495+
f"{datetime(1970,1,1) + timedelta(seconds=int(np.max(ra.coords['time']))):%Y-%m-%d:%H:%M:%SZ}"
496+
)
497497

498498
return ra

clouddrift/adapters/glad.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
---------
1414
Özgökmen, Tamay. 2013. GLAD experiment CODE-style drifter trajectories (low-pass filtered, 15 minute interval records), northern Gulf of Mexico near DeSoto Canyon, July-October 2012. Distributed by: Gulf of Mexico Research Initiative Information and Data Cooperative (GRIIDC), Harte Research Institute, Texas A&M University–Corpus Christi. doi:10.7266/N7VD6WC8
1515
"""
16+
1617
from clouddrift.adapters.utils import download_with_progress
1718
from io import BytesIO
1819
import numpy as np

clouddrift/adapters/mosaic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
>>> from clouddrift.adapters import mosaic
1919
>>> ds = mosaic.to_xarray()
2020
"""
21+
2122
from datetime import datetime
2223
from io import BytesIO
2324
import numpy as np

clouddrift/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
they will be downloaded from their upstream repositories and stored for later access
55
(~/.clouddrift for UNIX-based systems).
66
"""
7+
78
from io import BufferedReader, BytesIO
89
from clouddrift import adapters
910
import os

clouddrift/pairs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Functions to analyze pairs of contiguous data segments.
33
"""
4+
45
from clouddrift import ragged, sphere
56
from concurrent.futures import as_completed, ThreadPoolExecutor
67
import itertools

clouddrift/ragged.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,17 +558,17 @@ def subset(
558558
Parameters
559559
----------
560560
ds : xr.Dataset
561-
Dataset stored as ragged arrays
561+
Dataset stored as ragged arrays.
562562
criteria : dict
563-
dictionary containing the variables (as keys) and the ranges/values/functions (as values) to subset
563+
Dictionary containing the variables (as keys) and the ranges/values/functions (as values) to subset.
564564
id_var_name : str, optional
565-
Name of the variable containing the ID of the trajectories (default is "id")
565+
Name of the variable with dimension `traj_dim_name` containing the ID of the trajectories (default is "id").
566566
rowsize_var_name : str, optional
567-
Name of the variable containing the number of observations per trajectory (default is "rowsize")
567+
Name of the variable containing the number of observations per trajectory (default is "rowsize").
568568
traj_dim_name : str, optional
569-
Name of the trajectory dimension (default is "traj")
569+
Name of the trajectory dimension (default is "traj").
570570
obs_dim_name : str, optional
571-
Name of the observation dimension (default is "obs")
571+
Name of the observation dimension (default is "obs").
572572
full_trajectories : bool, optional
573573
If True, it returns the complete trajectories (rows) where at least one observation
574574
matches the criteria, rather than just the segments where the criteria are satisfied.

clouddrift/raggedarray.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
structure used by CloudDrift to process custom Lagrangian datasets to Xarray
44
Datasets and Awkward Arrays.
55
"""
6+
67
import awkward as ak
78
from clouddrift.ragged import rowsize_to_index
89
import xarray as xr

clouddrift/wavelet.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ def morse_wavelet(
429429
if normalization == "energy":
430430
with np.errstate(divide="ignore"):
431431
waveletzero = np.exp(
432-
beta * np.log(norm_radian_frequency)
433-
- norm_radian_frequency**gamma
432+
beta * np.log(norm_radian_frequency) - norm_radian_frequency**gamma
434433
)
435434
elif normalization == "bandpass":
436435
if beta == 0:
@@ -800,11 +799,7 @@ def morse_amplitude(
800799
if normalization == "energy":
801800
r = (2 * beta + 1) / gamma
802801
amp = (
803-
2
804-
* np.pi
805-
* gamma
806-
* (2**r)
807-
* np.exp(_lgamma(order) - _lgamma(order + r - 1))
802+
2 * np.pi * gamma * (2**r) * np.exp(_lgamma(order) - _lgamma(order + r - 1))
808803
) ** 0.5
809804
elif normalization == "bandpass":
810805
fm, _, _ = morse_freq(gamma, beta)

0 commit comments

Comments
 (0)