Skip to content

Commit

Permalink
update available activities in a table format (#89)
Browse files Browse the repository at this point in the history
* automatically update activity table

* revise the table updating approach

* update table

* update table remove summary
  • Loading branch information
yibeichan authored Jan 6, 2025
1 parent 9d6b865 commit 55c8b97
Show file tree
Hide file tree
Showing 3 changed files with 249 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/update-activity-table.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update Activities Table

on:
push:
paths:
- 'activities/*/' # Trigger when a new directory is added in activities
workflow_dispatch: # Allow manual trigger

jobs:
update-activities:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Update README with Activities Table
run: |
python scripts/update_activities_table.py
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md
git diff --quiet && git diff --staged --quiet || (git commit -m "Update activities table in README [skip ci]" && git push)
permissions:
contents: write
100 changes: 95 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,102 @@ You can read more about the ReproSchema [here](https://repronim.org/reproschema)

[A slide deck about ReproSchema](https://docs.google.com/presentation/d/1H4C_cBU9BE9EYFNyK8YBLQObzvq9iDztLWrqRIQTmgc/edit)

## How you can contribute
## Available Activities

1. Add new assessments not available in the library.
2. Fix existing assessments, especially adding/updating licensing information
and references.
3. Add multilingual support to the assessments.
*Last updated: 2025-01-06 21:06:51 UTC*

| *Activity* | *Description* |
|----------|-------------|
| [ACE](activities/ACE) | Mobile cognitive control assessment battery containing standard tests that assess different aspects of cognitive control (attention, working memory, and goal management), modified by incorporating adaptive algorithms, immersive graphics, video tutorials, motivating feedback, and a user-friendly interface. |
| [ARI_P](activities/ARI_P) | The Affective Reactivity Index- Self Report is a concise scale for the dimensional assessment of irritability. |
| [ASSQ](activities/ASSQ) | The ASSQ is a 27-item checklist for completion by lay informants when assessing symptoms characteristic of Asperger's Syndrome or high-functioning autism spectrum disorders. |
| [BADS](activities/BADS) | BADS assessment schema |
| [BFI-2-XS](activities/BFI-2-XS) | BFI-2-XS |
| [Brief_PHQ](activities/Brief_PHQ) | PHQ-9 assessment schema |
| [CIS_P](activities/CIS_P) | The CIS is a 13 item parent report scale that assesses global functioning in domains of interpersonal relations, psychopathology, school performance, use of leisure time; monitors progress after 6 mo of treatment. |
| [CIS_SR](activities/CIS_SR) | The CIS is a 13 item self report scale that assesses global functioning in domains of interpersonal relations, psychopathology, school performance, use of leisure time; monitors progress after 6 mo of treatment. |
| [CIT](activities/CIT) | CIT schema |
| [CageAid](activities/CageAid) | schema describing cage aid assessment |
| [DAS](activities/DAS) | Daily Affect Scale schema |
| [DSM-5_A](activities/DSM-5_A) | DSM-5_A |
| [DSM-5_Y](activities/DSM-5_Y) | DSM-5_Y |
| [EPDS](activities/EPDS) | EPDS assessment schema |
| [GAD7](activities/GAD7) | GAD7 assessment schema |
| [GQ-6](activities/GQ-6) | GQ-6 |
| [IAT](activities/IAT) | The Internet Addiction Test (IAT) is a 20-item scale that measures characteristics and behaviors associated with compulsive use of the Internet that include compulsivity, escapism, and dependency. Questions also assess problems related to addictive use in personal, occupational, and social functioning. |
| [ICU_P](activities/ICU_P) | The Inventory of Callous-Unemotional Traits is a copyright protected 24-item questionnaire designed to provide a comprehensive assessment of callous and unemotional traits. These traits have proven to be important for designating a distinct subgroup group of antisocial and aggressive youth |
| [ICU_SR](activities/ICU_SR) | The Inventory of Callous-Unemotional Traits (ICUT) is a copyright protected 24-item questionnaire designed to provide a comprehensive assessment of callous and unemotional traits. These traits have proven to be important for designating a distinct subgroup group of antisocial and aggressive youth. The ICUT has three subscales: Callousness, Uncaring, and Unemotional |
| [LAS](activities/LAS) | Lyubomirsky Affect Scale schema |
| [MAAS](activities/MAAS) | Self Compassion schema |
| [MEIM](activities/MEIM) | An assessment to measure cultural affiliation |
| [MFQ_P](activities/MFQ_P) | The MFQ consists of a series of descriptive phrases regarding how the subject has been feeling or acting recently. Codings reflect whether the phrase was descriptive of the subject most of the time, sometimes, or not at all in the past two weeks. |
| [MFQ_SR](activities/MFQ_SR) | The MFQ consists of a series of descriptive phrases regarding how the subject has been feeling or acting recently. Codings reflect whether the phrase was descriptive of the subject most of the time, sometimes, or not at all in the past two weeks. |
| [MiscellaneousQuestions](activities/MiscellaneousQuestions) | schema for other questions for voice study |
| [MoodDisorderQuestionnaire](activities/MoodDisorderQuestionnaire) | MoodDisorderQuestionnaire |
| [NDA](activities/NDA) | schema describing terms needed to generate NDA guid |
| [PC-PTSD-5](activities/PC-PTSD-5) | PC-PTSD-5 assessment schema |
| [PCIAT](activities/PCIAT) | This 20-item questionnaire measures mild, moderate, and severe levels of Internet Addiction. The Parent-Child Internet Addiction Test will help you determine if you may be dealing with Internet Addiction in your home. |
| [PEIS](activities/PEIS) | PEIS assessment schema |
| [PHQ](activities/PHQ) | PHQ-8 assessment schema |
| [PHQ-4](activities/PHQ-4) | PHQ-4 |
| [PHQ-8](activities/PHQ-8) | PHQ-8 |
| [PHQ-9](activities/PHQ-9) | PHQ-9 |
| [PHQ-9a](activities/PHQ-9a) | PHQ-9a |
| [PHQ-SADS](activities/PHQ-SADS) | PHQ-SADS |
| [PHQ_15](activities/PHQ_15) | PHQ_15 |
| [PHQalcohol](activities/PHQalcohol) | PHQ Q10 schema |
| [PHQeating](activities/PHQeating) | PHQ eating disorder schema |
| [PROMISGlobalHealth](activities/PROMISGlobalHealth) | brief survey to assess the general health |
| [PSC-17](activities/PSC-17) | PSC-17 assessment schema |
| [PSC-17-Y](activities/PSC-17-Y) | PSC-17-Y assessment schema |
| [ProdromalQuestionnaireBriefVersion](activities/ProdromalQuestionnaireBriefVersion) | ProdromalQuestionnaireBriefVersion |
| [RCADS-25-C](activities/RCADS-25-C) | RCADS-25-C |
| [RCADS-25-Y](activities/RCADS-25-Y) | RCADS-25-Y |
| [SCQ](activities/SCQ) | The SCQ consists of forty yes-or-no questions, which a parent can complete in around ten minutes. It provides valuable information on a child’s body movements, use of language or gestures, and style of interacting. Usually, the SCQ is used as a screening instrument to help identify which children may have an autism spectrum disorder. It is not meant to provide a detailed diagnosis, but to indicate whether a child needs a more careful and in-depth evaluation. |
| [SCS](activities/SCS) | SelfCompassionScale schema |
| [SCS-SF](activities/SCS-SF) | Self Compassion schema |
| [SFI](activities/SFI) | SFI schema |
| [SITBI](activities/SITBI) | SITBI |
| [SRIS-SF](activities/SRIS-SF) | SRIS-SF assessment schema |
| [SWED](activities/SWED) | SWED assessment schema |
| [TEQ](activities/TEQ) | Self Compassion schema |
| [ThankYou](activities/ThankYou) | ThankYou page schema |
| [TokenActivity](activities/TokenActivity) | TokenActivity assessment schema |
| [VoiceConsent](activities/VoiceConsent) | Consent for voice study |
| [VoiceTask](activities/VoiceTask) | VoiceTask |
| [WHODAS12](activities/WHODAS12) | WHODAS12 assessment schema |
| [WHODAS36_P](activities/WHODAS36_P) | WHODAS36_P |
| [WHODAS36_S](activities/WHODAS36_S) | WHODAS36_S |
| [abcd_ant01](activities/abcd_ant01) | ABCD Youth Anthropometrics Modified From PhenX (ANT) |
| [abcd_asrs01](activities/abcd_asrs01) | ABCD Parent Adult Self Report Scores Aseba (ASR) |
| [abcd_betnet02](activities/abcd_betnet02) | ABCD rsfMRI Gordon Network Correlations |
| [abcd_bisbas01](activities/abcd_bisbas01) | ABCD Youth Behavioral Inhibition/Behavioral Approach System Scales Modified from PhenX (BIS/BAS) |
| [abcd_bpm01](activities/abcd_bpm01) | ABCD Youth Brief Problem Monitor |
| [abcd_bpmt01](activities/abcd_bpmt01) | ABCD Brief Problem Monitor-Teacher Form For Ages 6-18 (BPMT) |
| [abcd_cbcl01](activities/abcd_cbcl01) | ABCD Parent Child Behavior Checklist Raw Scores Aseba (CBCL) |
| [abcd_cbcls01](activities/abcd_cbcls01) | ABCD Parent Child Behavior Checklist Scores Aseba (CBCL) |
| [abcd_crpf01](activities/abcd_crpf01) | ABCD Parent Community Risk and Protective Factors (CRPF) |
| [abcd_fes01](activities/abcd_fes01) | ABCD Youth Family Environment Scale-Family Conflict Subscale Modified from PhenX (FES) |
| [abcd_hers01](activities/abcd_hers01) | ABCD Youth Hair Sample |
| [abcd_hsss01](activities/abcd_hsss01) | ABCD Hormone Saliva Salimetric Scores |
| [abcd_ip01](activities/abcd_ip01) | ABCD Irma Substudy Parent |
| [abcd_isc01](activities/abcd_isc01) | ABCD Irma Substudy Child |
| [abcd_ksad01](activities/abcd_ksad01) | ABCD Parent Diagnostic Interview for DSM-5 Full (KSADS-5) |
| [abcd_ksad501](activities/abcd_ksad501) | ABCD Youth Diagnostic Interview for DSM-5 5 (KSADS-5) |
| [abcd_lpds01](activities/abcd_lpds01) | ABCD Longitudinal Parent Demographics Survey |
| [abcd_lpksad01](activities/abcd_lpksad01) | ABCD Longitudinal Parent Diagnostic Interview for DSM-5 Background Items Full (KSAD) |
| [abcd_lpmh01](activities/abcd_lpmh01) | ABCD Longitudinal Parent Medical History Questionnaire |
| [abcd_lpohstbi01](activities/abcd_lpohstbi01) | ABCD Longitudinal Parent Ohio State Traumatic Brain Injury Screen-Short Modified (OTBI) |
| [abcd_lpsaiq01](activities/abcd_lpsaiq01) | ABCD Longitudinal Parent Sports and Activities Involvement Questionnaire (SAIQ) |
| [abcd_lssmh01](activities/abcd_lssmh01) | ABCD Longitudinal Summary Scores Medical History |
| [abcd_lsssa01](activities/abcd_lsssa01) | ABCD Longitudinal Summary Scores Sports Activity |
| [abcd_lsstbi01](activities/abcd_lsstbi01) | ABCD Longitudinal Summary Scores Traumatic Brain Injury |
| [abcd_lt01](activities/abcd_lt01) | ABCD Longitudinal Tracking |
| [abcd_medhxss01](activities/abcd_medhxss01) | ABCD Summary Scores Medical History |
| [abcd_nda](activities/abcd_nda) | schema describing terms needed to generate NDA guid for ABCD study |
| [demographics_and_background_information_v1](activities/demographics_and_background_information_v1) | demographics_and_background_information_v1 |
| [dsm_5_parent_guardian_rated_level_1_crosscutting_s](activities/dsm_5_parent_guardian_rated_level_1_crosscutting_s) | dsm_5_parent_guardian_rated_level_1_crosscutting_s |
| [hbn_asr](activities/hbn_asr) | HBN Adult Self Report (ASR) |

## License
All documentation is licensed CC-BY.
Expand Down
118 changes: 118 additions & 0 deletions scripts/update_activities_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/usr/bin/env python3
import json
import re
from datetime import datetime, UTC
from pathlib import Path

def get_repo_root():
"""Get the root directory of the repository."""
return Path(__file__).parent.parent

def get_activity_description(activity_dir):
"""Extract the description from the activity's schema file.
Priority order: description["en"] > prefLabel["en"] > activity name
"""
try:
schema_path = activity_dir / f"{activity_dir.name}_schema"

if schema_path.exists():
with open(schema_path, 'r', encoding='utf-8') as f:
schema = json.load(f)
# Add schema validation
if isinstance(schema, dict):
if isinstance(schema.get('description'), dict) and schema['description'].get('en'):
return schema['description']['en']
if isinstance(schema.get('prefLabel'), dict) and schema['prefLabel'].get('en'):
return schema['prefLabel']['en']
return activity_dir.name

return activity_dir.name
except Exception as e:
print(f"Warning: Could not read schema for {activity_dir.name}: {str(e)}")
return activity_dir.name

def get_activities_with_descriptions():
"""Get list of activities and their descriptions from the activities directory."""
repo_root = get_repo_root()
activities_dir = repo_root / "activities"

if not activities_dir.exists():
raise FileNotFoundError(f"Directory {activities_dir} not found")

# Get all directories and their descriptions
activities = []
for activity_dir in sorted(activities_dir.iterdir()):
if activity_dir.is_dir():
description = get_activity_description(activity_dir)
activities.append({
'name': activity_dir.name,
'description': description
})

return activities

def create_markdown_table(activities):
"""Create a markdown table with activity links and descriptions."""
content = [
f"*Last updated: {datetime.now(UTC).strftime('%Y-%m-%d %H:%M:%S')} UTC*\n",
"| *Activity* | *Description* |",
"|----------|-------------|"
]

for activity in activities:
activity_link = f"[{activity['name']}](activities/{activity['name']})"
# Escape pipe characters in description
safe_description = activity['description'].replace('|', '\\|')
content.append(f"| {activity_link} | {safe_description} |")

return "\n".join(content)

def update_readme(table_content):
"""Update the README.md file with the new table."""
repo_root = get_repo_root()
readme_path = repo_root / "README.md"

if not readme_path.exists():
raise FileNotFoundError("README.md not found")

with open(readme_path, 'r', encoding='utf-8') as f:
content = f.read()

# Define the section pattern (without details/summary tags)
section_pattern = r'(## Available Activities\s*\n).*?(?=\n##|\Z)'

# Create the new section content
new_section = f"\\1\n{table_content}\n"

if '## Available Activities' not in content:
# If section doesn't exist, add it at the end
section_to_add = f"""
## Available Activities
{table_content}
"""
content = content.rstrip() + "\n" + section_to_add + "\n"
else:
# Replace the existing section content
content = re.sub(
section_pattern,
new_section,
content,
flags=re.DOTALL
)

with open(readme_path, 'w', encoding='utf-8') as f:
f.write(content)

def main():
try:
activities = get_activities_with_descriptions()
table = create_markdown_table(activities)
update_readme(table)
print("README.md has been successfully updated with the activities table.")
except Exception as e:
print(f"Error: {str(e)}")
return 1
return 0

if __name__ == "__main__":
exit(main())

0 comments on commit 55c8b97

Please sign in to comment.