nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
145 stars 54 forks source link

Compute actual desired cache location in `fetch_data.py` #64

Closed bcipolli closed 8 years ago

bcipolli commented 8 years ago

in mindboggle/mio/fetch_data.py, both a cache environment variable and a cache location are returned:

    cache_env = 'MINDBOGGLE_CACHE'
    cache = os.path.join(os.environ['HOME'], 'mindboggle_cache')

It seems simpler to return a cache location like this: cache = os.environ.get('MINDBOGGLE_CACHE', os.path.join(os.environ['HOME'], 'mindboggle_cache'))

It should also make downstream code much simpler.

binarybottle commented 8 years ago

I replaced the cache line but kept the cache_env line because I need to return it:

cache_env = 'MINDBOGGLE_CACHE'
cache = os.environ.get(cache_env, os.path.join(os.environ['HOME'],
                                               'mindboggle_cache'))