Skip to content

Commit 3a25fb1

Browse files
committed
replace non-ASCII chars in copy_modality_slots (CI Java encoding bug)
1 parent 2988dee commit 3a25fb1

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/metadata/copy_modality_slots/script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def reindex_obsm_value(value, src_to_tgt_obs, target_axis_index):
166166

167167

168168
def validate_axis_containment(source_idx, target_idx, axis, allow_partial):
169-
"""Return sourcetarget position mapping; raise if the source has names not
169+
"""Return source-to-target position mapping; raise if the source has names not
170170
in the target, or (unless ``allow_partial``) the sets differ."""
171171
src_to_tgt = target_idx.get_indexer(source_idx)
172172
missing_in_target = src_to_tgt < 0

src/metadata/copy_modality_slots/test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ def test_strict_copy_all_slot_kinds(
179179
out.var["highly_variable"].to_numpy(), src.var["highly_variable"].to_numpy()
180180
)
181181

182-
# .layers dense and sparse
182+
# .layers - dense and sparse
183183
np.testing.assert_allclose(out.layers["logcounts"], src.layers["logcounts"])
184184
assert sp.issparse(out.layers["sparse_layer"])
185185
np.testing.assert_allclose(
186186
out.layers["sparse_layer"].toarray(), src.layers["sparse_layer"].toarray()
187187
)
188188

189-
# .obsm dense, sparse, DataFrame
189+
# .obsm - dense, sparse, DataFrame
190190
np.testing.assert_allclose(out.obsm["X_pca"], src.obsm["X_pca"])
191191
assert sp.issparse(out.obsm["sparse_obsm"])
192192
np.testing.assert_allclose(
@@ -213,7 +213,7 @@ def test_strict_copy_all_slot_kinds(
213213
def test_strict_reorder_source(
214214
run_component, target_mdata, source_mdata_equal, write_mdata, tmp_path, rng
215215
):
216-
# Same index sets, but source rows shuffled values must end up correctly
216+
# Same index sets, but source rows shuffled - values must end up correctly
217217
# aligned to target order in the output.
218218
src = source_mdata_equal["rna"]
219219
shuffled = src[rng.permutation(src.n_obs), rng.permutation(src.n_vars)].copy()
@@ -270,7 +270,7 @@ def test_strict_errors_when_source_smaller(
270270
def test_errors_when_source_has_extra_cells(
271271
run_component, target_mdata, source_mdata_equal, write_mdata, tmp_path, rng
272272
):
273-
# Add a cell to source that's not in target should error in both strict
273+
# Add a cell to source that's not in target - should error in both strict
274274
# and partial modes (source must be a subset of target).
275275
src = source_mdata_equal["rna"]
276276
extra = src[:1].copy()
@@ -419,13 +419,13 @@ def test_auto_token_only_copies_new_keys(
419419
)
420420

421421
out = mudata.read_h5mu(output)["rna"]
422-
# 'label' was already in target not copied; pre_existing values remain.
422+
# 'label' was already in target -> not copied; pre_existing values remain.
423423
assert (out.obs["label"] == "pre_existing").all()
424-
# 'score' was not in target copied.
424+
# 'score' was not in target -> copied.
425425
assert "score" in out.obs.columns
426-
# X_pca was already in target not copied; remains zeros.
426+
# X_pca was already in target -> not copied; remains zeros.
427427
np.testing.assert_array_equal(out.obsm["X_pca"], np.zeros((tgt.n_obs, 5)))
428-
# 'pca' and 'params' uns keys were absent copied.
428+
# 'pca' and 'params' uns keys were absent -> copied.
429429
assert "pca" in out.uns and "params" in out.uns
430430

431431

0 commit comments

Comments
 (0)