Skip to content

Commit 5e27d1b

Browse files
Merge pull request #662 from jeromekelleher/fix-warnings
Fix warnings
2 parents 581f788 + d8ad231 commit 5e27d1b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tsinfer/formats.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import sys
3030
import threading
3131
import uuid
32+
import warnings
3233

3334
import attr
3435
import humanize
@@ -512,7 +513,14 @@ def copy(self, path=None, max_file_size=None):
512513
# try to use copy_store on an in-memory array we end up
513514
# overwriting the original values.
514515
other.data = zarr.group()
515-
zarr.copy_all(source=self.data, dest=other.data)
516+
with warnings.catch_warnings():
517+
# Another workaround: if we don't absorb warnings here
518+
# we get "FutureWarning: missing object_codec for object array;
519+
# this will raise a ValueError in v3." Since this is an internal
520+
# Zarr call it seems easiest to just ignore for now and deal with
521+
# the ValueError if/when it happens
522+
warnings.simplefilter("ignore")
523+
zarr.copy_all(source=self.data, dest=other.data)
516524
for key, value in self.data.attrs.items():
517525
other.data.attrs[key] = value
518526
else:
@@ -2097,7 +2105,7 @@ def populations(self):
20972105
yield Population(j, metadata=metadata)
20982106

20992107

2100-
@attr.s(cmp=False)
2108+
@attr.s(order=False, eq=False)
21012109
class Ancestor:
21022110
"""
21032111
An ancestor object.

0 commit comments

Comments
 (0)