Commit bd31c1de authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Use f-strings in pcigale-filters rather than regular string as they are easier to read.

parent 9b3ab44c
...@@ -62,8 +62,8 @@ def add_filters(fnames): ...@@ -62,8 +62,8 @@ def add_filters(fnames):
raise ValueError("Filter transmission type can only be " raise ValueError("Filter transmission type can only be "
"'energy' or 'photon'.") "'energy' or 'photon'.")
print("Importing {}... ({} points)".format(filter_name, print(f"Importing {filter_name}... "
filter_table.shape[1])) f"({filter_table.shape[1]} points)")
new_filter = Filter(filter_name, filter_description, filter_table) new_filter = Filter(filter_name, filter_description, filter_table)
...@@ -89,9 +89,9 @@ def del_filters(fnames): ...@@ -89,9 +89,9 @@ def del_filters(fnames):
for fname in fnames: for fname in fnames:
if fname in names: if fname in names:
base.del_filter(fname) base.del_filter(fname)
print("Removing filter {}".format(fname)) print(f"Removing filter {fname}")
else: else:
print("Filter {} not in the database".format(fname)) print("Filter {fname} not in the database")
def worker_plot(fname): def worker_plot(fname):
...@@ -110,9 +110,9 @@ def worker_plot(fname): ...@@ -110,9 +110,9 @@ def worker_plot(fname):
plt.minorticks_on() plt.minorticks_on()
plt.xlabel('Wavelength [nm]') plt.xlabel('Wavelength [nm]')
plt.ylabel('Relative transmission') plt.ylabel('Relative transmission')
plt.title("{} filter".format(fname)) plt.title(f"{fname} filter")
plt.tight_layout() plt.tight_layout()
plt.savefig("{}.pdf".format(fname)) plt.savefig(f"{fname}.pdf")
def plot_filters(fnames): def plot_filters(fnames):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment