Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codespell: config, action + typos fixed #1106

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = .git,*.pdf,*.svg,bibliography.json,yarn.lock,tslint.json,lunr.js
# Mor - name
ignore-words-list = mor,ser,pres
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and saving as `neuroscout/frontend/src/config.ts`.
For single sign on using Google, a [sign-in project](https://developers.google.com/identity/sign-in/web/sign-in) is needed.


## Initalizing backend
## Initializing backend
Build the containers and start services using the development configuration:

docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
Expand All @@ -36,7 +36,7 @@ The server should now be running at http://localhost/

Next, initialize, migrate and upgrade the database migrations.
If you have a database file, load it using `pg_restore`. Otherwise, delete the migrations folder,
initalize the database and add a test user.
initialize the database and add a test user.

docker-compose exec neuroscout bash
rm -rf /migrations/migrations
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _find_create_google(ginfo):

def authenticate(username, password):
""" Authenticate user and password combination
Returns user object if succesful, otherwise None """
Returns user object if successful, otherwise None """
if username == 'GOOGLE':
ginfo = _authenticate_google(password)
if ginfo:
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/config/feature_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
"description": "Mean concreteness rating of spoken words."
},
"aoa.AoA_Kup": {
"description": "Age of aquisition of spoken words."
"description": "Age of acquisition of spoken words."
},
"massiveauditorylexicaldecision_IsWord": {
"description": "Whether the item is a word or pseudo-word."
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/config/predictor_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"source": "fmriprep"
},
"^framewise_displacement$": {
"description": "Esimated bulk-head motion",
"description": "Estimated bulk-head motion",
"source": "fmriprep"
},
"^non_steady_state_outlier([0-9]{2,3})$": {
Expand Down
9 changes: 9 additions & 0 deletions neuroscout/frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
-->
<title>Neuroscout</title>
<script async src="https://w.appzi.io/w.js?token=9vQ1A"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WHXN332J31"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-WHXN332J31');
</script>
<script defer data-domain="neuroscout.org" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/frontend/src/HelperComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'
import { predictorColor } from './utils'
import { Predictor } from './coretypes'

// Simple space component to seperate buttons, etc.
// Simple space component to separate buttons, etc.
// eslint-disable-next-line react/self-closing-comp
export const Space = () => <span> </span>

Expand Down
2 changes: 1 addition & 1 deletion neuroscout/frontend/src/analysis_builder/Builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ export default class AnalysisBuilder extends React.Component<
}

// run any time we attempt to leave tab
// xform and contrast checks are more or less the same save validate funciton call...
// xform and contrast checks are more or less the same save validate function call...
preTabChange = (nextTab: TabName): boolean => {
let errors: string[] = []
if (this.state.activeTab === 'transformations') {
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/frontend/src/analysis_builder/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class OverviewTab extends React.Component<

applyFilter = (pagination, filters, sorter, extra): void => {
/* If we have no set filters, but some selected subjects and we change pages then all subjects will
* be selected. To prevent this we return immediatly if no filters are set.
* be selected. To prevent this we return immediately if no filters are set.
*/
if (
Object.keys(filters)
Expand Down
4 changes: 2 additions & 2 deletions neuroscout/frontend/src/analysis_builder/Transformations.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This module comtains the following components:
This module contains the following components:
- XformsTab: parent component implementing the transformation tab of the analysis builder.
- XformDisplay: component to display a single transformation
- XformEditor: component to add/edit a transformtion
Expand Down Expand Up @@ -59,7 +59,7 @@ export function validateXform(xform: Transformation) {
}
if (xform.Name === 'Orthogonalize' && xform.Input !== undefined) {
if (xform.Other === undefined || xform.Other.length < 1) {
errors.push('Must orthoganalize with respect to at least one predictor')
errors.push('Must orthogonalize with respect to at least one predictor')
}
}

Expand Down
2 changes: 1 addition & 1 deletion neuroscout/frontend/src/browser/AnalysisList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Resuable AnalysisList component used for displaying a list of analyses, e.g. on
Reusable AnalysisList component used for displaying a list of analyses, e.g. on
the home page or on the 'browse public analysis' page
*/
import * as React from 'react'
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/frontend/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export class UserStore {
Modal.success({
title: 'Account created!',
content:
'Your account has been sucessfully created. \
'Your account has been successfully created. \
You will receive a confirmation email shortly. Please follow the instructions to activate your account\
and start using Neuroscout. ',
okText: 'Okay',
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/frontend/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const _sortRuns = (keys, a, b) => {
return 0
}

// Comparison functions to pass to sort for arrays of type Run by differnt keys
// Comparison functions to pass to sort for arrays of type Run by different keys
export const sortSub = _sortRuns.bind(null, ['subject', 'number', 'session'])
export const sortNum = _sortRuns.bind(null, ['number', 'subject', 'session'])
export const sortSes = _sortRuns.bind(null, ['session', 'subject', 'number'])
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/models/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def float_values(self):


def get_top_bottom(self, bottom=False, limit=None):
""" Get the Stimuli associated with the top or botton N values for this Predictor """
""" Get the Stimuli associated with the top or bottom N values for this Predictor """
try:
val = cast(ExtractedEvent.value, Float)
if bottom:
Expand Down
4 changes: 2 additions & 2 deletions neuroscout/populate/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, schema, add_all):

class PredictorSerializer(Serializer):
def __init__(self, add_all=True, include=None, exclude=None, TR=None):
""" Initalize serializer for ingested features.
""" Initialize serializer for ingested features.
Args:
add_all - Add all variables including those not in the schema
include - List of variables to include
Expand Down Expand Up @@ -140,7 +140,7 @@ def _annotate_feature(self, pattern, schema, feat, extractor, sub_df,
sub_df - df with ef values
default_active - set to active by default?
"""
# If name is in schema, substitue regex patterns from schema pattern
# If name is in schema, substitute regex patterns from schema pattern
# and fill in format strings from extractor_dict
feat = feat.replace(',', '') # Remove commas
if 'name' in schema:
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/populate/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _extract_to_serial(graphs, stim_object, serializer):
""" For a stim_object, load stim and apply graphs, and serialize """
results = []
for stim_obj, pliers_stim in _load_stim(stim_object):
# For each graph, check compatability, and then extract
# For each graph, check compatibility, and then extract
for graph in graphs:
ext = graph.roots[0].transformer
if ext._stim_matches_input_types(pliers_stim):
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/populate/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def add_task(task_name, dataset_name, local_path,
include_predictors - set of predictors to ingest
exclude_predictors - set of predictors to exclude from ingestions
reingest - force reingesting even if dataset already exists
scan_length - default scan length in case it cant be found in image
scan_length - default scan length in case it can't be found in image
summary - Task summary description,
layout - Preinstantiated BIDSLayout
kwargs - arguments to filter runs by
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/populate/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def ingest_from_json(config_file, reingest=False, auto_fetch=False):

def extract_from_json(extract_config, dataset_name=None, task_name=None):
""" Applies JSON file specifying conversion and extractions to
specifed tasks.
specified tasks.

Args:
extract_config: JSON specifying the arguments to each step
Expand Down
6 changes: 3 additions & 3 deletions neuroscout/populate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ def hash_stim(stim, blocksize=65536):
filename = stim.history.source_file \
if stim.history \
else stim.filename
with open(filename, 'rb') as afile:
buf = afile.read(blocksize)
with open(filename, 'rb') as f:
buf = f.read(blocksize)
while len(buf) > 0:
hasher.update(buf)
buf = afile.read(blocksize)
buf = f.read(blocksize)

return hasher.hexdigest()

Expand Down
2 changes: 1 addition & 1 deletion neuroscout/resources/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def post(self, **kwargs):
else:
user.password = kwargs['password']
db.session.commit()
return {'message': 'Password reset succesfully.'}
return {'message': 'Password reset successfully.'}


class UserPredictorListResource(MethodResource):
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/resources/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def wrapper(*args, **kwargs):
def owner_required(function):
""" A JWT matching the user id of the analysis is required,
assumes analysis id is second argument, and replaces id with
Analysis object if succesfull. """
Analysis object if successful. """
@auth_required
@fetch_analysis
def wrapper(*args, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions neuroscout/schemas/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class DatasetSchema(Schema):
summary = fields.Str(
description='Dataset summary description')
url = fields.Str(
descrption='Link to external resources')
description='Link to external resources')
mimetypes = fields.List(
fields.Str(), description='Dataset mimetypes/modalities')
mean_age = fields.Float(
descrption='Mean age in years of subjects')
description='Mean age in years of subjects')
percent_female = fields.Float(
descrption='Percent female subjects')
description='Percent female subjects')
runs = fields.Pluck(
'RunSchema', 'id', many=True)
tasks = fields.Nested(
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/tests/api/test_analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_post(auth_client, add_task, add_predictor):
assert Analysis.query.filter_by(
hash_id=rv_json['hash_id']).one().name == 'some analysis'

# Re post analysis, check that id is diffeent
# Re post analysis, check that id is different
rv_2 = auth_client.post('/api/analyses', data=test_analysis)
assert rv_2.status_code == 200
assert decode_json(rv_2)['hash_id'] != decode_json(resp)['hash_id']
Expand Down
2 changes: 1 addition & 1 deletion neuroscout/tests/api/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ def test_get_dataset(auth_client, add_local_task_json):
assert dataset['summary'] == "A test dataset"
assert dataset['url'] == "https://github.com/adelavega/bids_test"

# Try getting nonexistent datset
# Try getting nonexistent dataset
resp = auth_client.get('/api/datasets/{}'.format('1324'))
assert resp.status_code == 404
2 changes: 1 addition & 1 deletion neuroscout/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .. import populate

"""
Session / db managment tools
Session / db management tools
"""


Expand Down
2 changes: 1 addition & 1 deletion site/builder/transformations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h1 id="add-transformations">Add Transformations</h1>
<p>The next step in defining model is to transform the variables you've selected. This step is optional-- for many models you may not need to make any modifications to the input variables.</p>
<p>To add a transformation, click <code>Add Transformation</code> and select an operation from the dropdown list.</p>
<p><img alt="Add transformation" src="../img/transformation_add.png" /></p>
<p>The transformations currently supported by Neuroscout are a subset of the complete set of transformations detailed in the <a href="https://docs.google.com/document/d/1bq5eNDHTb6Nkx3WUiOBgKvLNnaa5OMcGtD0AZ9yms2M/edit?usp=sharing">BIDS StatsModel specification</a> (in active development). As Neuroscout matures, the number of suppport transformations will grow.</p>
<p>The transformations currently supported by Neuroscout are a subset of the complete set of transformations detailed in the <a href="https://docs.google.com/document/d/1bq5eNDHTb6Nkx3WUiOBgKvLNnaa5OMcGtD0AZ9yms2M/edit?usp=sharing">BIDS StatsModel specification</a> (in active development). As Neuroscout matures, the number of support transformations will grow.</p>
<table>
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion site/css/theme_extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ form .search-query {

/*
* Account for wide tables which go off the side.
* Override borders to avoid wierdness on narrow tables.
* Override borders to avoid weirdness on narrow tables.
*
* https://github.com/mkdocs/mkdocs/issues/834
* https://github.com/mkdocs/mkdocs/pull/1034
Expand Down
2 changes: 1 addition & 1 deletion site/search/search_index.json

Large diffs are not rendered by default.