Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 4, 2023
1 parent f480c1c commit 96f876d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion HMFcalc/form_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def get_initial(self, val):
return """[ """ + self.minimum + """,""" + self.maximum + """ ]"""

def render(self, name, value, attrs=None, renderer=None):

s = super(RangeSlider, self).render(name, value, attrs)
elem_id = re.findall(r'id_([A-Za-z0-9_\./\\-]*)"', s)[0]
val = self.get_initial(value)
Expand Down
18 changes: 14 additions & 4 deletions HMFcalc/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,22 @@ class TransferForm(HMFModelForm):
("CAMB", "CAMB"),
("EH_BAO", "Eisenstein-Hu (1998) (with BAO)"),
("EH_NoBAO", "Eisenstein-Hu (1998) (no BAO)"),
("BBKS", "BBKS (1986)",),
(
"BBKS",
"BBKS (1986)",
),
("BondEfs", "Bond-Efstathiou"),
]
_initial = "CAMB"
module = transfer_models
ignore_fields = ["camb_params"]

field_kwargs = {"fname": {"type": forms.FileField, "label": "",}}
field_kwargs = {
"fname": {
"type": forms.FileField,
"label": "",
}
}

def clean_transfer_fname(self):
thefile = self.cleaned_data.get("transfer_fname", None)
Expand Down Expand Up @@ -124,7 +132,10 @@ class TransferFramework(HMFFramework):
)

dlnk = forms.FloatField(
label="lnk Step Size", initial=0.05, min_value=0.005, max_value=0.5,
label="lnk Step Size",
initial=0.05,
min_value=0.005,
max_value=0.5,
)

takahashi = forms.BooleanField(
Expand Down Expand Up @@ -257,7 +268,6 @@ class HMFInput(CompositeForm):
def __init__(
self, model_label=None, current_models=None, edit=False, *args, **kwargs
):

self.current_models = current_models
self.derivative_model_label = model_label
if current_models:
Expand Down
2 changes: 0 additions & 2 deletions HMFcalc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def cleaned_data_to_hmf_dict(self, form):

# Define what to do if the form is valid.
def form_valid(self, form):

label = form.cleaned_data["label"]

cls, hmf_dict = self.cleaned_data_to_hmf_dict(form)
Expand Down Expand Up @@ -185,7 +184,6 @@ def form_valid(self, form):

def delete_plot(request, label):
if len(request.session["objects"]) > 1:

try:
del request.session["objects"][label]
except KeyError:
Expand Down

0 comments on commit 96f876d

Please sign in to comment.