Code Monkey home page Code Monkey logo

expfactory-python's Introduction

The Experiment Factory

DOI DOI Gitter chat

expfactory/static/img/expfactoryticketyellow.png

See our documentation for getting started. If you are new to containers, read our background or paper first. If you want a more guided entry, see the detailed start

The Experiment Factory is software to create a reproducible container that you can easily customize to deploy a set of web-based experiments.

Citation

If the Experiment Factory is useful to you, please cite the paper to support the software and open source development.

Sochat, (2018). The Experiment Factory: Reproducible Experiment Containers. Journal of Open Source Software, 3(22), 521, https://doi.org/10.21105/joss.00521

Contributing

We have many ways to contribute, and will briefly provide resources here to get you started.

How to Contribute

If you are a developer interested in working on the Experiment Factory software you should read out contributing guidelines for details. For contributing containers and experiments, see our user documentation. If you have any questions, please don't hesitate to ask a question. You'll need to lint your code using black:

$ pip install black
$ black expfactory --exclude template.py

Code of Conduct

It's important to treat one another with respect, and maintain a fun and respectful environment for the open source community. Toward this aim, we ask that you review our code of conduct

Background

It's predecessor at Expfactory.org was never able to open up to the public, and this went against the original goal of the software. Further, the badly needed functionality to serve a local battery was poorly met with expfactory-python as time progressed and dependencies changes.

This version is agnostic to the underlying driver of the experiments, and provides reproducible, instantly deployable "container" experiments. What does that mean?

  • You obtain (or build) one container, a battery of experiments.
  • You (optionally) customize it
    • custom variables (e.g., a study identifier) and configurations go into the build recipe
    • you can choose to use your own database (default output is flat files)
    • other options are available at runtime
  • The container can be easily shared.
  • You run the container, optionally specifying a subset and ordering, and collect your results

If you build on Docker Hub anyone else can then pull and use your exact container to collect their own results. It is exact down to the file hash. Note that bases for expfactory were initially provided on Docker Hub and have moved to Quay.io. Dockerfiles in the repository that use the expfactory-builder are also updated. If you need a previous version, please see the tags on the original Docker Hub.

Experiment Library

The experiments themselves are now maintained under expfactory-experiments, official submissions to be found by expfactory can be added to the library (under development) to be tested that they meet minimum requirements.

expfactory-python's People

Contributors

earcanal avatar ianeisenberg avatar jonathanicholas avatar poldrack avatar rwblair avatar tangi75 avatar vsoch avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

expfactory-python's Issues

Battery config should be generated upon battery creation

To test, we will use the hardcoded / manual battery file. However, this file should be generated on creation:

  • fields specific to the cognitive atlas task / concept should be filled in automatically
  • user can specify database / connections, and they should be tested before generating battery
  • likely best to run functions in a flask web interface

surveys: export should include question content and options content

right now, the export has the answers and the unique ids of the questions, but this should obviously also include the question options and content, to be comprehensive. This should be fairly easy to add as hidden fields to the form, or just other attributes on the form data (need to test what I can do).

check for files outside of experiment folder?

How do we validate the jspsych files that are outside of experiment folder? We currently check that files specified to be in the folder are there, but the validator currently doesn't check that files specified to be in the (most up to date) battery folder are actually there. Should we? What do you think @IanEisenberg ?

Implement Vagrantfile as an option

right now the user just generates a battery, and not the Vagrantfile to generate the VM. Make the Vagrantfile, then turn it into an Amazon AWS one!

surveys: validate survey.tsv when reading config.json?

I'm not sure if I want to do this, because it will slow down validating the experiments. However it would be good to have some way of validating the survey.tsv file itself. My thinking is that we should have a circle test that does it, but not have it done when validating the config.json.

change developer commands

the current --runbat command should always be used to run a single experiment or battery, and so it should be changed to --run. The functions --test, --validate, and --preview (the current run) should be associated with development of experiments

get_experiment_html add support for different experiment types

Right now, get_experiment_html assumes we are adding css, js, and a variable "run" that goes into the document ready function. With different templates (eg, a survey) we should also be able to add html, and set the "run" variable to empty, for example. This should be pretty easy to add.

add function to deploy a survey

JsPsych is probably overkill for just a survey. I want to start developing another option for just survey stuffs that could be used to generate custom forms from a tsv file. I'm not sure if this will be integrated into current experiments given the time frame, but it would be good to have this option available for users regardless.

Validate issue

I am running expfactory --validate and receiving an error like so:
WARNING: config.json is missing field name: psychological_refractory_period
WARNING: config.json is missing field reference: psychological_refractory_period

On circle it says:
config.json could not be found in /home/ubuntu/expfactory-experiments/web
/home/ubuntu/expfactory-experiments/web is not an experiment.
Found 79 valid experiments
Directory not copied. Error: [Errno 2] No such file or directory: '/tmp/tmp9Zb8Nv/experiments/local_global_shape'
config.json could not be found in /tmp/tmp9Zb8Nv/experiments/local_global_shape

The config file is correct (and existing) however. You can see the PR here: https://github.com/IanEisenberg/expfactory-experiments/blob/fixes/local_global_shape/config.json

Not sure what's going on

node.js / electron app for easier deployment

The command line tool expfactory is not easily extendable to those that don't know how to use a command line. We should consider making an electron / node.js app to make platform specific executables.

add jspsych init functions to config

should look something like:

  jspsych_init: {"variable_name":"value"}
  • provide instructions in docs (need to clarify how to do spaces
  • add validation functions for variables that must be certain way

Function to deploy experiment locally

Akin to the "preview" function, we should have a similar one that can be run to deploy one or more experiments locally, on the fly. This would mean inputting a user ID, and then running either a single experiment or a battery.

more stringent validation

An experiment should minimally not return an error page to be included. Not sure about the rest of the validation to do beyond that.

surveys: deployment with expfactory --survey

right now, you can run a survey folder with expfactory --preview. It should be possible to deploy any number of surveys together, equivalent to what we do for experiments, with the run command. For example:

  expfactory --run --surveys bis_bas,bis11

Advanced functionality (not for this PR) would be to be able to put together a battery of experiments and surveys:

  expfactory --run --experiments stroop,n_back --surveys bis_bas,bis11

but this will be for future / another PR, because the data structures output would need to be consolidated. For now, it seems reasonable to have surveys be a different thing than experiments (because they kind of are :O) )

surveys: submission form

Currently, there are no pages (no next button) #55 and no submission button. The surveys should have a next button, likely at the bottom of the page, and likely we want data to be saved from the forms as the user progresses, and then finishing the survey should trigger the same chain of events:

  • expfactory_finished is set to true
  • data is submit again to the sync url

We will also need a function to save the data locally. I will figure this out when I get to it, lots of details to work on before then.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.