Skip to content

Commit

Permalink
fixes to split slice (#97)
Browse files Browse the repository at this point in the history
the tutorials now use the new `split/slice` API of `metatensor`
  • Loading branch information
DavideTisi authored Nov 13, 2024
1 parent bc91abb commit 5f55108
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/lode-linear/lode-linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@
# That we use as input to the :py:func:`metatensor.split()` function

X_sr_train, X_sr_test = metatensor.split(
X_sr, axis="samples", grouped_labels=grouped_labels
X_sr, axis="samples", selections=grouped_labels
)

X_lr_train, X_lr_test = metatensor.split(
X_lr, axis="samples", grouped_labels=grouped_labels
X_lr, axis="samples", selections=grouped_labels
)

y_train, y_test = metatensor.split(y, axis="samples", grouped_labels=grouped_labels)
y_train, y_test = metatensor.split(y, axis="samples", selections=grouped_labels)


# %%
Expand Down
2 changes: 1 addition & 1 deletion examples/sample-selection/sample-selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
atom_soap_single_block_fps = metatensor.slice(
atom_soap_single_block,
axis="properties",
labels=feat_fps.support.block(0).properties,
selection=feat_fps.support.block(0).properties,
)

print(
Expand Down

0 comments on commit 5f55108

Please sign in to comment.