Skip to content

Commit

Permalink
Checking identifier within filename instead of path
Browse files Browse the repository at this point in the history
  • Loading branch information
jsreuss committed Nov 22, 2024
1 parent 4801f1c commit be43878
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eurocropsml/acquisition/clipping/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

def _get_xml_file(filepath: Path, band: str, identifier: str = "calibration") -> Path:
files: list[Path] = list(filepath.iterdir())
return [file for file in files if f"{band.lower()}" in str(file) and identifier in str(file)][0]
return [
file
for file in files
if f"{band.lower()}" in str(file.stem) and identifier in str(file.stem)
][0]


def _parse_tag_as_list(
Expand Down

0 comments on commit be43878

Please sign in to comment.