Skip to content

Commit

Permalink
Hotfix/compute distributions (#339)
Browse files Browse the repository at this point in the history
* fallback to random split

* add setup.py

Co-authored-by: Andrea Azzini <[email protected]>
  • Loading branch information
Fl4m3Ph03n1x and andreaazzini authored Feb 8, 2022
1 parent 9cc6588 commit 967991b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions darwin/dataset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ def compute_distributions(
for partition in partitions:
for annotation_type in annotation_types:
split_file: Path = split_path / f"stratified_{annotation_type}_{partition}.txt"
if not split_file.exists():
split_file = split_path / f"random_{partition}.txt"
stems: List[str] = [e.rstrip("\n\r") for e in split_file.open()]

for stem in stems:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"darwin.exporter",
"darwin.importer.formats",
"darwin.exporter.formats",
"darwin.version",
],
entry_points={"console_scripts": ["darwin=darwin.cli:main"]},
classifiers=["Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License"],
Expand Down

0 comments on commit 967991b

Please sign in to comment.