Neuropsydia.py

Neuropsydia.py: A Python Module for Creating Experiments, Tasks and Questionnaires - Published in JOSS (2017)

https://github.com/neuropsychology/neuropsydia.py

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

assessment experiments neuropsychology psychology python questionnaire tasks

Keywords from Contributors

standardization

Scientific Fields

Mathematics Computer Science - 88% confidence
Economics Social Sciences - 85% confidence
Last synced: 4 months ago · JSON representation

Repository

A Python Module for Creating Experiments, Tasks and Questionnaires.

Basic Info
  • Host: GitHub
  • Owner: neuropsychology
  • License: mpl-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 90.1 MB
Statistics
  • Stars: 65
  • Watchers: 10
  • Forks: 24
  • Open Issues: 14
  • Releases: 3
Topics
assessment experiments neuropsychology psychology python questionnaire tasks
Created about 9 years ago · Last pushed about 6 years ago
Metadata Files
Readme Changelog License

README.md

neuropsydia python for research

A Python Module for Creating Experiments, Tasks and Questionnaires.


|Name|neuropsydia| |----------------|---| |Latest Version|PyPI version| |Documentation|Documentation Status| |Discussion|Join the chat at https://gitter.im/Neuropsydia-py/Lobby| |Questions|| |Authors| | |Support|Windows 7, 8, 10|


Installation

To get the latest stable version (1.0.6), run the following in the command prompt (might take a few minutes): python pip install https://github.com/neuropsychology/Neuropsydia.py/zipball/master

Not working? Check this out!

NOTE: We strongly recommend (for Windows users) the use of the WinPython bundle, that will allow you to have a ready-to-go scientific and portable Python setup.

installation neuropsydia winpython pip

To upgrade Neuropsydia, uninstall it and reinstall it :wink:. ```python pip uninstall neuropsydia

```

Contribute

  • You need some help? You found a bug? You would like to request a new feature? Just open an issue :relaxed:
  • Want to add yourself a feature? Correct a bug? You're more than welcome to contribute! Check this page to see how to submit your changes on github.

Citation

You can cite Neuropsydia with the following: Makowski, D. & Dutriaux, L. (2016). Neuropsydia: A Python Module for Creating Experiments, Tasks and Questionnaires. Memory and Cognition Lab' Day, 01 November, Paris, France Note: The authors do not give any warranty. If this software causes your keyboard to blow up, your brain to liquefy, your toilet to clog or a zombie plague to leak, the authors CANNOT IN ANY WAY be held responsible.


Tutorials, Examples and Documentation


Example

A Go/No-Go Task in 50 lines

interactive scale psychology

Try this!

```python import neuropsydia as n # Load neuropsydia import random # Import the random module import pandas as pd # To manipulate and save the data import numpy as np # To do some maths

n.start() # Start neuropsydia n.instructions("Goal: Hit SPACE whenever a GREEN circle appears. \nWhen it is RED, don't press anything.") # Display instructions and break line with \n n.newpage("grey") # Fill the screen n.countdown() # Display countdown

Initialize the data storage with a dictionary containing empty lists

data = {"Trial": [], "Stimulus": [], "ISI":[], "RT":[], "Response":[]}

for trial in range(5): # Iterate over the number of trials stimulus = random.choice(["green", "red"]) # Select a stimulus type ISI = random.randrange(start=500, stop=2000, step=500) # Select the inter-stimuli interval (ISI)

n.newpage("grey")  # Fill the screen
n.write("+")  # Fixation cross
n.refresh()  # Diplay it on screen
n.time.wait(ISI)  # Wait

n.circle(size=2, fill_color=stimulus)  # Display the stimulus (filled with the color selected above)
n.refresh()  # Diplay it on screen
response, RT = n.response(time_max=1500)  # Wait until 1.5s and collect the response and its time

# Categorize the response
if response == "SPACE" and stimulus == "green":
    response_type = "HIT"  # Hit
if response != "SPACE" and stimulus == "green":
    response_type = "MISS"  # Miss
if response == "SPACE" and stimulus == "red":
    response_type = "FA"  # False Alarm
if response != "SPACE" and stimulus == "red":
    response_type = "CR"  # Correct Rejection

# Store data by appending each item to its list
data["Trial"].append(trial)
data["Stimulus"].append(stimulus)
data["ISI"].append(ISI)
data["RT"].append(RT)
data["Response"].append(response_type)

Data saving

df = pd.DataFrame.fromdict(data) # Transform the data dictionary into a proper and savable dataframe df.tocsv("data.csv") # Save it

Quick analysis

RTs = df.query('Response=="HIT"')["RT"] # Select the Hits' RTs print("Mean RT: " + str(round(RTs.mean(), 2))) # Print the mean print("SD RT: " + str(round(RTs.std(), 2))) # Print the standard deviation print("Number of False Alarms: " + str(len(df[df['Response']=="FA"]))) # Print the number of intrusions (false alarms)

n.close() # Close neuropsydia ```


