Skip to content

Commit

Permalink
Merge pull request #240 from VisLab/develop
Browse files Browse the repository at this point in the history
Updated the behavior of the online tools for assembling HED
  • Loading branch information
VisLab authored Nov 21, 2024
2 parents 69f2bf8 + 5a213ca commit b907e34
Show file tree
Hide file tree
Showing 10 changed files with 476 additions and 466 deletions.
1 change: 0 additions & 1 deletion deploy_hed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ RUN mkdir -p /var/log/hedtools && \
# Copy the application code into the container
COPY ./hedtools /root/hedtools/
COPY ./hedtools/hedweb /root/hedtools/hedweb/
#COPY ./hedtools/hedweb/runserver.py /root/

# Set the PYTHONPATH environment variable to include /root/hedtools
ENV PYTHONPATH="/root/hedtools"
Expand Down
1 change: 0 additions & 1 deletion deploy_hed_dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ RUN mkdir -p /var/log/hedtools && \
# Copy the application code into the container
COPY ./hedtools /root/hedtools/
COPY ./hedtools/hedweb /root/hedtools/hedweb/
# COPY ./hedtools/hedweb/runserver.py /root/

# Set the PYTHONPATH environment variable to include /root/hedtools
ENV PYTHONPATH="/root/hedtools"
Expand Down
2 changes: 1 addition & 1 deletion deploy_hed_dev/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ echo "[INFO] Running new container..."
run_new_container

echo "[INFO] Cleaning up temporary directories..."
# cleanup_directories
cleanup_directories

echo "[INFO] Deployment successful!"
1 change: 1 addition & 0 deletions hedweb/constants/base_constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
APPEND_ASSEMBLED = 'append_assembled'
CHECK_FOR_WARNINGS = 'check_for_warnings'

COLUMN_COUNTS = 'column_counts'
Expand Down
566 changes: 282 additions & 284 deletions hedweb/event_operations.py

Large diffs are not rendered by default.

