Skip to content

Commit

Permalink
do not add directory to parent_directy prop
Browse files Browse the repository at this point in the history
  • Loading branch information
horheynm committed Sep 25, 2023
1 parent faf12ee commit e8fe190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/sparsezoo/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,7 @@ def _get_directory_from_loose_api_files(
return None
else:
files = [
File.from_dict(
file, parent_directory=os.path.join(parent_directory, display_name)
)
File.from_dict(file, parent_directory=parent_directory)
for file in files
]
directory = directory_class(
Expand Down
6 changes: 2 additions & 4 deletions src/sparsezoo/objects/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ def __init__(
@property
def path(self):
if self._path is None:
expected_path = os.path.join(
self.parent_directory, os.path.basename(self.name)
)
expected_path = os.path.join(self.parent_directory, self.name)
if os.path.exists(expected_path):
self._path = expected_path
return expected_path
Expand Down Expand Up @@ -144,7 +142,7 @@ def download(
"Please make sure that `destination_path` argument is not None."
)

new_file_path = os.path.join(destination_path, os.path.basename(self.name))
new_file_path = os.path.join(destination_path, self.name)

if self.url is None:
raise ValueError(
Expand Down

0 comments on commit e8fe190

Please sign in to comment.