From 74efb4a6bc78fdb9f5df3e2798f8a7c6ccd7f03c Mon Sep 17 00:00:00 2001 From: Logan Ward Date: Tue, 10 Oct 2023 06:35:20 -0400 Subject: [PATCH 1/4] Remove placeholder pypi package sklearn is just a placeholder for scikit-learn and not an actual Python package --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 876317ce..8d91f4fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ numpy>=1.14 networkx>=2.1 spglib>=1.10 scipy>=0.1 -sklearn matplotlib>=2.2 future>=0.16 fireworks>=1.7 From ab008b01f19579bd3f157b50c4497c29e3b8a2d7 Mon Sep 17 00:00:00 2001 From: Logan Ward Date: Tue, 10 Oct 2023 06:37:53 -0400 Subject: [PATCH 2/4] MutableMapping has moved to .abc --- catkit/gen/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catkit/gen/__init__.py b/catkit/gen/__init__.py index fd630a43..e3006a58 100644 --- a/catkit/gen/__init__.py +++ b/catkit/gen/__init__.py @@ -2,7 +2,7 @@ # (see accompanying license files for details). """Catalysis Generator.""" -from collections import MutableMapping +from collections.abc import MutableMapping import numpy as np import ase From 11fe091b34d5dad2f323af0a6b9e24b75f7f51d1 Mon Sep 17 00:00:00 2001 From: Logan Ward Date: Tue, 10 Oct 2023 06:38:35 -0400 Subject: [PATCH 3/4] Quick fix: use == not is --- catkit/gen/adsorption.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catkit/gen/adsorption.py b/catkit/gen/adsorption.py index 3c24af16..6b51bd93 100644 --- a/catkit/gen/adsorption.py +++ b/catkit/gen/adsorption.py @@ -514,7 +514,7 @@ def add_adsorbate( raise ValueError('Specify the index of atom to bond.') elif len(bonds) == 1: - if index is -1: + if index == -1: slab = [] for i, _ in enumerate(self.get_symmetric_sites()): slab += [self._single_adsorption( From 2226851b4091d001f8c9c90bd91463795b4acf28 Mon Sep 17 00:00:00 2001 From: Logan Ward Date: Tue, 10 Oct 2023 07:27:00 -0400 Subject: [PATCH 4/4] Create a non-rectangular numpy array NumPy must have changed how arrays of sequences are created at somepoint in the past. I cannot find it in the change log, but the change I suggest should work across numpy versions --- catkit/gen/adsorption.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catkit/gen/adsorption.py b/catkit/gen/adsorption.py index 6b51bd93..b60c301c 100644 --- a/catkit/gen/adsorption.py +++ b/catkit/gen/adsorption.py @@ -57,8 +57,8 @@ def __init__(self, slab, surface_atoms=None, tol=1e-5): self.coordinates = np.array(self.coordinates) self.connectivity = np.array(self.connectivity, dtype=int) - self.r1_topology = np.array(self.r1_topology) - self.r2_topology = np.array(self.r2_topology) + self.r1_topology = np.array(self.r1_topology, dtype=object) + self.r2_topology = np.array(self.r2_topology, dtype=object) self.frac_coords = np.dot(self.coordinates, np.linalg.pinv(slab.cell)) self.slab = slab