Skip to content

Commit

Permalink
Merge pull request #38 from mikibonacci/develop
Browse files Browse the repository at this point in the history
Minor fixings
  • Loading branch information
mikibonacci authored Aug 21, 2024
2 parents 254f381 + a6bc6d6 commit 2621ce1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 7 additions & 7 deletions docs/01-structuredata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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'}"
]
},
Expand Down Expand Up @@ -297,7 +297,7 @@
{
"data": {
"text/plain": [
"<aiida_atomistic.data.structure.structure.StructureDataMutable at 0x10402b910>"
"<aiida_atomistic.data.structure.structure.StructureDataMutable at 0x7383406166b0>"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -646,8 +646,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"13\n",
"[<StructureData: uuid: e8f59708-2903-4382-b458-dcaa3dfc019b (pk: 13)>]\n"
"387\n",
"[<StructureData: uuid: aa1a31fc-7422-4d56-8c43-9529a3b8c4f9 (pk: 387)>]\n"
]
}
],
Expand Down
5 changes: 4 additions & 1 deletion src/aiida_atomistic/data/structure/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2621ce1

Please sign in to comment.