Skip to content

Commit 7b6a029

Browse files
authored
Exclude few files and apply pre-commit throughout (#412)
* Remove requirement for python 3.9 to be used in pre-commit AFAIK this is entirely not needed and in general just complicates use of pre-commit on systems which no longer (for years) have 3.9 readily available * Exclude .map and .svg files from pre-commit consideration * [DATALAD RUNCMD] Run pre-commit run --all (Closes #411) === Do not change lines below === { "chain": [], "cmd": "pre-commit run --all || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
1 parent 6dcdb95 commit 7b6a029

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+644
-563
lines changed

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
exclude: \.(map|svg)$
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
34
rev: v2.3.0
+8-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
option_settings:
2-
aws:elasticbeanstalk:application:environment:
3-
DJANGO_SETTINGS_MODULE: "neuvue.settings"
1+
option_settings:
2+
aws:elasticbeanstalk:application:environment:
3+
DJANGO_SETTINGS_MODULE: "neuvue.settings"
44
PYTHONPATH: "/var/app/current:$PYTHONPATH"
5-
aws:elasticbeanstalk:container:python:
6-
WSGIPath: neuvue.wsgi:application
7-
NumProcesses: 3
5+
aws:elasticbeanstalk:container:python:
6+
WSGIPath: neuvue.wsgi:application
7+
NumProcesses: 3
88
NumThreads: 20
99
aws:elasticbeanstalk:environment:proxy:staticfiles:
1010
/static: static
11-
11+
1212
container_commands:
1313
01_collectstatic:
1414
command: "source /var/app/venv/*/bin/activate && python3 manage.py collectstatic --noinput"
1515
02_migrate:
1616
command: "source /var/app/venv/*/bin/activate && python3 manage.py migrate"
17-
leader_only: true
17+
leader_only: true

neuvue_project/.ebextensions/https.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Resources:
1818
StatusCode: HTTP_301
1919
Type: redirect
2020
Port: 80
21-
Protocol: HTTP
21+
Protocol: HTTP

neuvue_project/.ebextensions/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ packages:
22
yum:
33
python3-devel: []
44
mariadb105-devel.x86_64: []
5-
graphviz: []
5+
graphviz: []

neuvue_project/.platform/nginx.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
container_commands:
22
01_reload_nginx:
3-
command: "service nginx reload"
3+
command: "service nginx reload"

neuvue_project/.platform/nginx/conf.d/proxy.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ client_body_timeout 300;
44
send_timeout 300;
55
proxy_connect_timeout 300;
66
proxy_read_timeout 300;
7-
proxy_send_timeout 300;
7+
proxy_send_timeout 300;

neuvue_project/dashboard/views.py

+19-9
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,14 @@ def post(self, request, *args, **kwargs):
325325
sieve=sieve,
326326
select=["assignee", "status", "duration", "metadata", "closed", "opened"],
327327
)
328-
task_df['n_operation_ids'] = task_df['metadata'].apply(lambda x: len(x.get('operation_ids')) if isinstance(x.get('operation_ids'), list) else 0)
329-
task_has_edits = True if any(task_df['n_operation_ids'].to_list()) else False
328+
task_df["n_operation_ids"] = task_df["metadata"].apply(
329+
lambda x: len(x.get("operation_ids"))
330+
if isinstance(x.get("operation_ids"), list)
331+
else 0
332+
)
333+
task_has_edits = True if any(task_df["n_operation_ids"].to_list()) else False
330334

331-
if bool((namespace in decision_namespaces) & (len(task_df)>0)):
335+
if bool((namespace in decision_namespaces) & (len(task_df) > 0)):
332336
import plotly.express as px
333337
from plotly.subplots import make_subplots
334338

@@ -343,14 +347,20 @@ def post(self, request, *args, **kwargs):
343347
horizontal_spacing=0.02,
344348
)
345349

