Skip to content

Commit

Permalink
Add codespell support (config, workflow to detect/not fix) and make i…
Browse files Browse the repository at this point in the history
…t fix few typos (#413)

* Add github action to codespell main on push and PRs

* Add rudimentary codespell config

* Add pre-commit definition for codespell

* tune ups to codespellrc

* [DATALAD RUNCMD] chore: run codespell throughout fixing typos automagically

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

---------

Co-authored-by: Daniel Xenes <39000785+dxenes1@users.noreply.github.com>
  • Loading branch information
yarikoptic and dxenes1 authored Oct 23, 2024
1 parent 7b6a029 commit d67b095
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,*.svg,package-lock.json,*.css,*-min.*,.codespellrc,*.bundle.*,*.map
check-hidden = true
# ignore-regex =
# some favorite albeit unfortunate variable names
ignore-words-list = te
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

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

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ repos:
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in .codespellrc
rev: v2.3.0
hooks:
- id: codespell

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pip install -r requirements.txt

## Development Installation

Install developer python requirements and set up pre-commit enviroment.
Install developer python requirements and set up pre-commit environment.

```
source venv/bin/activate
Expand Down Expand Up @@ -102,7 +102,7 @@ Or perform each step individually:

## OAuth Set-up

The included development database is preconfigured to allow OAuth to authetnticate user accounts from `localhost:8000`. Here is a more [complete guide](https://www.section.io/engineering-education/django-google-oauth/) on how this was done.
The included development database is preconfigured to allow OAuth to authenticate user accounts from `localhost:8000`. Here is a more [complete guide](https://www.section.io/engineering-education/django-google-oauth/) on how this was done.

We use `django-allauth` to connect Google OAuth to the Django environment. Users also have the option to log in through the base allauth login/signup page:

Expand Down
2 changes: 1 addition & 1 deletion neuvue_project/templates/workspace.html
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@
var char_to_key_code = {'c': 67, 'd': 68, 'j': 74, 'm': 77, 'q': 81,
'r': 82, 't': 84, 'v': 86, 'w': 87, 'y': 89, 'z': 90};

// iterate through forced choice butttons to check for hotkey action
// iterate through forced choice buttons to check for hotkey action
var button_list = document.getElementsByClassName('forcedChoiceButton');
for (var i = 0; i < button_list.length; i++) {
var button = button_list.item(i);
Expand Down
2 changes: 1 addition & 1 deletion neuvue_project/workspace/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NeuroglancerLinkType(models.TextChoices):
Draws a path between all coordinates.
point -> expects a list of coordinates (metadata), description (metadata), and
group (metadata). Needs atleast one seed point (points). Places dot points for
group (metadata). Needs at least one seed point (points). Places dot points for
all coordinates listed.
pregenerated -> neuroglancer state already added to task. Useful for external
Expand Down
21 changes: 12 additions & 9 deletions neuvue_project/workspace/static/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Clicking on the blue row header for a task type will expand it to show a table w

The pending table will show tasks for that task type ordered by descending priority level. The number in the tab after "Pending" show how many pending tasks are available. The columns are described below:

* **Task ID** - The unique identifer for this task. Useful for referencing task to NeuVue admins or developers as well as for inspecting the task in the "Inspect Task" page. Click on the task ID in this table will redirect you to the "Inspect Task" page for the task ID you clicked on.
* **Seg ID** - The unique identifier for the neuron in the volume that is the primary target for this proofreading task. Seg IDs will sometimes be repeated across many tasks or even users. Seg IDs also change after edits so a seg ID listed in the task page may be outdated by the time a user opens that task. More info here.
* **Task ID** - The unique identifier for this task. Useful for referencing task to NeuVue admins or developers as well as for inspecting the task in the "Inspect Task" page. Click on the task ID in this table will redirect you to the "Inspect Task" page for the task ID you clicked on.
* **Seg ID** - The unique identifier for the neuron in the volume that is the primary target for this proofreading task. Seg IDs will sometimes be repeated across many tasks or even users. Seg IDs also change after edits so a seg ID listed in the task page may be outdated by the time a user opens that task. More info here.
* **Created** - EST Datetime of creation for this task.
* **Priority** - Numerical priority of this task. Higher priority means that task will be provided to the user earlier in the queue. Skipping a task reduces the task priority by 1.
* **Status** - Current status of the task. Four possible statuses: "open", "pending", "closed", "errored". Only "open" and "pending" tasks are shown in this table.
Expand All @@ -46,9 +46,10 @@ The closed tab is slightly different than the pending tab. This table is sorted

In addition to the task tables, you will also see buttons on the right side of the task type headers. These buttons are described below:

* **Start Proofreading** - This button exists for all task types with pending tasks available and assigned to you. Click this will nagivate you to the Workspace page, where the next task will automatically be queued up and displayed.
* **Add More Tasks** - Available for some task types only. Clicking this will allow additional tasks to be assigned to your user in cases where you deplete your queue or would like fresh tasks to work on. The number of tasks added to your user depends on the task type and there are certain limits set on how many tasks can be assigned to one user at a time.
* **Remove Skipped Tasks** - Available for some task types only. Clicking this will remove all tasks that have been skipped once or more from your queue permanently.

* **Start Proofreading** - This button exists for all task types with pending tasks available and assigned to you. Click this will navigate you to the Workspace page, where the next task will automatically be queued up and displayed.
* **Add More Tasks** - Available for some task types only. Clicking this will allow additional tasks to be assigned to your user in cases where you deplete your queue or would like fresh tasks to work on. The number of tasks added to your user depends on the task type and there are certain limits set on how many tasks can be assigned to one user at a time.
* **Remove Skipped Tasks** - Available for some task types only. Clicking this will remove all tasks that have been skipped once or more from your queue permanently.

From this point you can begin proofreading by deciding on which task types you would like to work on and then clicking "Start Proofreading" for that task type. This will navigate you to the workspace page, which is the main interface for proofreading work.

Expand Down Expand Up @@ -88,7 +89,8 @@ Here is a great instructional video on how to operate Neuroglancer for basic nav

<iframe width="560" height="315" src="https://www.youtube.com/embed/TwBTyWWnbxc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

[This cheatsheet](https://docs.google.com/document/d/1eypqJ9iI1GlWSPMTZQo9oDCLEahye6oYo_CuhS_5QTA/edit?usp=sharing) (credit to flywire.ai) has additional useful information thats specific to this proofreading effort!
[This cheatsheet](https://docs.google.com/document/d/1eypqJ9iI1GlWSPMTZQo9oDCLEahye6oYo_CuhS_5QTA/edit?usp=sharing) (credit to flywire.ai) has additional useful information that's specific to this proofreading effort!


## Additional Pages and Tools

Expand All @@ -104,7 +106,8 @@ The inspect task page has a similar layout to the workspace except it does not c

<img src="https://i.imgur.com/a29xKER.png" alt="Synapse Viewer Page" width="800"/>

The synapse viewer page is a visualization tool which means it can be accessed by any user with a valid root ID. It displays all presynaptic and postsynaptic locations for a valid root ID or multiple IDs. The pre and post annotations for each root ID are placed in an individual Neuroglancer layer so colors and sizes can be indepedently set. The sidebar displays information of on the number of connections for each root ID. This information can be copied or downloaded with the buttons below the table in the sidebar as well. To use the synaptic viewer, copy the list of root IDs (comma-separated) you want to visualize and paste them in the input box at app.neuvue.io/synapse.

The synapse viewer page is a visualization tool which means it can be accessed by any user with a valid root ID. It displays all presynaptic and postsynaptic locations for a valid root ID or multiple IDs. The pre and post annotations for each root ID are placed in an individual Neuroglancer layer so colors and sizes can be independently set. The sidebar displays information of on the number of connections for each root ID. This information can be copied or downloaded with the buttons below the table in the sidebar as well. To use the synaptic viewer, copy the list of root IDs (comma-separated) you want to visualize and paste them in the input box at app.neuvue.io/synapse.

Be aware that visualizing more than 10 root IDs at a time in the synpase viewer may cause Neuroglancer or your browser to crash!

Expand All @@ -125,7 +128,7 @@ When a Neuroglancer link is copied from the app, it will use our externally host

Any modern OS should work with NeuVue. To lower the chances of crashes or missing functionality, we recommend all users proofreading using Google Chrome. There have been compatibility issues with Safari and Firefox in the past.

### What should I do if I'm having a techical issue?
### What should I do if I'm having a technical issue?

Copy the task ID and paste in the proofreading slack channel. Describe your issue in detail and paste your task ID, browser and OS as well. A NeuVue developer will then provide more specific instructions on how to troubleshoot or fix the issue.

Expand All @@ -135,7 +138,7 @@ We recommend you do not refresh your browser when on the workspace page. This ca

### Is there an undo for Neuroglancer?

Yes, on the top right there will be an "undo/redo" arrow buttons that can be used to undo layer/ID selects, pans, zooms, and any changes to the Neuroglancer state. ** However, you cannot undo direct edits (i.e. splits/merges). ** To undo these, you can do the inverse operation for the undo, such as merging two accidently split IDs or splitting two accidently merged IDs.
Yes, on the top right there will be an "undo/redo" arrow buttons that can be used to undo layer/ID selects, pans, zooms, and any changes to the Neuroglancer state. ** However, you cannot undo direct edits (i.e. splits/merges). ** To undo these, you can do the inverse operation for the undo, such as merging two accidentally split IDs or splitting two accidentally merged IDs.

### How do I stop Neuroglancer from lagging/slowing down?

Expand Down
4 changes: 2 additions & 2 deletions neuvue_project/workspace/static/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
{
"update_name": "v1.6.2",
"update_date":"June 30th, 2022",
"update_description": "Allows tags to be saved when skipping, flagging, or exitting a task. Improved load times for admin tools."
"update_description": "Allows tags to be saved when skipping, flagging, or exiting a task. Improved load times for admin tools."
},
{
"update_name": "v1.6.1",
Expand All @@ -73,7 +73,7 @@
{
"update_name": "v1.5.3",
"update_date":"April 28th, 2022",
"update_description": "Adds annotation color pallete preference. Updates to lineage viewer."
"update_description": "Adds annotation color palette preference. Updates to lineage viewer."
},
{
"update_name": "v1.5.2",
Expand Down
2 changes: 1 addition & 1 deletion neuvue_project/workspace/static/workspace/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(storage && storage.length !== 0);

if (!outOfSpace) {
alert('Local Storage has been disabled, please renable it in Chrome');
alert('Local Storage has been disabled, please re-enable it in Chrome');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion neuvue_project/workspace/views/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def post(self, request, *args, **kwargs):
max_tasks = namespace_obj.max_number_of_pending_tasks_per_user

# Dev Note: Below is the logic for handling re-assignment of tasks. User levels default to novice and
# can be overriden by the user profile in the admin page. How levels affect what group the namespace
# can be overridden by the user profile in the admin page. How levels affect what group the namespace
# belongs to depends on how the namespace configures the push to and pull from attributes.
# By default, namespaces do not allow for reassignment.

Expand Down

0 comments on commit d67b095

Please sign in to comment.