start refactor for data backend by only improting datalad into one submodule
This commit is contained in:
parent
acab85df82
commit
44ab402c6c
3 changed files with 20 additions and 9 deletions
7
corrlib/data_backend/databackend.py
Normal file
7
corrlib/data_backend/databackend.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import .datalad as dl
|
||||||
|
|
||||||
|
|
||||||
|
class DataBackend:
|
||||||
|
@abstractmethod
|
||||||
|
def get_file(self, data, file):
|
||||||
|
pass
|
||||||
13
corrlib/data_backend/datalad.py
Normal file
13
corrlib/data_backend/datalad.py
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import datalad.api as dl
|
||||||
|
import os
|
||||||
|
from corrlib.data_backend.databackend import
|
||||||
|
|
||||||
|
def DLBackend()
|
||||||
|
|
||||||
|
def get_file(path, file):
|
||||||
|
if file == "backlogger.db":
|
||||||
|
print("Downloading database...")
|
||||||
|
else:
|
||||||
|
print("Downloading data...")
|
||||||
|
dl.get(os.path.join(path, file), dataset=path)
|
||||||
|
print("> downloaded file")
|
||||||
|
|
@ -18,12 +18,3 @@ def m2k(m):
|
||||||
def k2m(k):
|
def k2m(k):
|
||||||
return (1/(2*k))-4
|
return (1/(2*k))-4
|
||||||
|
|
||||||
|
|
||||||
def get_file(path, file):
|
|
||||||
if file == "backlogger.db":
|
|
||||||
print("Downloading database...")
|
|
||||||
else:
|
|
||||||
print("Downloading data...")
|
|
||||||
dl.get(os.path.join(path, file), dataset=path)
|
|
||||||
print("> downloaded file")
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue