Skip to content

Commit

Permalink
logger.warn -> logger.warning (former is now deprecated)
Browse files Browse the repository at this point in the history
  • Loading branch information
computron committed May 10, 2019
1 parent c796414 commit 760af82
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion atomate/qchem/drones.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def validate_doc(self, d):
for k, v in self.schema.items():
diff = v.difference(set(d.get(k, d).keys()))
if diff:
logger.warn("The keys {0} in {1} not set".format(diff, k))
logger.warning("The keys {0} in {1} not set".format(diff, k))

@staticmethod
def get_valid_paths(self, path):
Expand Down
2 changes: 1 addition & 1 deletion atomate/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def get_database(config_file=None, settings=None, admin=False, **kwargs):
passwd = d["admin_password"] if admin else d["readonly_password"]
db.authenticate(user, passwd)
except (KeyError, TypeError, ValueError):
logger.warn("No {admin,readonly}_user/password found in config. file, "
logger.warning("No {admin,readonly}_user/password found in config. file, "
"accessing DB without authentication")
return db

Expand Down
2 changes: 1 addition & 1 deletion atomate/vasp/builders/file_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def run(self):
logger.info("FileMaterials Builder finished processing")

def reset(self):
logger.warn("Cannot reset FileMaterials Builder!")
logger.warning("Cannot reset FileMaterials Builder!")

@classmethod
def from_file(cls, db_file, data_file=None, m="materials", **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion atomate/vasp/builders/fix_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run(self):
logger.info("FixTasksBuilder finished.")

def reset(self):
logger.warn("Cannot reset FixTasksBuilder!")
logger.warning("Cannot reset FixTasksBuilder!")

@classmethod
def from_file(cls, db_file, t="tasks", **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion atomate/vasp/builders/tasks_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def from_file(cls, db_file, m="materials", c="counter", t="tasks", **kwargs):
db_read = get_database(db_file, admin=False)
db_read.collection_names() # throw error if auth failed
except:
logger.warn("Warning: could not get read-only database; using write creds")
logger.warning("Warning: could not get read-only database; using write creds")
db_read = get_database(db_file, admin=True)
return cls(db_write[m], db_write[c], db_read[t], **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion atomate/vasp/drones.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def validate_doc(self, d):
else:
diff = v.difference(set(d.get(k, d).keys()))
if diff:
logger.warn("The keys {0} in {1} not set".format(diff, k))
logger.warning("The keys {0} in {1} not set".format(diff, k))

def get_valid_paths(self, path):
"""
Expand Down
2 changes: 1 addition & 1 deletion atomate/vasp/firetasks/neb_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def _get_images_by_linear_interp(self, nimages, ep0, ep1):
images = ep0.interpolate(ep1, nimages=nimages + 1, autosort_tol=sort_tol)
except Exception as e:
if "Unable to reliably match structures " in str(e):
logger.warn("Auto sorting is turned off because it is unable to match the "
logger.warning("Auto sorting is turned off because it is unable to match the "
"end-point structures!")
images = ep0.interpolate(ep1, nimages=nimages + 1, autosort_tol=0)
else:
Expand Down
8 changes: 4 additions & 4 deletions atomate/vasp/firetasks/parse_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def run_task(self, fw_spec):
if has(task_doc, path_in_task_doc):
update_spec[key] = get(task_doc, path_in_task_doc)
else:
logger.warn("Could not find {} in task document. Unable to push to next firetask/firework".format(path_in_task_doc))
logger.warning("Could not find {} in task document. Unable to push to next firetask/firework".format(path_in_task_doc))
else:
raise RuntimeError("Inappropriate type {} for task_fields_to_push. It must be a "
"dictionary of format: {key: path} where key refers to a field "
Expand Down Expand Up @@ -443,7 +443,7 @@ def run_task(self, fw_spec):
# frequency in cm^-1
omega = nm_frequencies[k]
if nm_eigenvals[k] > 0:
logger.warn("Mode: {} is UNSTABLE. Freq(cm^-1) = {}".format(k, -omega))
logger.warning("Mode: {} is UNSTABLE. Freq(cm^-1) = {}".format(k, -omega))
raman_tensor = scale * raman_tensor * np.sum(nm_norms[k]) / np.sqrt(omega)
raman_tensor_dict[str(k)] = raman_tensor.tolist()

Expand Down Expand Up @@ -575,7 +575,7 @@ def run_task(self, fw_spec):
except:
import traceback

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

# get results for different orderings
Expand Down
2 changes: 1 addition & 1 deletion atomate/vasp/workflows/base/thermal_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_wf_thermal_expansion(structure, deformations, vasp_input_set=None, vasp_
try:
from phonopy import Phonopy
except ImportError:
logger.warn("'phonopy' package NOT installed. Required for the final analysis step.")
logger.warning("'phonopy' package NOT installed. Required for the final analysis step.")

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

Expand Down

0 comments on commit 760af82

Please sign in to comment.