This is the INSPIRE source code overlay for Invenio v.2.0. It installs on top of Invenio Digital Library platform source code. The overlay is currently used for http://labs.inspirehep.net
To install the overlay, first follow the installation instructions of Invenio. This overlay replaces the invenio-demosite so all references to such demosite should be ignored and executed in this overlay instead. For example, you should execute:
(inspire)$ cdvirtualenv src/inspire-next
(inspire)$ pip install -r requirements.txt --exists-action i
Since the database was already initialized while installing Invenio, you can load the INSPIRE demo records:
(inspire)$ cdvirtualenv src/inspire-next
(inspire)$ inveniomanage demosite populate -p inspire.base -f inspire/demosite/data/demo-records.xml
Finally, start the server:
(inspire)$ inveniomanage runserver
Now you should have a running INSPIRE demo site running at http://localhost:4000!
When developing on top of INSPIRE and Invenio, we recommend setting the following Invenio config variables:
(inspire)$ inveniomanage config set DEBUG True
(inspire)$ inveniomanage config set ASSETS_DEBUG True
If you need to setup prediction models such as the CORE guessing it is required to install some extra packages such as beard which requires scipy, numpy and scikit-learn. This means that you need to make sure you have the required libraries installed.
For example, on Ubuntu/Debian you could execute:
(inspire)$ sudo aptitude install -y libblas-dev liblapack-dev gfortran imagemagick
Then to install beard:
(inspire)$ cdvirtualenv src/inspire-next
(inspire)$ pip install -r requirements-harvesting.txt --exists-action i
Now you can train a prediction model or use an existing pickled model file:
(inspire)$ cdvirtualenv var/data/classifier/models/
(inspire)$ cp /path/to/core_guessing.pickle .
Here is how to train the model from scratch:
(inspire)$ inveniomanage classifier train -r /path/to/trainingset.json -o core_guessing.pickle
TODO: Add link to training set. TODO: Add link sample model.
You will find a fabfile.py in the root folder of this overlay. It is a compilation of tasks for Fabric
A useful one that you can use as a shortcut to completely recreate your assets is:
(inspire)$ fab clean_assets
This will:
- Remove all your static assets
- Gather all the Bower dependencies and write them in the file bower.json
- Execute Bower install
- Execute inveniomanage collect
You should then find all your updated assets in $ cdvirtualenv var/invenio.base-instance/static/
The INSPIRE overlay contains some Grunt helpers that can help you with your JavaScript development. If you don't have such tools integrated in your IDE it is recommended to use them before submitting a PR.
You should already have npm installed if you followed the Invenio installation. So execute the following commands:
- Install
grunt-cli
globally withnpm install -g grunt-cli
. - Navigate to the root directory, then run
npm install
.npm
will look at package.json and automatically install the necessary local dependencies listed there.
grunt jshint
grunt jsbeautifier