Skip to content

Commit

Permalink
🩹 Fix repr issue with numpy>2 str values
Browse files Browse the repository at this point in the history
This caused the following test error:
```py
FAILED glotaran/utils/test/test_io.py::test_create_clp_guide_dataset_errors - assert "Unknown clp_...'species_3')]" == "Unknown clp_... 'species_3']"

  Skipping 49 identical leading characters in diff, use -v to show
    ls are:
  -  ['species_1', 'species_2', 'species_3']
  +  [np.str_('species_1'), np.str_('species_2'), np.str_('species_3')]
```
  • Loading branch information
s-weigand authored and jsnel committed Aug 25, 2024
1 parent bfddd0e commit ce8b100
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glotaran/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def create_clp_guide_dataset(
if clp_label not in dataset.clp_label:
raise ValueError(
f"Unknown clp_label {clp_label!r}. "
f"Known clp_labels are:\n {list(dataset.clp_label.values)}"
f"Known clp_labels are:\n {[str(label) for label in dataset.clp_label.values]}"
)
if "model_dimension" not in dataset.attrs:
raise ValueError(
Expand Down

0 comments on commit ce8b100

Please sign in to comment.