Deepreg: Allow shorthand "~/" in config path

Created on 16 Jan 2021  路  11Comments  路  Source: DeepRegNet/DeepReg

Subject of the feature

Allow shorthand "~/" in specifying data path. This is useful to improve the config portability with little confusion.

If the feature request is approved, would you be willing to submit a PR? _(Help can be
provided if you need assistance submitting a PR)_

Yes

feature

All 11 comments

Hotfix: can modify the utils to read config to do "abspath" from module os.? @YipengHu

Hotfix: can modify the utils to read config to do "abspath" from module os.? @YipengHu

this can be os-sensitive, better to be explicit and use os.path.expanduser()

there are also people arguing https://docs.python.org/3/library/pathlib.html is better than os.path

Hotfix: can modify the utils to read config to do "abspath" from module os.? @YipengHu

this can be os-sensitive, better to be explicit and use os.path.expanduser()

But we only support Mac and Linux (bash based), right? I have a Windows machine now so can also test there, once you decide what to do

Hotfix: can modify the utils to read config to do "abspath" from module os.? @YipengHu

this can be os-sensitive, better to be explicit and use os.path.expanduser()

But we only support Mac and Linux (bash based), right? I have a Windows machine now so can also test there, once you decide what to do

believe it or not, it is not supported on linux, windows is fine

there are also people arguing https://docs.python.org/3/library/pathlib.html is better than os.path

not another lib for one function?

https://docs.python.org/3/library/pathlib.html

This is in the standard python lib so we are not adding another package. Just import pathlib without pip installing or changing requirements.

there are also people arguing https://docs.python.org/3/library/pathlib.html is better than os.path

not another lib for one function?

well it's more than one function, anyway, I will have a further look when we fix this issue.

Also what abou "./" shorthand? Or is that what you meant @YipengHu ?

Also what abou "./" shorthand? Or is that what you meant @YipengHu ?

i meant the home directory "~/"

Also what abou "./" shorthand? Or is that what you meant @YipengHu ?

@NMontanaBrown ./ will be relative to the current folder.

~ is equivalent to $HOME

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NMontanaBrown picture NMontanaBrown  路  4Comments

zacbaum picture zacbaum  路  3Comments

YipengHu picture YipengHu  路  4Comments

s-sd picture s-sd  路  3Comments

mathpluscode picture mathpluscode  路  6Comments