Skip to content

Commit

Permalink
Formating changes PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
monk-04 committed Oct 11, 2023
1 parent c759d5e commit 0ee5938
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 149 deletions.
28 changes: 14 additions & 14 deletions tests/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ class TestOptimize:

def test_drop_columns(self,bspline_config_larger_cutoff,Nb_Sn_chemistry, Nb3Sn_geom, config_1):

cutoff_dict = optimize.get_possible_lower_cutoffs(bspline_config_larger_cutoff)
cutoff_dict = optimize.get_lower_cutoffs(bspline_config_larger_cutoff)

for i in range(len(cutoff_dict['rmax_2b_poss'])):
for j in range(len(cutoff_dict['rmax_3b_poss'])):
for i in range(len(cutoff_dict['lower_rmax_2b'])):
for j in range(len(cutoff_dict['lower_rmax_3b'])):
bspline_config_smaller_cutoff = optimize.get_bspline_config(Nb_Sn_chemistry,
rmin_2b=config_1["rmin_2b"],
rmin_3b=config_1["rmin_3b"],
rmax_2b=cutoff_dict['rmax_2b_poss'][i],
rmax_3b=cutoff_dict['rmax_3b_poss'][j],
rmax_2b=cutoff_dict['lower_rmax_2b'][i],
rmax_3b=cutoff_dict['lower_rmax_3b'][j],
knot_spacing_2b=config_1["knot_spacing_2b"],
knot_spacing_3b=config_1["knot_spacing_3b"],
leading_trim=0,
Expand All @@ -106,11 +106,11 @@ def test_drop_columns(self,bspline_config_larger_cutoff,Nb_Sn_chemistry, Nb3Sn_g
bspline_handler_smaller_cutoff = BasisFeaturizer(bspline_config_smaller_cutoff)

columns_to_drop_2b = optimize.get_columns_to_drop_2b(original_bspline_config=bspline_config_larger_cutoff,
modify_2b_cutoff=cutoff_dict['rmax_2b_poss'][i],
modify_2b_cutoff=cutoff_dict['lower_rmax_2b'][i],
knot_spacing_2b=config_1["knot_spacing_2b"])

columns_to_drop_3b = optimize.get_columns_to_drop_3b(original_bspline_config=bspline_config_larger_cutoff,
modify_3b_cutoff=cutoff_dict['rmax_3b_poss'][j],
modify_3b_cutoff=cutoff_dict['lower_rmax_3b'][j],
knot_spacing_3b=config_1["knot_spacing_3b"])

columns_to_drop = columns_to_drop_2b + columns_to_drop_3b
Expand All @@ -128,14 +128,14 @@ def test_drop_columns(self,bspline_config_larger_cutoff,Nb_Sn_chemistry, Nb3Sn_g

def test_drop_columns_2(self,bspline_config_larger_cutoff_2,Nb_Sn_chemistry, Nb3Sn_geom, config_2):

cutoff_dict = optimize.get_possible_lower_cutoffs(bspline_config_larger_cutoff_2)
for i in range(len(cutoff_dict['rmax_2b_poss'])):
for j in range(len(cutoff_dict['rmax_3b_poss'])):
cutoff_dict = optimize.get_lower_cutoffs(bspline_config_larger_cutoff_2)
for i in range(len(cutoff_dict['lower_rmax_2b'])):
for j in range(len(cutoff_dict['lower_rmax_3b'])):
bspline_config_smaller_cutoff = optimize.get_bspline_config(Nb_Sn_chemistry,
rmin_2b=config_2["rmin_2b"],
rmin_3b=config_2["rmin_3b"],
rmax_2b=cutoff_dict['rmax_2b_poss'][i],
rmax_3b=cutoff_dict['rmax_3b_poss'][j],
rmax_2b=cutoff_dict['lower_rmax_2b'][i],
rmax_3b=cutoff_dict['lower_rmax_3b'][j],
knot_spacing_2b=config_2["knot_spacing_2b"],
knot_spacing_3b=config_2["knot_spacing_3b"],
leading_trim=0,
Expand All @@ -146,11 +146,11 @@ def test_drop_columns_2(self,bspline_config_larger_cutoff_2,Nb_Sn_chemistry, Nb3
bspline_handler_smaller_cutoff = BasisFeaturizer(bspline_config_smaller_cutoff)

columns_to_drop_2b = optimize.get_columns_to_drop_2b(original_bspline_config=bspline_config_larger_cutoff_2,
modify_2b_cutoff=cutoff_dict['rmax_2b_poss'][i],
modify_2b_cutoff=cutoff_dict['lower_rmax_2b'][i],
knot_spacing_2b=config_2["knot_spacing_2b"])

columns_to_drop_3b = optimize.get_columns_to_drop_3b(original_bspline_config=bspline_config_larger_cutoff_2,
modify_3b_cutoff=cutoff_dict['rmax_3b_poss'][j],
modify_3b_cutoff=cutoff_dict['lower_rmax_3b'][j],
knot_spacing_3b=config_2["knot_spacing_3b"])

columns_to_drop = columns_to_drop_2b + columns_to_drop_3b
Expand Down
2 changes: 1 addition & 1 deletion uf3/regression/least_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def batched_prediction(model: WeightedLinearModel,
filename: str,
table_names: Collection = None,
subset_keys: Collection = None,
drop_columns: list = None,
drop_columns: List[str] = None,
**kwargs):
"""
Convenience function for optimization workflow. Read inputs/outputs
Expand Down
Loading

0 comments on commit 0ee5938

Please sign in to comment.