Knowledge mining project for Lifelike. "Forked" from SBRG/GDS including only the NW-arangodb branch.
If you have just started working on the project, see the below sections for guidance on getting things set up.
Conda Users: Follow the instructions here first!
First, install pipenv on your machine if you haven't already. These instructions will walk you through installation.
Once you have successfully installed pipenv, run the following in the root directory of the project:
pipenv sync
This will create a new python virtual environment, and install all packages specified in the pipfile in that environment.
Note: You may need to add pipenv to your system's PATH
variable. This section of the installation steps above address modifying your PATH
.
You may want to configure your IDE to automatically hook into the virtual environment you created earlier. See the different sections below for guidance on how to set this up for your specific editor.
First, create a folder in the root of the project called .vscode
, if you haven't already. In that folder, create a file called launch.json
. In the file, add the following:
{
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
If the configurations
list property already exists, just add the additional object to it.
Next, in the bottom left of your editor, you should see something like:
Click on the "Python" section, and a window should open at the top of the editor. Select the GDS
option, and then select the location of your desired virtual environment from the list, or enter it manually.
Now when you open a VS Code terminal your virtual environment will automatically be activated.
Next, open up your workspace settings file and add the following to the settings
property:
"python.pythonPath": "/path/to/your/virtualenvs/your-virtual-env/bin/python",
Your workspace should now recognize all packages installed in the virtualenv you specified.
Note: If you aren't sure where your virtualenv is located, you should be able to find it by running: pipenv --venv
. This will output the absolute path to the currently active virtualenv.
Follow the instructions here to setup a pipenv environment.
- Create an environment using the Anaconda Prompt:
conda create -n <environment-name> python=3.9
- In Anaconda Navigator switch to that environment at the dropdown menu after “Applications on”
- Install for that environment Spyder (You can also install PyCharms if you prefer).
- Open Spyder for the gdsaddn environment.
- On the IPython console run:
pip install /path/to/GDS-repo
. This finds and installs all dependencies automatically.
Also, see this document, which the above instructions are sourced from.
This project uses black to format code via the command line. However, you can also setup your editor to use black formatting automatically upon saving a file. If you want to setup your editor to do so, please follow the instructions here.
VS Code users may also find these instructions helpful. Make sure you save the new settings to your workspace, and not to your user settings!
Before your commits can automatically be checked for style/formatting issues, you need to setup your git hooks to use pre-commit
. Make sure you've installed pipenv and setup your virtual environment as described above, and then simply run pre-commit install
. This will update your .git/hooks/pre-commit
script to run pre-commit
any time you commit changes.