-
-
Notifications
You must be signed in to change notification settings - Fork 44
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing unnecessary output folders #69
Conversation
@fimafurman is your approval of the PR indication that we are good to go? Just want to double check that you have checked. |
Yes, I fetched the PR and tested, should be good.
…On Tue, Sep 18, 2018 at 6:10 PM Vanessa Sochat ***@***.***> wrote:
@fimafurman <https://github.com/fimafurman> is your approval of the PR
indication that we are good to go? Just want to double check that you have
checked.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ak2KXLoijNZgI4fAnJUPLeApgGqkbG8Aks5ucW9VgaJpZM4Wuyyl>
.
|
okay I just added a function to cleanly generate just a name (so you will need to test again!) along with a test for the function. Notably, I like seeing in my /tmp that a folder is associated with software, so I added to the function that the temporary directories include the temporary folder with a prefix. Here is an example from deid.utils import get_temporary_name
import os
# Default just uses prefix deid, can be for file or folder technically (it's just a name in whatever the systems temp is defined at)
tmpname = get_temporary_name()
print(tmpname)
/tmp/deid-xek2hlc8
# Note that it doesn't exist, not because we removed it, but because we used tempfile's function to get the name only
os.path.exists(tmpname)
False
# We can also specify a prefix, for example, to associate that it's the cleaner calling it
tmpname = get_temporary_name(prefix='clean')
print(tmpname)
/tmp/deid-clean-cx4ujlrr
# And if we want (not used here) we can add an extension, so it is also useful for a file
tmpname = get_temporary_name(prefix='pancakes', ext='dcm')
print(tmpname)
/tmp/deid-pancakes-t0zcn76p.dcm |
Perfect, thank you! I will be able to test tomorrow morning!
On Tue, Sep 18, 2018 at 6:42 PM Vanessa Sochat ***@***.***> wrote:
okay I just added a function to cleanly generate just a name (so you will
need to test again!) along with a test for the function. Notably, I like
seeing in my /tmp that a folder is associated with software, so I added to
the function that the temporary directories include the temporary folder
with a prefix. Here is an example
from deid.utils import get_temporary_nameimport os
# Default just uses prefix deid, can be for file or folder technically (it's just a name in whatever the systems temp is defined at)
tmpname = get_temporary_name()
print(tmpname)/tmp/deid-xek2hlc8
# Note that it doesn't exist, not because we removed it, but because we used tempfile's function to get the name only
os.path.exists(tmpname)False
# We can also specify a prefix, for example, to associate that it's the cleaner calling it
tmpname = get_temporary_name(prefix='clean')print(tmpname)/tmp/deid-clean-cx4ujlrr
# And if we want (not used here) we can add an extension, so it is also useful for a file
tmpname = get_temporary_name(prefix='pancakes', ext='dcm')
print(tmpname)/tmp/deid-pancakes-t0zcn76p.dcm
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ak2KXG7t5ZrjrI1bFMak6j87s7KK2dVVks5ucXbhgaJpZM4Wuyyl>
.
--
Fima Furman
617-512-3462 <(617)+512-3462>
Director of Machine Learning and AI
ffurman@ambrahealth.com
[image: AMBRA-logo-Orange_RGB.png] <http://ambrahealth.com/>
ambrahealth.com
[image: Ambra_KLASLogos_EmailSig.png]
KLAS Category Leader
for Image Exchange since 2015
|
okey doke. Thanks @fimafurman ! |
Looks good and it does not create a folder in vain, so great improvement! |
okay great! Merging. |
This PR will address and close #68 by only generating a name for an output folder, and recreating the folder only given that a save is called.