329 changes: 165 additions & 164 deletions hedweb/process_form.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hedweb/templates/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3>BIDS-style event (tsv) file:</h3>
<form id="events_form" method="POST" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{{ create_actions(assemble=True,generate_sidecar=True,validate=True,remodel=True,search=True) }}
{{ create_options(check_for_warnings=True,expand_defs=True,include_context=True,include_summaries=True,replace_defs=True,remove_types_on=True) }}
{{ create_options(append_assembled=True,check_for_warnings=True,expand_defs=True,include_context=True,include_summaries=True,replace_defs=True,remove_types_on=True) }}
<p>&nbsp;</p>
<fieldset class="form-group">
<legend>Input:</legend>
Expand Down
2 changes: 1 addition & 1 deletion hedweb/templates/js/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const DEFAULT_XML_URL = "https://raw.githubusercontent.com/hed-standard/hed-schemas/main/standard_schema/hedxml/HED8.2.0.xml";
const DEFAULT_XML_URL = "https://raw.githubusercontent.com/hed-standard/hed-schemas/main/standard_schema/hedxml/HED8.3.0.xml";
const EXCEL_FILE_EXTENSIONS = ['xlsx', 'xls'];
const JSON_FILE_EXTENSIONS = ['json'];
const OTHER_VERSION_OPTION = 'Other';
Expand Down
6 changes: 6 additions & 0 deletions hedweb/templates/js/events-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function setEventsTable() {
function setOptions() {
let selectedElement = document.getElementById("process_actions");
if (selectedElement.value === "validate") {
hideOption("append_assembled");
showOption("check_for_warnings");
hideOption("expand_defs");
hideOption("include_context");
Expand All @@ -117,6 +118,7 @@ function setOptions() {
$("#sidecar_input_section").show();
$("#show_events_section").show();
} else if (selectedElement.value === "assemble") {
showOption("append_assembled", true);
hideOption("check_for_warnings");
hideOption("expand_defs");
showOption("include_context", true);
Expand All @@ -131,6 +133,7 @@ function setOptions() {
$("#sidecar_input_section").show();
$("#show_events_section").show();
} else if (selectedElement.value === "generate_sidecar") {
hideOption("append_assembled");
hideOption("check_for_warnings");
hideOption("expand_defs");
hideOption("include_context");
Expand All @@ -145,6 +148,7 @@ function setOptions() {
$("#sidecar_input_section").hide();
$("#show_events_section").show();
} else if (selectedElement.value === "remodel") {
hideOption("append_assembled");
hideOption("check_for_warnings");
hideOption("expand_defs");
hideOption("include_context");
Expand All @@ -159,6 +163,8 @@ function setOptions() {
$("#sidecar_input_section").show();
$("#show_events_section").show();
} else if (selectedElement.value === "search") {
showOption("append_assembled", true);
hideOption("append_assembled");
hideOption("check_for_warnings");
hideOption("expand_defs");
showOption("include_context", true);
Expand Down
32 changes: 19 additions & 13 deletions hedweb/templates/options.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
{% macro create_options(check_for_warnings=False,expand_defs=False,include_context=False,
{% macro create_options(append_assembled=False,check_for_warnings=False,expand_defs=False,include_context=False,
include_description_tags=False,include_summaries=False,replace_defs=False,remove_types_on=False) %}
<fieldset id="options_section">
<legend>Options:</legend>
<div class="form-group" id="options">
{% if append_assembled %}
<span class="form-check form-switch" id="append_assembled_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="append_assembled" id="append_assembled">
<label class="form-check-label" for="append_assembled">Append assembled</label>
</span> &nbsp;&nbsp;
{% endif %}
{% if check_for_warnings %}
<span class="form-check form-switch" id="check_for_warnings_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="check_for_warnings" id="check_for_warnings">
<label class="form-check-label" for="check_for_warnings">Check for warnings</label>
</span> &nbsp; &nbsp;
<label class="form-check-label" for="check_for_warnings">Check warnings</label>
</span> &nbsp;&nbsp;
{% endif %}
{% if expand_defs %}
<span class="form-check form-switch" id="expand_defs_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="expand_defs" id="expand_defs">
<label class="form-check-label" for="expand_defs">Expand Def tags</label>
</span> &nbsp; &nbsp;
<label class="form-check-label" for="expand_defs">Expand defs</label>
</span> &nbsp;&nbsp;
{% endif %}
{% if include_context %}
<span class="form-check form-switch" id="include_context_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="include_context" id="include_context">
<label class="form-check-label" for="include_context">Include event context</label>
</span> &nbsp; &nbsp;
<label class="form-check-label" for="include_context">Include context</label>
</span> &nbsp;&nbsp;
{% endif %}
{% if include_description_tags %}
<span class="form-check form-switch" id="include_description_tags_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="include_description_tags" id="include_description_tags">
<label class="form-check-label" for="include_description_tags">Include Description tags</label>
</span> &nbsp; &nbsp;
<label class="form-check-label" for="include_description_tags">Include description</label>
</span> &nbsp;&nbsp;
{% endif %}
{% if include_summaries %}
<span class="form-check form-switch" id="include_summaries_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="include_summaries" id="include_summaries">
<label class="form-check-label" for="include_summaries">Include summaries</label>
</span> &nbsp; &nbsp;
</span> &nbsp;&nbsp;
{% endif %}
{% if replace_defs %}
<span class="form-check form-switch" id="replace_defs_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="replace_defs" id="replace_defs">
<label class="form-check-label" for="replace_defs">Replace Def tags</label>
</span> &nbsp; &nbsp;
<label class="form-check-label" for="replace_defs">Replace defs</label>
</span> &nbsp;&nbsp;
{% endif %}
{% if remove_types_on %}
<span class="form-check form-switch" id="remove_types_on_option" style="display: inline-block;">
<input class="form-check-input" type="checkbox" name="remove_types_on" id="remove_types_on">
<label class="form-check-label" for="remove_types_on">Remove Condition-variable and Task tags</label>
<label class="form-check-label" for="remove_types_on">Remove condition and task</label>
</span>
{% endif %}
</div>
Expand Down

0 comments on commit b907e34

Please sign in to comment.