From 4c37db6ae45bfbab1a5833838164f89df58d9fc7 Mon Sep 17 00:00:00 2001 From: Matthew Horton Date: Mon, 7 Oct 2024 08:32:20 -0700 Subject: [PATCH 1/3] Allow `TaskDoc.tags` to be `None` The schema allows `tags` to be `None` but the materials builder will fail if tags are not specified. --- emmet-builders/emmet/builders/vasp/materials.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emmet-builders/emmet/builders/vasp/materials.py b/emmet-builders/emmet/builders/vasp/materials.py index a518faa502..33fb6621c6 100644 --- a/emmet-builders/emmet/builders/vasp/materials.py +++ b/emmet-builders/emmet/builders/vasp/materials.py @@ -238,9 +238,11 @@ def process_item(self, items: List[Dict]) -> List[Dict]: grouped_tasks = self.filter_and_group_tasks(tasks, task_transformations) materials = [] for group in grouped_tasks: + # commercial_license = True means that the default CC-BY license is applied + # commercial_license = True means that a CC-BY-NC license is applied commercial_license = True for task_doc in group: - if set(task_doc.tags).intersection( + if task_dog.tags and set(task_doc.tags).intersection( set(self.settings.NON_COMMERCIAL_TAGS) ): commercial_license = False From d6ca35f9b1f31670ce568797455a55721a0ac8bc Mon Sep 17 00:00:00 2001 From: Matthew Horton Date: Mon, 7 Oct 2024 08:35:27 -0700 Subject: [PATCH 2/3] Fixup for typo --- emmet-builders/emmet/builders/vasp/materials.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emmet-builders/emmet/builders/vasp/materials.py b/emmet-builders/emmet/builders/vasp/materials.py index 33fb6621c6..554153b5c8 100644 --- a/emmet-builders/emmet/builders/vasp/materials.py +++ b/emmet-builders/emmet/builders/vasp/materials.py @@ -238,8 +238,8 @@ def process_item(self, items: List[Dict]) -> List[Dict]: grouped_tasks = self.filter_and_group_tasks(tasks, task_transformations) materials = [] for group in grouped_tasks: - # commercial_license = True means that the default CC-BY license is applied - # commercial_license = True means that a CC-BY-NC license is applied + # commercial_license == True means that the default CC-BY license is applied + # commercial_license == False means that a CC-BY-NC license is applied commercial_license = True for task_doc in group: if task_dog.tags and set(task_doc.tags).intersection( From e4f95ed25c0a219b370d0fd9c55b13696cef97ab Mon Sep 17 00:00:00 2001 From: Matthew Horton Date: Mon, 7 Oct 2024 08:39:49 -0700 Subject: [PATCH 3/3] Fixup for typo --- emmet-builders/emmet/builders/vasp/materials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emmet-builders/emmet/builders/vasp/materials.py b/emmet-builders/emmet/builders/vasp/materials.py index 554153b5c8..8b7dc6669b 100644 --- a/emmet-builders/emmet/builders/vasp/materials.py +++ b/emmet-builders/emmet/builders/vasp/materials.py @@ -242,7 +242,7 @@ def process_item(self, items: List[Dict]) -> List[Dict]: # commercial_license == False means that a CC-BY-NC license is applied commercial_license = True for task_doc in group: - if task_dog.tags and set(task_doc.tags).intersection( + if task_doc.tags and set(task_doc.tags).intersection( set(self.settings.NON_COMMERCIAL_TAGS) ): commercial_license = False