Skip to content

Commit

Permalink
Revert "Add files in current path also to filelist"
Browse files Browse the repository at this point in the history
  • Loading branch information
PietrH authored Mar 8, 2024
1 parent 0755bdf commit ec66e3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install '${{ needs.prepare.outputs.wheel-distribution }}'
python -m pip install pytest moto[s3]<5.0 pytest-cov
python -m pip install pytest moto[s3] pytest-cov
- name: Run unit tests on pinned dependencies
run: >-
pytest -rFEx --durations 10 --color yes # pytest args
Expand Down
11 changes: 3 additions & 8 deletions src/vptstools/bin/vph5_to_vpts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import tempfile
from itertools import chain
from functools import partial
import shutil
from pathlib import Path
Expand Down Expand Up @@ -99,8 +98,7 @@ def cli(modified_days_ago, path_s3_folder=None):
f"Ignoring the modified date of the files.")

inbo_s3 = s3fs.S3FileSystem(**storage_options)
odim5_files = chain(inbo_s3.glob(f"{S3_BUCKET}/{path_s3_folder}/**/*.h5"),
inbo_s3.glob(f"{S3_BUCKET}/{path_s3_folder}/*.h5"))
odim5_files = inbo_s3.glob(f"{S3_BUCKET}/{path_s3_folder}/**/*.h5")

days_to_create_vpts = (
pd.DataFrame(odim5_files, columns=["file"])
Expand All @@ -113,9 +111,6 @@ def cli(modified_days_ago, path_s3_folder=None):
}
)
)
if len(days_to_create_vpts) == 0:
raise Exception(f"No h5 files could be found in the current"
f" path '{S3_BUCKET}/{path_s3_folder}'.")

else:
# Load the S3 manifest of today
Expand Down Expand Up @@ -197,7 +192,7 @@ def cli(modified_days_ago, path_s3_folder=None):
shutil.rmtree(temp_folder_path)
except Exception as exc:
click.echo(f"[WARNING] - During conversion from HDF5 files of {source}/{radar_code} at "
f"{year}-{month}-{day} to daily VPTS file, the following error occurred: {type(exc).__name__} - {exc}.")
f"{year}-{month}-{day} to daily VPTS file, the following error occurred: {exc}.")

click.echo("Finished creating daily VPTS files.")

Expand Down Expand Up @@ -245,7 +240,7 @@ def cli(modified_days_ago, path_s3_folder=None):
)
except Exception as exc:
click.echo(f"[WARNING] - During conversion from HDF5 files of {source}/{radar_code} at "
f"{year}-{month}-{day} to monthly VPTS file, the following error occurred: {type(exc).__name__} - {exc}.")
f"{year}-{month}-{day} to monthly VPTS file, the following error occurred: {exc}.")

click.echo("Finished creating monthly VPTS files.")
click.echo("Finished VPTS update procedure.")
Expand Down

0 comments on commit ec66e3a

Please sign in to comment.