diff --git a/docs/01-structuredata.ipynb b/docs/01-structuredata.ipynb index 90f6395..9469fbe 100644 --- a/docs/01-structuredata.ipynb +++ b/docs/01-structuredata.ipynb @@ -228,7 +228,7 @@ "text/plain": [ "{'pbc': [True, True, True],\n", " 'cell': [[3.84, 0.0, 2.351321854362918e-16],\n", - " [1.92, 2.7152900397563426, -1.9199999999999993],\n", + " [1.92, 2.7152900397563426, -1.919999999999999],\n", " [0.0, 0.0, 3.84]],\n", " 'tot_charge': None,\n", " 'tot_magnetization': None,\n", @@ -242,7 +242,7 @@ " 'weights': (1,)},\n", " {'symbol': 'Si',\n", " 'kind_name': 'Si',\n", - " 'position': [3.84, 1.3576450198781713, 1.9200000000000004],\n", + " 'position': [3.84, 1.3576450198781713, 1.9200000000000006],\n", " 'mass': 28.0855,\n", " 'charge': 0.0,\n", " 'magmom': [0.0, 0.0, 0.0],\n", @@ -255,7 +255,7 @@ " 'kinds': ['Si', 'Si'],\n", " 'symbols': ['Si', 'Si'],\n", " 'positions': [[0.0, 0.0, 0.0],\n", - " [3.84, 1.3576450198781713, 1.9200000000000004]],\n", + " [3.84, 1.3576450198781713, 1.9200000000000006]],\n", " 'formula': 'Si2'}" ] }, @@ -297,7 +297,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -374,7 +374,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/Users/mbonacci/Documents/codes/aiida-atomistic/src/aiida_atomistic/data/structure/models.py:170: UserWarning: using default cell\n", + "/home/aiida/codes/aiida-atomistic/src/aiida_atomistic/data/structure/models.py:170: UserWarning: using default cell\n", " warnings.warn(\"using default cell\")\n" ] }, @@ -646,8 +646,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "13\n", - "[]\n" + "387\n", + "[]\n" ] } ], diff --git a/src/aiida_atomistic/data/structure/mixin.py b/src/aiida_atomistic/data/structure/mixin.py index adf9104..2926027 100644 --- a/src/aiida_atomistic/data/structure/mixin.py +++ b/src/aiida_atomistic/data/structure/mixin.py @@ -446,7 +446,7 @@ def get_composition(self, mode="full"): f"mode `{mode}` is invalid, choose from `full`, `reduced` or `fractional`." ) - def get_kinds(self, kind_tags=[], exclude=["weight"], custom_thr={}, ready_to_use=False): + def get_kinds(self, kind_tags=[], exclude=["weights"], custom_thr={}, ready_to_use=False): """ Get the list of kinds, taking into account all the properties. If the list of kinds is already provided--> len(kind_tags)>0, we check the consistency of it @@ -533,6 +533,7 @@ def get_kinds(self, kind_tags=[], exclude=["weight"], custom_thr={}, ready_to_us kinds_per_property = self._to_kinds( property_name=single_property, symbols=symbols, thr=thr ) + kind_properties.append(kinds_per_property[0]) # I prefer to store again under the key 'value', may be useful in the future kinds_dictionary[single_property] = kinds_per_property[1] @@ -1131,6 +1132,8 @@ def _get_object_pymatgen_molecule(self, **kwargs): ) species = [] + additional_kwargs = {} + for site in self.properties.sites: if hasattr(site, "weight"): weight = site.weight