From f8bd230fe8166016866b08c0f9c933f5359115c4 Mon Sep 17 00:00:00 2001 From: Minotakm Date: Mon, 28 Oct 2024 11:24:59 +0100 Subject: [PATCH 1/3] Udjusted the documentation regarding the creating of a pseudo family, to probably the latest version. --- docs/source/design.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/design.rst b/docs/source/design.rst index f3a26df..aa6268e 100644 --- a/docs/source/design.rst +++ b/docs/source/design.rst @@ -71,17 +71,17 @@ A pseudopotential family can be constructed manually, by first constructing the from aiida import plugins UpfData = plugins.DataFactory('pseudo.upf') - PseudoPotentialFamily = plugins.GroupFactory('pseudo') + PseudoPotentialFamily = plugins.GroupFactory(entry_point_name='pseudo.family') pseudos = [] for filepath in ['Ga.upf', 'As.upf']: with open(filepath, 'rb') as stream: - pseudo = UpfData(stream) - pseudos.append(pseudo) + pseudo = UpfData(file=stream) + pseudos.append(pseudo.store()) family = PseudoPotentialFamily(label='pseudos/upf').store() - family.append(pseudos) + family.add_nodes(pseudos) Note that as with any :py:class:`~aiida.orm.Group`, it has to be stored before nodes can be added. If you have a folder on disk that contains various pseudopotentials for different elements, there is an even easier way to create the family automatically: From 4d832d5b78a7614abc6135a521ab16f010bc35cb Mon Sep 17 00:00:00 2001 From: Michail Minotakis Date: Mon, 28 Oct 2024 20:46:24 +0100 Subject: [PATCH 2/3] Update docs/source/design.rst Co-authored-by: Sebastiaan Huber --- docs/source/design.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/design.rst b/docs/source/design.rst index aa6268e..8e4ca63 100644 --- a/docs/source/design.rst +++ b/docs/source/design.rst @@ -71,7 +71,7 @@ A pseudopotential family can be constructed manually, by first constructing the from aiida import plugins UpfData = plugins.DataFactory('pseudo.upf') - PseudoPotentialFamily = plugins.GroupFactory(entry_point_name='pseudo.family') + PseudoPotentialFamily = plugins.GroupFactory('pseudo.family') pseudos = [] From dc47078baee3885a8c3da1b8973ebd5268002e91 Mon Sep 17 00:00:00 2001 From: Minotakm Date: Mon, 28 Oct 2024 23:43:11 +0100 Subject: [PATCH 3/3] Udjusted the example to the feedback --- docs/source/design.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/design.rst b/docs/source/design.rst index 8e4ca63..65712e2 100644 --- a/docs/source/design.rst +++ b/docs/source/design.rst @@ -77,7 +77,7 @@ A pseudopotential family can be constructed manually, by first constructing the for filepath in ['Ga.upf', 'As.upf']: with open(filepath, 'rb') as stream: - pseudo = UpfData(file=stream) + pseudo = UpfData(stream) pseudos.append(pseudo.store()) family = PseudoPotentialFamily(label='pseudos/upf').store()