Skip to content

Commit

Permalink
Fix count_inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Dec 24, 2022
1 parent 8555807 commit dce6860
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion subdivide.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def main(options: Namespace, inputdir: Path, outputdir: Path):
'deletions': {k: sum(d.deletions for d in v) for k, v in diffs.items()},
'total_changes': {k: sum(d.count_changes for d in v) for k, v in diffs.items()},
'mean_percent_change': {k: np.mean([d.percent_change for d in v]) for k, v in diffs.items()},
'count_inputs': len(diffs)
'count_inputs': mapper.count()
}
summary_file = outputdir / 'summary.json'
with summary_file.open('w') as out:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def test_main(tmp_path: Path):
assert set(summary[key].keys()) == expected_sub_keys

assert 'count_inputs' in summary
assert type(summary['count_inputs']) is int
assert summary['count_inputs'] == len(list(inputdir.rglob('*.mnc')))


def _rel(directory: Path) -> frozenset[Path]:
return frozenset(
filename.relative_to(directory)
for filename in directory.glob('**')
for filename in directory.rglob('*')
)

0 comments on commit dce6860

Please sign in to comment.