Skip to content

Commit

Permalink
properly deprecate ScanMetalHandler using monty.dev.deprecated decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Feb 15, 2024
1 parent ce09fb2 commit 130a9be
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from math import prod

import numpy as np
from monty.dev import deprecated
from monty.io import zopen
from monty.os.path import zpath
from monty.serialization import loadfn
Expand Down Expand Up @@ -1250,12 +1251,24 @@ def correct(self):
return {"errors": ["ScanMetal"], "actions": actions}


@deprecated(
KspacingMetalHandler,
"ScanMetalHandler was deprecated on 2023-11-03 and will be removed in a future release. "
"Use KspacingMetalHandler instead.",
)
class ScanMetalHandler(KspacingMetalHandler):
"""ScanMetalHandler was renamed because MP GGA workflow might also adopt kspacing
in the future. Keeping this alias during a deprecation period for backwards compatibility.
"""

def __init__(self, *args, **kwargs) -> None:
"""
Initializes the handler with the output file to check.
Args:
args: Positional arguments passed to parent class.
kwargs: Keyword passed to parent class.
"""
warnings.warn(
"ScanMetalHandler is deprecated and will be removed in a future release. "
"Use KspacingMetalHandler instead.",
Expand Down

0 comments on commit 130a9be

Please sign in to comment.