Skip to content
Open
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
10 changes: 10 additions & 0 deletions demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@
"import ssgetpy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Custom output directory via `SSGETPY_OUTPUT_LOCATION` environmental variable\n",
"!export SSGETPY_OUTPUT_LOCATION = /my/custom/folder/\n",
"\n",
"# The above environmental variable will overwrite the default output location, see `config.py`"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
11 changes: 6 additions & 5 deletions ssgetpy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

logger = logging.getLogger(__name__)

SS_DIR = None
SS_DIR = os.environ.get(["SSGETPY_OUTPUT_LOCATION"], None)
SS_DB = "index.db"
SS_TABLE = "MATRICES"
SS_ROOT_URL = "https://sparse.tamu.edu"
SS_INDEX_URL = "/".join((SS_ROOT_URL, "files", "ssstats.csv"))

if sys.platform == "win32":
SS_DIR = os.path.join(os.environ["APPDATA"], "ssgetpy")
else:
SS_DIR = os.path.join(os.environ["HOME"], ".ssgetpy")
if SS_DIR is None:
if sys.platform == "win32":
SS_DIR = os.path.join(os.environ["APPDATA"], "ssgetpy")
else:
SS_DIR = os.path.join(os.environ["HOME"], ".ssgetpy")

SS_DB = os.path.join(SS_DIR, SS_DB)

Expand Down