Skip to content

lautjy/hrk-scala-mutual-information

Repository files navigation

Mutual Information service

Based on Heroku's Scala app using Play framework.

I have left the index page as is.

Main use case is to do HTTP GET to

  • http://<server>/mutual

for list of available names. And using one of the names HTTP GET

  • http://<server>/mutual/<variable_name>

For example locally http://localhost:9000/mutual/acceptance_testing should work.

Running Locally

Make sure you have Play and sbt installed. Also, install the Heroku Toolbelt.

You can run the production equivalent "stage" build locally as such (set environment variables in .env file):

sbt compile stage
heroku local
# or on Windows
heroku local web -f Procfile.windows

or just use Activator for nice refresh-web-page-to-recompile:

activator
run

In either case the app should be running on localhost:9000.

Note: Environment variable DATABASE_URL needs to be set to a Postgres DB.

Rememberheroku local uses .env file, so change the var there. Use what values you have available locally for username, password, and dbname. Like this on Windows:

set DATABASE_URL=postgres://<USER>:<PASSWORD>@localhost:5432/<DBNAME>

Deploying to Heroku

$ heroku create
$ git push heroku master
$ heroku open

Todos

Missing or should be done:

  • use DataFrames (some implementations must exist?)
  • get tests working (problem with imports)
  • using getFile to read CSV, might be brittle thus move to inputStream
  • store processed MI and d data to to DB
    • sha of the CSV
    • calculated data
    • if sha matches something in DB, no need to process CSV further
  • consider proper exception handling and protection, now we puke on various simple errors
    • ensure vectors have identical lengths (now we index-based handling -> overflows)

Extra Documentation

For more information about using Play and Scala on Heroku, see these Dev Center articles:

And more about Mutual Information

About

Mutual information calculator in Scala running on Heroku

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published