346-
namespace_submission_method = Namespaces.objects.get(display_name=display_name).submission_method
347-
decision_types = ForcedChoiceButton.objects.filter(set_name=namespace_submission_method).values_list('display_name','submission_value')
348-
350+
namespace_submission_method = Namespaces.objects.get(
351+
display_name=display_name
352+
).submission_method
353+
decision_types = ForcedChoiceButton.objects.filter(
354+
set_name=namespace_submission_method
355+
).values_list("display_name", "submission_value")
356+
349357
color_count = 0
350358
for namespace_display_name, submission_value in decision_types:
351359
decision_counts = {}
352360
for assignee in users:
353-
decision_counts[assignee] = len(task_df[task_df["decision"] == submission_value])
361+
decision_counts[assignee] = len(
362+
task_df[task_df["decision"] == submission_value]
363+
)
354364

355365
x = list(decision_counts.keys())
356366
y = list(decision_counts.values())
@@ -388,7 +398,7 @@ def post(self, request, *args, **kwargs):
388398
"Username",
389399
"Total Duration (h)",
390400
"Avg Closed Duration (m)",
391-
"Avg Duration (m)"
401+
"Avg Duration (m)",
392402
]
393403
if task_has_edits:
394404
columns.extend(["Average Edits", "Total Edits"])
@@ -453,7 +463,7 @@ def post(self, request, *args, **kwargs):
453463
"fig_time": fig_time.to_html(),
454464
}
455465

456-
if bool((namespace in decision_namespaces) & (len(task_df)>0)):
466+
if bool((namespace in decision_namespaces) & (len(task_df) > 0)):
457467
context["fig_decision"] = fig_decision.to_html()
458468

459469
return render(request, "report.html", context)

neuvue_project/neuvue/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
LOGIN_URL = "index"
205205
LOGIN_REDIRECT_URL = "/tasks"
206206
LOGOUT_REDIRECT_URL = "/"
207-
SOCIALACCOUNT_LOGIN_ON_GET = True
207+
SOCIALACCOUNT_LOGIN_ON_GET = True
208208

209209
# Needed for NeuroGlancer Popups
210210
SECURE_CROSS_ORIGIN_OPENER_POLICY = None

neuvue_project/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ urllib3==1.26.18
9898
wcwidth==0.1.9
9999
webcolors==1.13
100100
zipp==3.18.1
101-
./deps/neuvue-client
101+
./deps/neuvue-client

neuvue_project/requirements.txt.general

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ pandas
1919
Pillow
2020
plotly
2121
requests
22-
./deps/neuvue-client
22+
./deps/neuvue-client

neuvue_project/requirements.txt.old

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ typing-extensions==3.10.0.2
7979
urllib3==1.26.7
8080
wcwidth==0.1.9
8181
websocket-client==0.59.0
82-
./deps/neuvue-client
82+
./deps/neuvue-client

neuvue_project/templates/404.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,4 @@
163163
canvas { outline: none; border: none; }
164164
</style>
165165

166-
{% endblock %}
166+
{% endblock %}

neuvue_project/templates/about.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<h1 class="pt-5 pb-3" aria-level="1"> About Us </h1>
1010

1111
<p>
12-
We are a team of research scientists and engineers from the Johns Hopkins Applied Physics
12+
We are a team of research scientists and engineers from the Johns Hopkins Applied Physics
1313
Laboratory that developed NeuVue with the help of a friendly <em>axon</em>olotl!
1414
</p>
1515

@@ -25,21 +25,21 @@ <h1 class="pt-5 pb-3" aria-level="1"> About Us </h1>
2525
</div>
2626

