Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing uses #969

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Release

on: [push, pull_request]
on:
push:
tags:
- '*'

env:
earliest_python: "3.8"
latest_python: "3.12"
miniforge_version: "23.11.0-0"
miniforge_variant: "Mambaforge"

jobs:
build_sdist:
Expand Down Expand Up @@ -64,9 +73,11 @@ jobs:
- name: Build wheels (py ${{ matrix.pyver }}) Windows
if: matrix.os == 'windows-latest'
env:
CIBW_ARCHS_WINDOWS: "amd64 win32 arm64"
CIBW_ARCHS_WINDOWS: "amd64 win32"
CIBW_BUILD: "cp${{ matrix.pyver }}-*"

uses: pypa/[email protected]

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -90,7 +101,7 @@ jobs:
- name: Check artifacts
run: ls -lrt dist/

- name: Publish a Python distribution to PyPI
- name: Publish Distribution
uses: pypa/[email protected]
with:
user: __token__
Expand Down
2 changes: 1 addition & 1 deletion biom/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2488,7 +2488,7 @@ def part_f(i, m):
for vals, id_, md in self.iter(dense=False, axis=axis):
part = part_f(id_, md)

if part is None:
if ignore_none and part is None:
continue

# try to make it hashable...
Expand Down
16 changes: 15 additions & 1 deletion biom/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4309,7 +4309,7 @@ def test_partition_remove_empty(self):
False: Table(np.array([[1, 2]]), ['O1', ], ['S2', 'S3'])}
self.assertEqual(obs, exp)

def test_partition_ignore_none(self):
def test_partition_ignore_none_true(self):
t = Table(np.array([[0, 1, 2],
[3, 0, 0],
[4, 0, 0]]),
Expand All @@ -4321,6 +4321,20 @@ def test_partition_ignore_none(self):
['O1', 'O2', 'O3'], ['S1', ])}
self.assertEqual(obs, exp)

def test_partition_ignore_none_false(self):
t = Table(np.array([[0, 1, 2],
[3, 0, 0],
[4, 0, 0]]),
['O1', 'O2', 'O3'],
['S1', 'S2', 'S3'])
part_f = lambda i, m: True if i == 'S1' else None # noqa
obs = dict(t.partition(part_f, ignore_none=False))
exp = {True: Table(np.array([[0, ], [3, ], [4, ]]),
['O1', 'O2', 'O3'], ['S1', ]),
None: Table(np.array([[1, 2], [0, 0], [0, 0]]),
['O1', 'O2', 'O3'], ['S2', 'S3'])}
self.assertEqual(obs, exp)

def test_partition_dict_ids_to_groups(self):
t = Table(np.array([[0, 1, 2],
[3, 0, 0],
Expand Down
Loading