File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1801,21 +1801,40 @@ def get_network_archives(
18011801
18021802 return archives
18031803
1804- def get_network_archive (self , network : ScopedKey ) -> AlchemicalArchive | None :
1804+ def get_network_archive (self , network : ScopedKey , metadata : dict | None = None ) -> AlchemicalArchive | None :
18051805 """Get the archive for a given ``AlchemicalNetwork``.
18061806
18071807 Parameters
18081808 ----------
18091809 network
18101810 The ``AlchemicalNetwork`` to archive.
1811+ metadata
1812+ Metadata to attach to the ``AlchemicalArchive``. This must
1813+ be a dictionary that is compatible with
1814+ ``GufeTokenizable`` serialization.
18111815
18121816 Returns
18131817 -------
18141818 An ``AlchemicalArchive`` for the provided
18151819 ``AlchemicalNetwork``. If the ntwork was not found, ``None``
18161820 is returned.
1821+
1822+ Raises
1823+ ------
1824+ A ``ValueError`` is raised if the provided metadata is not
1825+ serializable.
18171826 """
1818- return self .get_network_archives ([network ])[0 ]
1827+ match metadata :
1828+ case {}:
1829+ metadata = None
1830+ case dict ():
1831+ metadata = [metadata ]
1832+ case None :
1833+ pass
1834+ case _:
1835+ raise ValueError ("metadata must be a dictionary or None" )
1836+
1837+ return self .get_network_archives ([network ], metadata )[0 ]
18191838
18201839 def get_transformation_results (
18211840 self ,
You can’t perform that action at this time.
0 commit comments