Skip to content

Commit

Permalink
Forgot to sort first_run_files too
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Mar 1, 2024
1 parent 4356742 commit 38c0937
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion visualdataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
|_|
"""

__version__ = '0.2.2'
__version__ = '0.2.3'
18 changes: 13 additions & 5 deletions visualdataset/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,20 @@ class VisualDatasetManifest(BaseModel):
__pydantic_config__ = ConfigDict(extra='forbid')

def sort(self) -> Self:
sorted_tags = {
k: sorted(v)
for k, v in sorted(self.tags.items())
}
sorted_files = sorted(self.files, key=_get_path)
sorted_file_paths = [f.path for f in sorted_files]
sorted_first_run_files = [
sorted_file_paths.index(self.files[i].path)
for i in self.first_run_files
]
return self.model_copy(update={
'tags': {
k: sorted(v)
for k, v in sorted(self.tags.items())
},
'files': sorted(self.files, key=_get_path)
'tags': sorted_tags,
'files': sorted_files,
'first_run_files': sorted_first_run_files
})


Expand Down

0 comments on commit 38c0937

Please sign in to comment.