smspillaz / pubmed-retraction-analysis

Analysis of papers retracted from PubMed
MIT License
5 stars 4 forks source link

PubMed Retraction Analyser

Working broken Python installations on OS X El Capitan

OSX 10.11 ships with a known broken python installation. Install homebrew and then install python:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install python

Installing dependencies

Before you do anything, go install node.

You will also need to install pip from easy_install and virtualenv from pip systemwide:

$ sudo easy_install pip $ sudo pip install virtualenv

Once you're done with that npm install will install all the dependencies.

Deployment

Deployment is to heroku. Review apps are enabled on this repository and the master branch is always deployed automatically.

Heroku configuration can be accessed in the credentials handed over in the private documentation. The following environment variables must be set in order for the backend to function:

The default values for all of these environment variables will be handed over in the private documentation.

Continuous Integration and Tests

By default, every commit on the master branch of this repository will run the entire acceptance test suite on Travis CI. Travis-CI uses the standard install.py script to install dependencies which includes the installation of a staging neo4j instance. You will not be able to run the test suite manually without that.

To run the run the test suite manually manually, do the following:

$ python setup.py polysquarelint --exclusions=*/venv/*,*/node_modules/*,*/dist/*,*/public/components/* --suppress-codes=I100,LongDescription,D203
$ npm run lint

You do not need to start neo4j or set any database credentials - this will be done automatically by the test fixtures. However, you should ensure there is no other instance of neo4j running on your session before running the tests since neo4j always allocates the same port for itself.

Automatic Code Quality Checks

By default, every commit on the master branch will run automatic static analysis and code quality checks. A failure by any of these tools will fail the entire build.

Python warnings can be suppressed using # suppress(warning-id) whereas ESLint (JavaScript) warnings can be suppresed using eslint-disable-line id.

To run the linting checks manually, do the following:

$ python setup.py polysquarelint --exclusions=*/venv/*,*/node_modules/*,*/dist/*,*/public/components/* --suppress-codes=I100,LongDescription,D203
$ npm run lint

Database

The database uses neo4j. You can set this up locally by following the instructions at neo4j.org, or you can access a public database at the URL specified in the private documentation.

Administration

You can interact with the database by using the db/db-admin.js script.

You will need to provide credentials in DATABASE_USER, DATABASE_PASS and the database URL (shared secretly) in DATABASE_URL.

Once the program starts, you can just start running neo4j database commands and you'll get the result back. Hit Ctrl^C to quit.

Directory Structure

The project is split into three separate components: A frontend, a backend and an importer.