Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ __pycache__/
/cache/
/data/
*.pt
*.vtk
*.vtk
.DS_Store
71 changes: 0 additions & 71 deletions deprecated/RL_env.py

This file was deleted.

92 changes: 0 additions & 92 deletions deprecated/agent.py

This file was deleted.

109 changes: 0 additions & 109 deletions deprecated/main.py

This file was deleted.

6 changes: 5 additions & 1 deletion dfibert/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""The deepFibreTrackin (dfibert) module offers modules and classes to help with
development and evaluation of different machine learning approaches for fibre tracking
of diffusion weighted MRI data.
"""
from . import cache
from . import config
from . import data
from . import dataset
from . import envs
from . import tracker
from . import util
from . import util
9 changes: 4 additions & 5 deletions dfibert/cache/__init__.py → dfibert/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from dipy.io.streamline import save_vtk_streamlines, load_vtk_streamlines

from dfibert.config import Config
from .exceptions import KeyNotCachedError

class Cache():
"""
Expand Down Expand Up @@ -134,11 +133,12 @@ def get(self, key):

Raises
------
KeyNotCachedError
LookupError
This exception is thrown if no object is assigned to given key.
"""
if not self.in_cache(key):
raise KeyNotCachedError(key)
raise LookupError("""The key {} isn't cached (anymore).
Check if key is cached with in_cache(key).""".format(key))
self.objects[key]["last_accessed"] = int(time.time()*1000.0)

filename = self.objects[key]["filename"]
Expand Down Expand Up @@ -195,8 +195,7 @@ def clear(self):
"""
Clears the whole cache.
"""
keys = [key for key in self.objects]
for key in keys:
for key in self.objects:
self.remove(key)

def save_configuration(self):
Expand Down
20 changes: 0 additions & 20 deletions dfibert/cache/exceptions.py

This file was deleted.

Loading