2727
<p>
28-
NeuVue is a software platform created for large-scale proofreading of machine segmentation and neural
29-
circuit reconstruction in high-resolution electron microscopy connectomics datasets. NeuVue provides an
30-
intuitive interface for proofreaders to collaboratively view, annotate, and edit segmentation and
28+
NeuVue is a software platform created for large-scale proofreading of machine segmentation and neural
29+
circuit reconstruction in high-resolution electron microscopy connectomics datasets. NeuVue provides an
30+
intuitive interface for proofreaders to collaboratively view, annotate, and edit segmentation and
3131
connectivity data.
32-
33-
NeuVue has everything you need for a high-throughput proofreading workflow! Analytical dashboards, data
34-
visualization tools, and simple API enables stakeholders real-time access to proofreading progress at an
35-
individual proofreader level as well as global reconstruction quality insights. NeuVue is intentionally
36-
agnostic to the underlying data management backend and can be easily deployed in an AWS environment.
37-
Proofreaders can work with powerful streamlined tools for splitting and merging connectivity data in
38-
dense nano-scale reconstruction better than ever before.
32+
33+
NeuVue has everything you need for a high-throughput proofreading workflow! Analytical dashboards, data
34+
visualization tools, and simple API enables stakeholders real-time access to proofreading progress at an
35+
individual proofreader level as well as global reconstruction quality insights. NeuVue is intentionally
36+
agnostic to the underlying data management backend and can be easily deployed in an AWS environment.
37+
Proofreaders can work with powerful streamlined tools for splitting and merging connectivity data in
38+
dense nano-scale reconstruction better than ever before.
3939
</p>
4040

4141
<p class="fw-bold">
42-
This research was enabled by the IARPA Machine Intelligence from Cortical Networks (MICrONS) program.
42+
This research was enabled by the IARPA Machine Intelligence from Cortical Networks (MICrONS) program.
4343
<a class="text-secondary-color-activated" href="https://www.iarpa.gov/research-programs/microns">Learn more about MICrONS.</a>
4444
</p>
4545

@@ -88,4 +88,4 @@ <h2 class="pt-5 pb-3"> Contact Us </h2>
8888
</div>
8989
</div>
9090
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
91-
{% endblock %}
91+
{% endblock %}

neuvue_project/templates/admin_dashboard/dashboard-namespace-view.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
4040
<div>
4141
<div id="action-buttons" class="container-fluid">
4242
<form id="taskPatchForm" action="" method="POST" class="form-inline float-start" >{% csrf_token %}
43-
43+
4444
<input type="hidden" name="username" value="{{username}}" />
4545
<input type="hidden" name="namespace" value="{{namespace}}" />
4646
<label class="m-2"> Assign </label>
@@ -64,13 +64,13 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
6464
<button type="button" id="distribute-button" form="taskPatchForm" name="selected_action" value="distribute" class="btn btn-primary" >
6565
Distribute Tasks
6666
</button>
67-
67+
6868
</form>
6969
</div>
7070
<br><br>
71-
<hr>
71+
<hr>
7272
</div>
73-
73+
7474
{% endif %}
7575
<table id="summary-table" class="table table-striped table-hover">
7676
<thead>
@@ -130,7 +130,7 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
130130
// Perform download
131131
$('#summary-table').table2csv('download', {'filename': filename});
132132

