Skip to content

Commit

Permalink
Save data to .brainglobe (#75)
Browse files Browse the repository at this point in the history
* Save data to .brainglobe

* Add parent dir
  • Loading branch information
adamltyson authored Jul 12, 2024
1 parent 4b9a1e0 commit de4e0f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
9 changes: 0 additions & 9 deletions morphapi/api/mpin_celldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,3 @@ def download_dataset(self):
fix_mpin_swgfile(f, self.data_path / f.name)

shutil.rmtree(extracted_data_path.parent)

# # 2/1900 neurons still have a little bug, hopefully
# fixed in the future
# try:
# return Neuron(data_file=fixed_file_path)
# except: # Ideally in the next iteration this except won't
# be necessary
# print(f"Unfixable problem while opening {file_path.name}")
# return
16 changes: 8 additions & 8 deletions morphapi/paths_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
# neurons morphology data etc)
default_paths = dict(
# APIs caches
allen_morphology_cache="Data/allen_morphology_cache",
mouselight_cache="Data/mouselight_cache",
neuromorphorg_cache="Data/neuromorphorg_cache",
meshes_cache="Data/meshes_cache",
allen_morphology_cache="allen_morphology_cache",
mouselight_cache="mouselight_cache",
neuromorphorg_cache="neuromorphorg_cache",
meshes_cache="meshes_cache",
# Other
mouse_connectivity_cache="Data/mouse_connectivity_cache",
mpin_morphology="Data/mpin_morphology",
mouse_connectivity_cache="mouse_connectivity_cache",
mpin_morphology="mpin_morphology",
)


Expand All @@ -32,11 +32,11 @@ def __init__(self, base_dir=None, **kwargs):
# Get and make base directory

if base_dir is None:
self.base_dir = Path.home() / ".morphapi"
self.base_dir = Path.home() / ".brainglobe" / "morphapi"
else:
self.base_dir = Path(base_dir)

self.base_dir.mkdir(exist_ok=True)
self.base_dir.mkdir(exist_ok=True, parents=True)

for fld_name, folder in default_paths.items():
# Check if user provided a path for this folder,
Expand Down

0 comments on commit de4e0f4

Please sign in to comment.