Skip to content
Snippets Groups Projects
Commit ed318a75 authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

Fix path issue in DataLoader class

parent 40354703
No related branches found
No related tags found
2 merge requests!45Save files function,!44Load vol files
...@@ -340,6 +340,11 @@ class DataLoader: ...@@ -340,6 +340,11 @@ class DataLoader:
Args: Args:
path (str): The path to the VGI file. path (str): The path to the VGI file.
""" """
# makes sure path point to .VGI metadata file and not the .VOL file
if path.endswith(".vol") and os.path.isfile(path.replace(".vol",".vgi")):
path = path.replace(".vol",".vgi")
print("WARNING: Corrected path to .vgi metadata file from .vol file")
meta_data = self._load_vgi_metadata(path) meta_data = self._load_vgi_metadata(path)
# Extracts relevant information from the metadata # Extracts relevant information from the metadata
...@@ -392,7 +397,7 @@ class DataLoader: ...@@ -392,7 +397,7 @@ class DataLoader:
# Stringify path in case it is not already a string # Stringify path in case it is not already a string
path = stringify_path(path) path = stringify_path(path)
print(os.path.isfile(path),path,path.endswith((".vgi")))
# Load a file # Load a file
if os.path.isfile(path): if os.path.isfile(path):
# Choose the loader based on the file extension # Choose the loader based on the file extension
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment