Skip to content

Commit 760af82

Browse files
committed
logger.warn -> logger.warning (former is now deprecated)
1 parent c796414 commit 760af82

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

atomate/qchem/drones.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def validate_doc(self, d):
324324
for k, v in self.schema.items():
325325
diff = v.difference(set(d.get(k, d).keys()))
326326
if diff:
327-
logger.warn("The keys {0} in {1} not set".format(diff, k))
327+
logger.warning("The keys {0} in {1} not set".format(diff, k))
328328

329329
@staticmethod
330330
def get_valid_paths(self, path):

atomate/utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def get_database(config_file=None, settings=None, admin=False, **kwargs):
344344
passwd = d["admin_password"] if admin else d["readonly_password"]
345345
db.authenticate(user, passwd)
346346
except (KeyError, TypeError, ValueError):
347-
logger.warn("No {admin,readonly}_user/password found in config. file, "
347+
logger.warning("No {admin,readonly}_user/password found in config. file, "
348348
"accessing DB without authentication")
349349
return db
350350

atomate/vasp/builders/file_materials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def run(self):
6767
logger.info("FileMaterials Builder finished processing")
6868

6969
def reset(self):
70-
logger.warn("Cannot reset FileMaterials Builder!")
70+
logger.warning("Cannot reset FileMaterials Builder!")
7171

7272
@classmethod
7373
def from_file(cls, db_file, data_file=None, m="materials", **kwargs):

atomate/vasp/builders/fix_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def run(self):
5757
logger.info("FixTasksBuilder finished.")
5858

5959
def reset(self):
60-
logger.warn("Cannot reset FixTasksBuilder!")
60+
logger.warning("Cannot reset FixTasksBuilder!")
6161

6262
@classmethod
6363
def from_file(cls, db_file, t="tasks", **kwargs):

atomate/vasp/builders/tasks_materials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def from_file(cls, db_file, m="materials", c="counter", t="tasks", **kwargs):
134134
db_read = get_database(db_file, admin=False)
135135
db_read.collection_names() # throw error if auth failed
136136
except:
137-
logger.warn("Warning: could not get read-only database; using write creds")
137+
logger.warning("Warning: could not get read-only database; using write creds")
138138
db_read = get_database(db_file, admin=True)
139139
return cls(db_write[m], db_write[c], db_read[t], **kwargs)
140140

atomate/vasp/drones.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def validate_doc(self, d):
635635
else:
636636
diff = v.difference(set(d.get(k, d).keys()))
637637
if diff:
638-
logger.warn("The keys {0} in {1} not set".format(diff, k))
638+
logger.warning("The keys {0} in {1} not set".format(diff, k))
639639

640640
def get_valid_paths(self, path):
641641
"""

atomate/vasp/firetasks/neb_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def _get_images_by_linear_interp(self, nimages, ep0, ep1):
348348
images = ep0.interpolate(ep1, nimages=nimages + 1, autosort_tol=sort_tol)
349349
except Exception as e:
350350
if "Unable to reliably match structures " in str(e):
351-
logger.warn("Auto sorting is turned off because it is unable to match the "
351+
logger.warning("Auto sorting is turned off because it is unable to match the "
352352
"end-point structures!")
353353
images = ep0.interpolate(ep1, nimages=nimages + 1, autosort_tol=0)
354354
else:

atomate/vasp/firetasks/parse_outputs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def run_task(self, fw_spec):
143143
if has(task_doc, path_in_task_doc):
144144
update_spec[key] = get(task_doc, path_in_task_doc)
145145
else:
146-
logger.warn("Could not find {} in task document. Unable to push to next firetask/firework".format(path_in_task_doc))
146+
logger.warning("Could not find {} in task document. Unable to push to next firetask/firework".format(path_in_task_doc))
147147
else:
148148
raise RuntimeError("Inappropriate type {} for task_fields_to_push. It must be a "
149149
"dictionary of format: {key: path} where key refers to a field "
@@ -443,7 +443,7 @@ def run_task(self, fw_spec):
443443
# frequency in cm^-1
444444
omega = nm_frequencies[k]
445445
if nm_eigenvals[k] > 0:
446-
logger.warn("Mode: {} is UNSTABLE. Freq(cm^-1) = {}".format(k, -omega))
446+
logger.warning("Mode: {} is UNSTABLE. Freq(cm^-1) = {}".format(k, -omega))
447447
raman_tensor = scale * raman_tensor * np.sum(nm_norms[k]) / np.sqrt(omega)
448448
raman_tensor_dict[str(k)] = raman_tensor.tolist()
449449

@@ -575,7 +575,7 @@ def run_task(self, fw_spec):
575575
except:
576576
import traceback
577577

578-
logger.warn("Quasi-harmonic analysis failed!")
578+
logger.warning("Quasi-harmonic analysis failed!")
579579
gibbs_dict["success"] = False
580580
gibbs_dict["traceback"] = traceback.format_exc()
581581
gibbs_dict['metadata'].update({"task_label_tag": tag})
@@ -799,7 +799,7 @@ def run_task(self, fw_spec):
799799
idx = energies.index(ground_state_energy)
800800
ground_state_task_id = docs[idx]["task_id"]
801801
if energies.count(ground_state_energy) > 1:
802-
logger.warn("Multiple identical energies exist, "
802+
logger.warning("Multiple identical energies exist, "
803803
"duplicate calculations for {}?".format(formula))
804804

805805
# get results for different orderings

atomate/vasp/workflows/base/thermal_expansion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_wf_thermal_expansion(structure, deformations, vasp_input_set=None, vasp_
5454
try:
5555
from phonopy import Phonopy
5656
except ImportError:
57-
logger.warn("'phonopy' package NOT installed. Required for the final analysis step.")
57+
logger.warning("'phonopy' package NOT installed. Required for the final analysis step.")
5858

5959
tag = tag or "thermal_expansion group: >>{}<<".format(str(uuid4()))
6060

0 commit comments

Comments
 (0)