Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion gufe/ligandnetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ def to_rbfe_alchemical_network(
) -> gufe.AlchemicalNetwork:
"""Create an :class:`.AlchemicalNetwork` from this :class:`.LigandNetwork`.

.. version-deprecated:: 1.8.0
This function is deprecated and will be removed in version 1.13.0.

Parameters
----------
protocol: Protocol
Expand All @@ -333,8 +336,9 @@ def to_rbfe_alchemical_network(
"""

warnings.warn(
("to_rbfe_alchemical_network() is deprecated and will be removed in version 2.0."),
("to_rbfe_alchemical_network() is deprecated and will be removed in version 1.13.0."),
DeprecationWarning,
stacklevel=2,
)
components = {"protein": protein, "solvent": solvent, **other_components}
leg_labels = {
Expand Down
2 changes: 2 additions & 0 deletions gufe/protocols/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def create(
warnings.warn(
("mapping input as a dict is deprecated, instead use either a single Mapping or list"),
DeprecationWarning,
stacklevel=2,
)
mapping = list(mapping.values())

Expand Down Expand Up @@ -364,6 +365,7 @@ def validate(
warnings.warn(
"mapping input as a dict is deprecated, instead use either a single Mapping or list",
DeprecationWarning,
stacklevel=2,
)
mapping = list(mapping.values())

Expand Down
4 changes: 2 additions & 2 deletions gufe/tests/test_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ def test_equality(self, absolute_transformation, solvated_ligand, solvated_compl

def test_dump_load_roundtrip(self, absolute_transformation):
string = io.StringIO()
with pytest.warns(DeprecationWarning, match="use of this method is deprecated; instead use `to_json`"):
with pytest.warns(DeprecationWarning, match="to_json"):
absolute_transformation.dump(string)
string.seek(0)
with pytest.warns(DeprecationWarning, match="use of this method is deprecated; instead use `from_json`"):
with pytest.warns(DeprecationWarning, match="from_json"):
recreated = Transformation.load(string)
assert absolute_transformation == recreated

Expand Down
13 changes: 11 additions & 2 deletions gufe/transformations/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,18 @@ def dump(self, file):
which is used in both ``ChemicalSystem`` objects will be represented
twice in the JSON output.

version-deprecated :: 1.3.0
`.dump()` is deprecated. Use `.to_json() instead`.

Parameters
----------
file : Union[PathLike, FileLike]
A pathlike of filelike to save this transformation to.
"""
warnings.warn(
("use of this method is deprecated; instead use `to_json`"),
("`.dump()` is deprecated as of gufe v1.3.0; Use `.to_json()` instead."),
DeprecationWarning,
stacklevel=2,
)
with ensure_filelike(file, mode="w") as f:
json.dump(self.to_dict(), f, cls=JSON_HANDLER.encoder, sort_keys=True)
Expand All @@ -131,14 +135,18 @@ def dump(self, file):
def load(cls, file):
"""Create a Transformation from a JSON file.

version-deprecated :: 1.3.0
`.load()` is deprecated. Use `.from_json() instead`.

Parameters
----------
file : Union[PathLike, FileLike]
A pathlike or filelike to read this transformation from.
"""
warnings.warn(
("use of this method is deprecated; instead use `from_json`"),
("`.load()` is deprecated as of gufe v1.3.0; Use `.from_json()` instead."),
DeprecationWarning,
stacklevel=2,
)
with ensure_filelike(file, mode="r") as f:
dct = json.load(f, cls=JSON_HANDLER.decoder)
Expand Down Expand Up @@ -195,6 +203,7 @@ def __init__(
warnings.warn(
("mapping input as a dict is deprecated; instead use either a single Mapping or list"),
DeprecationWarning,
stacklevel=2,
)
mapping = list(mapping.values())

Expand Down
23 changes: 23 additions & 0 deletions news/update_to_rbfe_deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* ``LigandNetwork.to_rbfe_alchemical_network()`` has been deprecated and will be removed in gufe v1.13.0 (`PR #793 <https://github.com/OpenFreeEnergy/gufe/pull/793>`_).

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
Loading