Skip to content

Commit 0045592

Browse files
committed
Format with ruff
1 parent a8ce331 commit 0045592

File tree

7 files changed

+17
-23
lines changed

7 files changed

+17
-23
lines changed

qudi_hira_analysis/_fitmethods/decaylikemethods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def barestretchedexponentialdecay_function(x, beta, lifetime):
7070

7171
if not isinstance(prefix, str) and prefix is not None:
7272
self.log.error(
73-
"The passed prefix <{}> of type {} is not a string and"
73+
f"The passed prefix <{prefix}> of type {type(prefix)} is not a string and"
7474
"cannot be used as a prefix and will be ignored for now."
75-
"Correct that!".format(prefix, type(prefix))
75+
"Correct that!"
7676
)
7777
model = Model(barestretchedexponentialdecay_function, independent_vars=["x"])
7878
else:

qudi_hira_analysis/_fitmethods/gaussianlikemethods.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def physical_gauss(x, center, sigma):
7474

7575
if not isinstance(prefix, str) and prefix is not None:
7676
self.log.error(
77-
"The passed prefix <{}> of type {} is not a string and"
77+
f"The passed prefix <{prefix}> of type {type(prefix)} is not a string and"
7878
"cannot be used as a prefix and will be ignored for now."
79-
"Correct that!".format(prefix, type(prefix))
79+
"Correct that!"
8080
)
8181
gaussian_model = Model(physical_gauss, independent_vars=["x"])
8282
else:
@@ -299,9 +299,9 @@ def twoDgaussian_function(
299299

300300
if not isinstance(prefix, str) and prefix is not None:
301301
self.log.error(
302-
"The passed prefix <{}> of type {} is not a string and"
302+
f"The passed prefix <{prefix}> of type {type(prefix)} is not a string and"
303303
"cannot be used as a prefix and will be ignored for now."
304-
"Correct that!".format(prefix, type(prefix))
304+
"Correct that!"
305305
)
306306
gaussian_2d_model = Model(twoDgaussian_function, independent_vars=["x"])
307307
else:

qudi_hira_analysis/_fitmethods/generalmethods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ def _substitute_params(self, initial_params, update_params=None):
127127

128128
else:
129129
self.log.error(
130-
"The type of the passed update_params object <{}> is "
130+
f"The type of the passed update_params object <{type(update_params)}> is "
131131
"neither of type lmfit.parameter.Parameters, "
132132
"OrderedDict or dict! Correct that, the initial_params"
133-
"will be returned.".format(type(update_params))
133+
"will be returned."
134134
)
135135

136136
return initial_params

qudi_hira_analysis/_fitmethods/hyperbolicsaturationmethods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def hyperbolicsaturation_function(x, I_sat, P_sat):
6262

6363
if not isinstance(prefix, str) and prefix is not None:
6464
self.log.error(
65-
"The passed prefix <{}> of type {} is not a string and"
65+
f"The passed prefix <{prefix}> of type {type(prefix)} is not a string and"
6666
"cannot be used as a prefix and will be ignored for now."
67-
"Correct that!".format(prefix, type(prefix))
67+
"Correct that!"
6868
)
6969

7070
mod_sat = Model(hyperbolicsaturation_function, independent_vars=["x"])

qudi_hira_analysis/_fitmethods/poissonianlikemethods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ def poisson_function(x, mu):
104104

105105
if not isinstance(prefix, str) and prefix is not None:
106106
self.log.error(
107-
"The passed prefix <{}> of type {} is not a string and"
107+
f"The passed prefix <{prefix}> of type {type(prefix)} is not a string and"
108108
"cannot be used as a prefix and will be ignored for now."
109-
"Correct that!".format(prefix, type(prefix))
109+
"Correct that!"
110110
)
111111

112112
poissonian_model = Model(poisson_function, independent_vars=["x"])

qudi_hira_analysis/_fitmethods/sinemethods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ def bare_sine_function(x, frequency, phase):
216216

217217
if not isinstance(prefix, str) and prefix is not None:
218218
self.log.error(
219-
"The passed prefix <{}> of type {} is not a string and"
219+
f"The passed prefix <{prefix}> of type {type(prefix)} is not a string and"
220220
"cannot be used as a prefix and will be ignored for now."
221-
"Correct that!".format(prefix, type(prefix))
221+
"Correct that!"
222222
)
223223
model = Model(bare_sine_function, independent_vars=["x"])
224224
else:

qudi_hira_analysis/_qudi_fit_logic.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ def __init__(self):
6868
self._additional_methods_import_path
6969
]
7070
self.log.info(
71-
"Adding fit methods path: {}".format(
72-
self._additional_methods_import_path
73-
)
71+
f"Adding fit methods path: {self._additional_methods_import_path}"
7472
)
7573

7674
if isinstance(self._additional_methods_import_path, (list, tuple, set)):
@@ -174,9 +172,7 @@ def __init__(self):
174172
)
175173
else:
176174
self.log.error(
177-
'No make_*_model method for fit "{}" found in FitLogic.' "".format(
178-
fit_name
179-
)
175+
f'No make_*_model method for fit "{fit_name}" found in FitLogic.' ""
180176
)
181177

182178
# Attach all estimate_* methods to corresponding fit method in fit_list
@@ -196,9 +192,7 @@ def __init__(self):
196192
found_estimator = True
197193
if not found_estimator:
198194
self.log.error(
199-
'No estimator method for fit "{}" found in FitLogic.' "".format(
200-
fit_name
201-
)
195+
f'No estimator method for fit "{fit_name}" found in FitLogic.' ""
202196
)
203197

204198
# self.log.info('Methods were included to FitLogic, but only if naming is

0 commit comments

Comments
 (0)