Skip to content

Commit

Permalink
allow loading after global installation
Browse files Browse the repository at this point in the history
  • Loading branch information
msteijaert authored and swansonk14 committed Sep 21, 2020
1 parent e9a28de commit 6b5cc17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chemprop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import chemprop.features
import chemprop.models
import chemprop.train
import chemprop.web
# import chemprop.web

import chemprop.args
import chemprop.constants
Expand Down
7 changes: 6 additions & 1 deletion chemprop/web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
_TEMP_FOLDER_OBJECT = TemporaryDirectory()

DEFAULT_USER_ID = 1
ROOT_FOLDER = os.path.dirname(os.path.realpath(__file__))
if os.access(os.path.dirname(os.path.realpath(__file__)), os.W_OK):
ROOT_FOLDER = os.path.dirname(os.path.realpath(__file__))
elif os.access(os.getcwd(), os.W_OK):
ROOT_FOLDER = os.path.join(os.getcwd(), "chemprop_web_app")
else :
raise ValueError("Failed to find a writable ROOT_FOLDER for web app data and checkpoints.")
DATA_FOLDER = os.path.join(ROOT_FOLDER, 'app/web_data')
CHECKPOINT_FOLDER = os.path.join(ROOT_FOLDER, 'app/web_checkpoints')
TEMP_FOLDER = os.path.join(ROOT_FOLDER, _TEMP_FOLDER_OBJECT.name)
Expand Down

0 comments on commit 6b5cc17

Please sign in to comment.