Skip to content

Commit

Permalink
Add comments clarifying how paths are calculated and how pdfs are mer…
Browse files Browse the repository at this point in the history
…ged (#63)

* Add comments clarifying how paths are calculated and how pdfs are merged

* Remove access to field since "formatted_file" is not an object

Co-authored-by: Pirmin Kaufmann <[email protected]>

---------

Co-authored-by: Nestor Tarin Burriel <[email protected]>
Co-authored-by: Pirmin Kaufmann <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent d5c2239 commit dcb17f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pyflexplot/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def main(
for iter_i in range(iter_max):
all_out_file_paths_tmp = list(all_out_file_paths)
try:
# merges all pdfs plots and returns the list of the
# original parts before the merge which might be kept in disk or not
# merged files are kept in the "dest_dir" which is later on used to track which files to upload
pdf_page_paths = merge_pdf_plots(
all_out_file_paths_tmp,
tmp_dir=tmp_dir,
Expand Down
6 changes: 6 additions & 0 deletions src/pyflexplot/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ def format(
time_steps=time_steps,
species_name=species_name,
)

# we need to check whether the file path has already been formatted
# since the same path might be calculated, then we need to derive a unique path
# until is not in any of the previously formatted paths
while path in self.previous:
# template and path are recalculated on each loop
# we need to first calculate the new template before re-formatting the file
template = self.derive_unique_path(
self._format_template(
template,
Expand Down

0 comments on commit dcb17f5

Please sign in to comment.