Skip to content

Commit

Permalink
code fixing for pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosmaggioros committed Oct 28, 2024
1 parent 8f3f008 commit a9b23e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion NiChart_DLMUSE/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def main() -> None:
print(args)
print()


if len(os.listdir(out_dir)) != 0:
print(f"Emptying output folder: {out_dir}...")
os.system(f"rm -r {out_dir}/*")
Expand Down
14 changes: 8 additions & 6 deletions NiChart_DLMUSE/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,14 @@ def dir_size(in_dir: str) -> int:

def split_data(in_dir: str, N: int) -> list:
"""
Splits the input data directory into subfolders of size.
N should be > 0 and the number of files in each subfolder should be > 0 as well.
Splits the input data directory into subfolders of size.
N should be > 0 and the number of files in each subfolder should be > 0 as well.
"""
assert N > 0
data_size = dir_size(in_dir)
no_files_in_folders = data_size // N if (data_size % N == 0) else (data_size // N) + 1
no_files_in_folders = (
data_size // N if (data_size % N == 0) else (data_size // N) + 1
)
assert no_files_in_folders > 0
subfolders = []

Expand All @@ -179,15 +181,15 @@ def split_data(in_dir: str, N: int) -> list:

def remove_subfolders(in_dir: str) -> None:
"""
Removes all the split_* subolders from the input folder
Removes all the split_* subolders from the input folder
"""
os.system(f"rm -r {in_dir}/split_*")


def merge_output_data(in_dir: str) -> None:
"""
Takes all the results from the temp_working_fir and moves them into
the results/ subfolder in the output folder
Takes all the results from the temp_working_fir and moves them into
the results/ subfolder in the output folder
"""

os.system(f"mkdir {in_dir}/results")
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from pathlib import Path

import setuptools
from setuptools import find_packages, setup

this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

with open('requirements.txt') as f:
with open("requirements.txt") as f:
required = f.read().splitlines()


Expand Down Expand Up @@ -42,6 +41,6 @@
"nnunet",
],
package_data={
'NiChart_DLMUSE': ['**/*.csv', '**/*.json'],
"NiChart_DLMUSE": ["**/*.csv", "**/*.json"],
},
)

0 comments on commit a9b23e0

Please sign in to comment.