Skip to content

Commit 6ed9a12

Browse files
Add sample wrapper (#79)
* add `sample` wrapper * [pre-commit.ci lite] apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent e1fbc0d commit 6ed9a12

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: check-added-large-files
1717
- id: detect-private-key
1818
- repo: https://github.com/python-poetry/poetry
19-
rev: "2.0.1"
19+
rev: "2.1.1"
2020
hooks:
2121
- id: poetry-check
2222
- repo: https://github.com/tox-dev/pyproject-fmt

media/coverage-badge.svg

Lines changed: 1 addition & 1 deletion
Loading

src/cytodataframe/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def _wrap_methods(self) -> None:
320320
"""
321321

322322
# list of methods by name from Pandas DataFrame class
323-
methods_to_wrap = ["head", "tail", "sort_values"]
323+
methods_to_wrap = ["head", "tail", "sort_values", "sample"]
324324

325325
# set the wrapped method for the class instance
326326
for method_name in methods_to_wrap:

tests/test_frame.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ def test_return_cytodataframe(cytotable_NF1_data_parquet_shrunken: str):
221221
assert isinstance(cdf.head(), CytoDataFrame)
222222
assert isinstance(cdf.tail(), CytoDataFrame)
223223
assert isinstance(cdf.sort_values(by="Metadata_ImageNumber"), CytoDataFrame)
224+
assert isinstance(cdf.sample(n=5), CytoDataFrame)

0 commit comments

Comments
 (0)