Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
abearab committed Jun 24, 2024
1 parent 0c81203 commit 1d0e9b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CanDI/setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--source", help="Specify the download source", default="dataverse")
parser.add_argument("--data_dir", help="Specify the data directory", default='auto')
parser.add_argument("--directory", help="Specify the parent data directory", default='auto')
args = parser.parse_args()

if args.source == 'dataverse':
print("Downloading data from Dataverse")
m = DataverseDepMap(manager_path=args.data_dir, verbose=True)
m = DataverseDepMap(manager_path=args.directory, verbose=True)
m.download_reformatted_data()
m.write_config(m.cfig_path, m.parser)

elif args.source == 'depmap':
print("Downloading data from DepMap")
m = BroadDepMap(manager_path=args.data_dir, verbose=True)
m = BroadDepMap(manager_path=args.directory, verbose=True)
m.get_depmap_info()
m.write_config(m.cfig_path, m.parser)
m.download_defaults()
Expand Down
13 changes: 11 additions & 2 deletions CanDI/setup/uninstall.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import os
import shutil
import argparse
from .manager import Manager


def main():
parser = argparse.ArgumentParser()
parser.add_argument("--database", help="Specify the database to uninstall", default="depmap")
parser.add_argument("--data_dir", help="Specify the data directory", default='auto')
parser.add_argument("--directory", help="Specify the data parent directory", default='auto')
args = parser.parse_args()

if args.database == 'depmap':
print("Uninstalling DepMap data")
shutil.rmtree(args.data_dir + "/data/depmap/")

m = Manager()

if args.directory == 'auto':
shutil.rmtree(m.manager_path + "/data/depmap/")
elif os.path.exists(args.directory):
shutil.rmtree(m.manager_path + "/data/depmap/")
else:
raise ValueError("Invalid data directory")
else:
raise ValueError("Invalid database. Currently only 'depmap' is supported")

Expand Down

0 comments on commit 1d0e9b1

Please sign in to comment.