Skip to content

Commit

Permalink
pre-commit code checks
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolbhatia05 committed Jul 27, 2024
1 parent 6e3a0ca commit b596469
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyparamgui/static/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ message {
transition: opacity 0.5s ease;
opacity: 0;
color: black;
}
}
11 changes: 8 additions & 3 deletions pyparamgui/static/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ function createTextFormGroup(labelText, inputId, inputName, inputValue) {
*
* @returns {HTMLDivElement} The form group element containing the label and checkbox input.
*/
function createCheckboxFormGroup(labelText, inputId, inputName, inputChecked = false) {
function createCheckboxFormGroup(
labelText,
inputId,
inputName,
inputChecked = false,
) {
const formGroup = document.createElement("div");
formGroup.className = "form-group";

Expand Down Expand Up @@ -201,7 +206,7 @@ function displaySimulationMessage(parentElement) {
parentElement.removeChild(message);
}, 500);
}, 2000);
};
}

/**
* Entrypoint for frontend rendering called by Python backend based on anywidget.
Expand Down Expand Up @@ -435,4 +440,4 @@ function render({ model, el }) {
el.appendChild(btn);
}

export default { render };
export default { render };
8 changes: 4 additions & 4 deletions pyparamgui/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self):
self.observe(handler=_simulate, names=["simulate"])


def _simulate(change) -> None:
def _simulate(change: dict) -> None:
"""Generate simulation files based on (global) widget (`_widget`) inputs.
This private callback function creates model, parameter, and data files
Expand Down Expand Up @@ -122,10 +122,10 @@ def _simulate(change) -> None:
)
if widget_instance.visualize_data:
irf_location = (
None if not simulation_config.settings.add_gaussian_irf
None
if not simulation_config.settings.add_gaussian_irf
else simulation_config.irf.center
)
plot_data_overview(
dataset=load_dataset(widget_instance.data_file_name_input),
irf_location=irf_location
dataset=load_dataset(widget_instance.data_file_name_input), irf_location=irf_location
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
"anywidget==0.9.13",
"pydantic==2.8.2",
"pyglotaran==0.7.2",
"pyglotaran_extras==0.7.2",
"pyglotaran-extras==0.7.2",
"pyyaml==6.0.1",
]
optional-dependencies.dev = [
Expand Down

0 comments on commit b596469

Please sign in to comment.