Features

Write, Ask and Display Images

  • [x] Easily write, display images and interact with the user.
  • [x] Detailed control over the timing and latency: preload images and display them exactly whenever you want.

interactive scale psychology

```python import neuropsydia as n

n.start()

n.write("Welcome", style="title") name = n.ask("What is your name?", y=5) n.write("Ok, " + name + ", here is a super cool cat.", y=3) n.image("cat.png", size=3, y=-3.5) n.refresh() n.time.wait(2000)

n.close() ```


Scales and Questionnaires

  • [x] Fully automated questionnaires.
  • [x] Powerful scale creation.

interactive scale psychology

```python import neuropsydia as n

n.start() n.newpage()

n.scale(title="Is Python great?", y=3.3, anchors=["", ""], style="blue", analog=False, edges=[1,5], labels=["not at all", "not really", "maybe", "quite", "totally"], labels_size=0.6 )

n.scale(title="How is neuropsydia?", y=-3.3, linelength=12, edges=[0,100], anchors=["atrocious", "brilliant"], pointcenter=True, separationlabels=["Bad","Good"], style="purple", showresult=True, showresultshapelinecolor="blue" )

n.close() ```


Choices

  • [x] Easily display clickable choices, useful in case of recognition tasks or so.

interactive choice psychology remember guess know

```python import neuropsydia as n

n.start()

n.newpage()

response = n.choice(["Yes", "No"], y=5, title="Isn't it easy?")

response = n.choice(["Hell no", "Nope", "Dunno", "Sure"], y=-5, title="Am I better looking?", height=-2, boxesedgesize=0, boxesbackground=["red", "amber", "teal", "blue"], helplist=["means not at all", "means no", "means you don't know", "means yes"])

n.close() ```

Owner

  • Name: École de Neuropsychologie
  • Login: neuropsychology
  • Kind: organization
  • Email: dom.makowski@gmail.com
  • Location: Paris, France

An open community of people interested in improving Neuropsychology. Contact us if you're interested to join!

JOSS Publication

Neuropsydia.py: A Python Module for Creating Experiments, Tasks and Questionnaires
Published
November 27, 2017
Volume 2, Issue 19, Page 259
Authors
Dominique Makowski ORCID
Memory and Cognition Lab', Institute of Psychology, University of Sorbonne Paris Cité, France, INSERM U894, Center for Psychiatry and Neuroscience, Paris, France
Léo Dutriaux ORCID
Memory and Cognition Lab', Institute of Psychology, University of Sorbonne Paris Cité, France, INSERM U894, Center for Psychiatry and Neuroscience, Paris, France
Editor
Ariel Rokem ORCID
Tags
python psychology questionnaire experiments neuropsychology tasks assessment

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 561
  • Total Committers: 6
  • Avg Commits per committer: 93.5
  • Development Distribution Score (DDS): 0.064
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Dominique Makowski d****9@g****m 525
LeoDutriaux l****x@g****m 29
Pham Thanh Tam t****1@e****g 4
marcosperduti m****i@y****t 1
afif hendrawan a****n@g****m 1
The Gitter Badger b****r@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 22
  • Total pull requests: 8
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 3 minutes
  • Total issue authors: 8
  • Total pull request authors: 4
  • Average comments per issue: 2.18
  • Average comments per pull request: 0.25
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • DominiqueMakowski (14)
  • cMadan (2)
  • nuunuu (1)
  • zhanghao1988 (1)
  • atnplab (1)
  • shanzayaziz (1)
  • LeoDutriaux (1)
  • maggieqqw (1)
Pull Request Authors
  • DominiqueMakowski (3)
  • Tam-Pham (3)
  • gitter-badger (1)
  • hndr91 (1)
Top Labels
Issue Labels
improvement suggestion (7) feature request (4) bug (4) question (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 9 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
pypi.org: neuropsydia

A Python Module for Creating Experiments, Tasks and Questionnaires.

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 9 Last month
Rankings
Dependent packages count: 7.3%
Forks count: 7.8%
Stargazers count: 8.5%
Average: 17.3%
Dependent repos count: 22.1%
Downloads: 41.0%
Maintainers (1)
Last synced: 4 months ago

Dependencies

neuropsydia.egg-info/requires.txt pypi
  • Pillow *
  • cryptography *
  • neurokit *
  • numpy *
  • pandas *
  • pygame *
  • python-docx *
  • pyxid *
  • statsmodels *
requirements.txt pypi
  • Pillow *
  • cryptography *
  • neurokit *
  • numpy >=1.11.2
  • pandas *
  • pygame *
  • python-docx *
  • pyxid *
  • scipy >=0.18.1
  • statsmodels *
setup.py pypi
  • Pillow *
  • cryptography *
  • neurokit *
  • numpy *
  • pandas *
  • pygame *
  • python-docx *
  • pyxid *
  • statsmodels *