133-
});
133+
});
134134
// button is clicked
135135
if ("{{group}}" === "unassigned") {
136136
const distributeButton = document.getElementById("distribute-button");

neuvue_project/templates/admin_dashboard/dashboard-user-view.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
119119
<td>{{taskrow.closed}}</td>
120120
<td>{{taskrow.duration}}</td>
121121
{% if taskrow.tags %}
122-
<td class='userTags'>
123-
<span
124-
data-bs-toggle="tooltip"
125-
data-bs-placement="right"
122+
<td class='userTags'>
123+
<span
124+
data-bs-toggle="tooltip"
125+
data-bs-placement="right"
126126
data-bs-html="true"
127127
title="{{taskrow.tags|join:", "}}" >
128-
{{ taskrow.tags.0 }}
128+
{{ taskrow.tags.0 }}
129129
</span>
130130
</td>
131131
{% else %}
@@ -142,7 +142,7 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
142142
</div>
143143

144144
</div>
145-
<div id="hiddenSelectedTable" style="visibility: none;">
145+
<div id="hiddenSelectedTable" style="visibility: none;">
146146
</div>
147147

148148
<!-- Confirm action modals -->
@@ -213,13 +213,13 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
213213
$('#summary-table input[name=selected_tasks]').each(function(){
214214
if ($(this).is(':checkbox') && !$(this).is(":checked")) {
215215
$(this).prop( "checked", true );
216-
}
216+
}
217217
})
218218
} else {
219219
$('#summary-table input[name=selected_tasks]').each(function(ele){
220220
if ($(this).is(':checkbox') && $(this).is(":checked")) {
221221
$(this).prop( "checked", false );
222-
}
222+
}
223223
})
224224
}
225225
});
@@ -239,7 +239,7 @@ <h3 class="d-flex flex-row bd-highlight mb-3 text-white">
239239
// Otherwise, download only the tasks that were selected
240240
} else {
241241
let filteredTable = $('#summary-table').clone()[0] // make a copy of the visible table to edit and export
242-
filteredTable.id = 'userSelectedTable';
242+
filteredTable.id = 'userSelectedTable';
243243
const selectedRows = $( '#summary-table' ).find( 'tbody' ) // select table body and
244244
.find( 'tr' ) // select all rows that has
245245
.has( 'input[type=checkbox]:checked' ); // checked checkbox element

neuvue_project/templates/admin_dashboard/dashboard.html

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ <h3 class="text-white"> Admin Dashboard</h3>
3737
</select>
3838

3939
</div>
40-
40+
4141
<div class="form-group my-3">
4242
<label class="text-white" for="groupSelect">Group</label>
4343
<select name="group" class="form-select" id="groupSelect" placeholder="Select one" required="true">
4444
<option value="" selected disabled>Please select</option>
4545
{% for group_opt in all_groups %}
4646
<option>{{group_opt}} </option>
4747
{% endfor %}
48-
</select>
48+
</select>
4949
</div>
5050

5151
<div class="form-group d-flex my-4">
5252
<input type="submit" class="btn btn-primary" value="Submit">
5353
<div id="submit-spinner-tab1" class="text-white ms-3 mt-2"></div>
54-
54+
5555
{% if error %}
5656
<small id="errormessage" class="form-text text-danger"> {{error}} </small>
5757
{% endif %}
58-
58+
5959
</div>
6060
</form>
6161
</div>
@@ -70,17 +70,17 @@ <h3 class="text-white"> Admin Dashboard</h3>
7070
{% for user_opt in all_users %}
7171
<option>{{user_opt}} </option>
7272
{% endfor %}
73-
</select>
73+
</select>
7474
</div>
7575

7676
<div class="form-group d-flex my-4">
7777
<input type="submit" class="btn btn-primary" value="Submit">
7878
<div id="submit-spinner-tab2" class="text-white ms-3 mt-2"></div>
79-
79+
8080
{% if error %}
8181
<small id="errormessage" class="form-text text-danger"> {{error}} </small>
8282
{% endif %}
83-
83+
8484
</div>
8585
</form>
8686
</div>
@@ -106,4 +106,3 @@ <h3 class="text-white"> Admin Dashboard</h3>
106106

107107
</script>
108108
{% endblock %}
109-

neuvue_project/templates/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<link rel="preconnect" href="https://fonts.googleapis.com">
1515
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1616
<link href="https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500&family=Montserrat:wght@500;700&family=Open+Sans:wght@400;600&display=swap" rel="stylesheet">
17-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
17+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
1818
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'favicon/apple-touch-icon.png' %}">
1919
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'favicon/favicon-32x32.png' %}">
2020
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'favicon/favicon-16x16.png' %}">
@@ -50,7 +50,7 @@
5050
</li>
5151

5252
{% endif%}
53-
53+
5454
{% if request.user|in_group:"AuthorizedUsers"%}
5555

5656
<li class="nav-item">

neuvue_project/templates/getting-started.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
var scrollLocation = headers[headerIndex]
4949
} else {
5050
var scrollLocation = document.getElementsByClassName('getting-started-content')[0];
51-
}
51+
}
5252
scrollLocation.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});
5353
}
5454

5555
</script>
56-
{% endblock %}
56+
{% endblock %}

neuvue_project/templates/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1 class="index-title-text mt-4 my-1">Welcome to NeuVue</h1>
4343
</div>
4444
</div>
4545
</div>
46-
<div class="index-card-column">
46+
<div class="index-card-column">
4747
</div>
4848
</div>
4949
</div>

0 commit comments

Comments
 (0)