Skip to content

Commit

Permalink
Consistently use resolved instead of absolute path (#536)
Browse files Browse the repository at this point in the history
* use path.resolve instead os.path.abspath

* update changelog

* fix typing
  • Loading branch information
daniel-wer authored Dec 27, 2021
1 parent 8623276 commit 4423846
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions webknossos/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
- The detailed output of e.g. downsampling was replaced with a progress bar. [#527](https://github.com/scalableminds/webknossos-libs/pull/527)
- Always use the sampling mode `CONSTANT_Z` when downsampling 2D data. [#516](https://github.com/scalableminds/webknossos-libs/pull/516)
- Make computation of `largestSegmentId` more efficient for volume annotations. [#531](https://github.com/scalableminds/webknossos-libs/pull/531)
- Consistently use resolved instead of absolute path if make_relative is False. [#536](https://github.com/scalableminds/webknossos-libs/pull/536)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/dataset/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _add_foreign_mag(
foreign_normalized_mag_path = (
Path(os.path.relpath(foreign_mag_view.path, self.path))
if make_relative
else Path(os.path.abspath(foreign_mag_view.path))
else foreign_mag_view.path.resolve()
)

if symlink:
Expand Down
4 changes: 2 additions & 2 deletions webknossos/webknossos/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def copy_directory_with_symlinks(
if item.name not in ignore:
symlink_path = dst_path / item.name
if make_relative:
rel_or_abspath = os.path.relpath(item, symlink_path.parent)
rel_or_abspath = Path(os.path.relpath(item, symlink_path.parent))
else:
rel_or_abspath = os.path.abspath(item)
rel_or_abspath = item.resolve()
symlink_path.symlink_to(rel_or_abspath)


Expand Down

0 comments on commit 4423846

Please sign in to comment.