Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: Accept pathlib.Path objects where filenames are accepted#610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
effigies merged 18 commits intonipy:masterfromCRiddler:loadsave-pathlib_compat
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
180fd50
load save with pathlib.Path objects
CRiddlerMar 15, 2018
9835998
Merge branch 'master' into loadsave-pathlib_compat
CRiddlerJun 13, 2018
b44c06b
Merge branch 'master' into loadsave-pathlib_compat
effigiesAug 19, 2019
3346689
Add fn to coerce pathlike to string
CRiddlerSep 16, 2019
aaf1a19
Insert _stringify_path to entry points
CRiddlerSep 16, 2019
185f82c
Refactor _stringify_path to filename_parser.py
CRiddlerSep 17, 2019
e1d78c8
resolve flake8
CRiddlerSep 23, 2019
d9ce63e
testing for pathlib
CRiddlerOct 14, 2019
7887232
purge basestring
CRiddlerOct 14, 2019
6c0497e
move stringify guard to types_filenames
CRiddlerOct 16, 2019
e0fff5c
update docstrings to accept str or os.PathLike
CRiddlerOct 16, 2019
fbaeacc
Merge branch 'master' into loadsave-pathlib_compat
CRiddlerOct 16, 2019
6056014
update _stringify_path doc
CRiddlerOct 16, 2019
0cb7c39
update docstrings to accept str or os.PathLike
CRiddlerOct 16, 2019
ca10c44
mghformat accept pathlib for filespec_to_file_map
CRiddlerOct 16, 2019
e98dbfc
tests pathlib compatible
CRiddlerOct 16, 2019
6394536
update _stringify_path doc
CRiddlerOct 16, 2019
60a4624
Fix flake 8 issues
CRiddlerOct 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
move stringify guard to types_filenames
  • Loading branch information
@CRiddler
CRiddler committedOct 16, 2019
commit6c0497ee8357fdf9ef078cd0b4c0d5a011e82496
3 changes: 0 additions & 3 deletionsnibabel/filebasedimages.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -252,12 +252,10 @@ def set_filename(self, filename):
``.file_map`` attribute. Otherwise, the image instance will
try and guess the other filenames from this given filename.
'''
filename=_stringify_path(filename)
self.file_map=self.__class__.filespec_to_file_map(filename)

@classmethod
deffrom_filename(klass,filename):
filename=_stringify_path(filename)
file_map=klass.filespec_to_file_map(filename)
returnklass.from_file_map(file_map)

Expand DownExpand Up@@ -332,7 +330,6 @@ def to_filename(self, filename):
-------
None
'''
filename=_stringify_path(filename)
self.file_map=self.filespec_to_file_map(filename)
self.to_file_map()

Expand Down
1 change: 1 addition & 0 deletionsnibabel/filename_parser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -107,6 +107,7 @@ def types_filenames(template_fname, types_exts,
>>> tfns == {'t1': '/path/test.funny', 't2': '/path/test.ext2'}
True
'''
template_fname=_stringify_path(template_fname)
ifnotisinstance(template_fname,str):
raiseTypesFilenamesError('Need file name as input '
'to set_filenames')
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp