|
1 | 1 | # MIT License
|
2 | 2 | #
|
3 |
| -# Copyright (c) 2018-2022 Tskit Developers |
| 3 | +# Copyright (c) 2018-2024 Tskit Developers |
4 | 4 | #
|
5 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 | 6 | # of this software and associated documentation files (the "Software"), to deal
|
|
26 | 26 | compiled module exporting the LightweightTableCollection class.
|
27 | 27 | See the test_example_c_module file for an example.
|
28 | 28 | """
|
| 29 | + |
29 | 30 | import copy
|
30 | 31 |
|
31 | 32 | import kastore
|
32 | 33 | import msprime
|
33 | 34 | import numpy as np
|
34 | 35 | import pytest
|
35 |
| - |
36 | 36 | import tskit
|
37 | 37 | import tskit.util as util
|
38 | 38 |
|
@@ -98,7 +98,7 @@ def full_ts():
|
98 | 98 |
|
99 | 99 | # The ts above is used for the whole test session, but our tests need fresh tables to
|
100 | 100 | # modify
|
101 |
| -@pytest.fixture |
| 101 | +@pytest.fixture() |
102 | 102 | def tables(full_ts):
|
103 | 103 | return full_ts.dump_tables()
|
104 | 104 |
|
@@ -183,9 +183,7 @@ def test_example(self, tables):
|
183 | 183 | {
|
184 | 184 | "codec": "struct",
|
185 | 185 | "type": "object",
|
186 |
| - "properties": { |
187 |
| - table: {"type": "string", "binaryFormat": "50p"} |
188 |
| - }, |
| 186 | + "properties": {table: {"type": "string", "binaryFormat": "50p"}}, |
189 | 187 | }
|
190 | 188 | )
|
191 | 189 |
|
@@ -459,9 +457,7 @@ def verify_optional_column(self, tables, table_len, table_name, col_name):
|
459 | 457 | out[table_name][col_name], np.zeros(table_len, dtype=np.int32) - 1
|
460 | 458 | )
|
461 | 459 |
|
462 |
| - def verify_offset_pair( |
463 |
| - self, tables, table_len, table_name, col_name, required=False |
464 |
| - ): |
| 460 | + def verify_offset_pair(self, tables, table_len, table_name, col_name, required=False): |
465 | 461 | offset_col = col_name + "_offset"
|
466 | 462 |
|
467 | 463 | if not required:
|
@@ -544,9 +540,7 @@ def test_individuals(self, tables):
|
544 | 540 | self.verify_offset_pair(
|
545 | 541 | tables, len(tables.individuals), "individuals", "location"
|
546 | 542 | )
|
547 |
| - self.verify_offset_pair( |
548 |
| - tables, len(tables.individuals), "individuals", "parents" |
549 |
| - ) |
| 543 | + self.verify_offset_pair(tables, len(tables.individuals), "individuals", "parents") |
550 | 544 | self.verify_offset_pair(
|
551 | 545 | tables, len(tables.individuals), "individuals", "metadata"
|
552 | 546 | )
|
@@ -578,9 +572,7 @@ def test_migrations(self, tables):
|
578 | 572 | self.verify_required_columns(
|
579 | 573 | tables, "migrations", ["left", "right", "node", "source", "dest", "time"]
|
580 | 574 | )
|
581 |
| - self.verify_offset_pair( |
582 |
| - tables, len(tables.migrations), "migrations", "metadata" |
583 |
| - ) |
| 575 | + self.verify_offset_pair(tables, len(tables.migrations), "migrations", "metadata") |
584 | 576 | self.verify_optional_column(tables, len(tables.nodes), "nodes", "individual")
|
585 | 577 | self.verify_metadata_schema(tables, "migrations")
|
586 | 578 |
|
@@ -674,9 +666,7 @@ def get_refseq(d):
|
674 | 666 | assert get_refseq(d).is_null()
|
675 | 667 |
|
676 | 668 | # All empty strings is the same thing
|
677 |
| - d["reference_sequence"] = dict( |
678 |
| - data="", url="", metadata_schema="", metadata=b"" |
679 |
| - ) |
| 669 | + d["reference_sequence"] = dict(data="", url="", metadata_schema="", metadata=b"") |
680 | 670 | assert get_refseq(d).is_null()
|
681 | 671 |
|
682 | 672 | del refseq_dict["metadata_schema"] # handled above
|
|
0 commit comments