Skip to content

Commit 29cdcf2

Browse files
authored
Add some more del statements (#163)
1 parent 4b940e3 commit 29cdcf2

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/kohlrahbi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def main(pruefis: list[str], input_path: Path, output_path: Path, file_type: lis
226226
)
227227
continue
228228
del ahb_table
229+
del ahb_file_finder
229230
if "unfolded_ahb" in locals():
230231
del unfolded_ahb
231232
gc.collect()

src/kohlrahbi/ahbfilefinder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def filter_for_latest_ahb_docx_files(self) -> None:
4444
"""
4545
Filter the list of AHB docx paths for the latest AHB docx files.
4646
The latest files contain `LesefassungmitFehlerkorrekturen` in their file names.
47+
This method is _not_ pure. It changes the state of the object.
4748
"""
4849
result: list[Path] = []
4950

@@ -75,6 +76,7 @@ def filter_for_latest_ahb_docx_files(self) -> None:
7576
def filter_docx_files_for_edifact_format(self, edifact_format: EdifactFormat) -> None:
7677
"""
7778
Returns a list of docx files which contain the given edifact format.
79+
This method is not pure. It changes the state of the object.
7880
"""
7981

8082
self.paths_to_docx_files = [path for path in self.paths_to_docx_files if str(edifact_format) in path.name]
@@ -85,6 +87,7 @@ def get_docx_files_which_may_contain_searched_pruefi(self, searched_pruefi: str)
8587
Unfortunately, it is not clear in which docx the pruefidentifikator you are looking for is located.
8688
A 11042 belongs to the UTILMD format. However, there are seven docx files that describe the UTILMD format.
8789
A further reduction of the number of files is not possible with the pruefidentifikator only.
90+
This method is _not_ pure. It changes the state of the object.
8891
"""
8992

9093
edifact_format = get_format_of_pruefidentifikator(searched_pruefi)

src/kohlrahbi/unfoldedahb/unfoldedahbtable.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ def dump_flatahb_json(self, output_directory_path: Path) -> None:
360360
self.meta_data.pruefidentifikator,
361361
flatahb_output_directory_path / f"{self.meta_data.pruefidentifikator}.json",
362362
)
363+
del flat_ahb
364+
del dump_data
365+
if "existing_flat_ahb" in locals():
366+
del existing_flat_ahb
363367

364368
def convert_to_dataframe(self) -> pd.DataFrame:
365369
"""

0 commit comments

Comments
 (0)