Skip to content

Commit 64376e6

Browse files
Awkward v2 (#57)
* increase clouddrift version * set min awkward to v2 * remove ._v2 and change packed() -> to_packed()
1 parent 31a255a commit 64376e6

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

clouddrift/dataformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import awkward._v2 as ak
1+
import awkward as ak
22
import xarray as xr
33
import numpy as np
44
from collections.abc import Callable

clouddrift/select.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import awkward._v2 as ak
1+
import awkward as ak
22
import numpy as np
33

44

@@ -69,9 +69,9 @@ def subset(ds: ak.Array, criteria: dict) -> ak.Array:
6969
print("Empty set.")
7070
return ak.Array([])
7171
else: # apply the filtering for both dimensions
72-
ds_subset = ak.packed(ds[mask_traj])
72+
ds_subset = ak.to_packed(ds[mask_traj])
7373
ds_subset = ak.with_field(
74-
ds_subset, ak.packed(ds.obs[mask_obs][mask_traj]), "obs"
74+
ds_subset, ak.to_packed(ds.obs[mask_obs][mask_traj]), "obs"
7575
)
7676
ds_subset = ak.with_field(
7777
ds_subset, ak.Array([len(x) for x in ds_subset.obs.ids]), "rowsize"

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "clouddrift"
7-
version = "0.3.0"
7+
version = "0.3.1"
88
authors = [
99
{ name="Shane Elipot", email="[email protected]" },
1010
{ name="Philippe Miron", email="[email protected]" },
@@ -26,7 +26,7 @@ dependencies = [
2626
"pyarrow>=8.0.0",
2727
"tqdm>=4.64.0",
2828
"fsspec>=2022.3.0",
29-
"awkward>=1.9.0",
29+
"awkward>=2.0.0",
3030
]
3131

3232
[project.urls]

tests/dataformat_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import xarray as xr
55
import numpy as np
66
from clouddrift import RaggedArray
7-
import awkward._v2 as ak
7+
import awkward as ak
88

99
NETCDF_ARCHIVE = "test_archive.nc"
1010
PARQUET_ARCHIVE = "test_archive.parquet"

tests/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ dependencies:
1212
- llvmlite>=0.38.1
1313
- pip>=22.2.2
1414
- pip:
15-
- awkward
15+
- awkward>=2.0.0
1616
- git+https://github.com/Cloud-Drift/clouddrift.git

tests/select_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest import TestCase
33
import numpy as np
44
import xarray as xr
5-
import awkward._v2 as ak
5+
import awkward as ak
66
from clouddrift import RaggedArray, select
77

88
if __name__ == "__main__":

0 commit comments

Comments
 (0)