Skip to content

Commit

Permalink
Merge branch 'v0.1.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul4732saini committed Jul 30, 2024
2 parents 9ab80e6 + 0fac144 commit bb13c9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions fise/ospecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _field_extraction_alert() -> None:
"recorded files/directories. These fields are being assigned as 'None'."
)

# Sets `field_alert` attribute to `True` to avoid repeating the alert.
# Sets `field_alert` attribute to `True` to avoid alert repetition.
BaseEntity.field_alert = True


Expand All @@ -45,7 +45,6 @@ def wrapper(self) -> Any:

except Exception:
_field_extraction_alert()
return None

return wrapper

Expand Down
16 changes: 9 additions & 7 deletions tests/reset_tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""
Reset Tests Module
------------------
This module provides utilities to reset the test directories by regenerating them
based on the file and directory listings stored in the `test_directory.hdf` file.
This module provides utility functions to reset the test directories
by regenerating them based on the file and directory listings stored
in the `test_directory.hdf` file.
"""

import shutil
Expand All @@ -11,18 +13,18 @@
import pandas as pd

FILE_DIR_TEST_DIRECTORY = Path(__file__).parent / "test_directory" / "file_dir"
FILE_DIR_TEST_DIRECTORY_LISTINGS = Path(__file__).parent / "test_directory.hdf"
FILE_DIR_TEST_DIRECTORY_LISTINGS_FILE = Path(__file__).parent / "test_directory.hdf"


def reset_file_dir_test_directory(
directory: Path = FILE_DIR_TEST_DIRECTORY,
listings: Path = FILE_DIR_TEST_DIRECTORY_LISTINGS,
listings: Path = FILE_DIR_TEST_DIRECTORY_LISTINGS_FILE,
):
"""
Resets the `file_dir` test directory.
Deletes the existing `file_dir` test directory and recreates it based
on the directory and file listings stored in the specified HDF5 file.
on the file and directory listings stored in the specified HDF5 file.
"""

if directory.exists():
Expand All @@ -34,10 +36,10 @@ def reset_file_dir_test_directory(
dir_listings: pd.Series[str] = store["/file_dir/dirs"]

for direc in dir_listings:
directory.joinpath(direc).mkdir()
(directory / direc).mkdir()

for file in file_listings:
directory.joinpath(file).touch()
(directory / file).mkdir()


if __name__ == "__main__":
Expand Down

0 comments on commit bb13c9c

Please sign in to comment.