@@ -268,7 +268,7 @@ def __init__(
268
268
269
269
# Use the setter here, since it will handle either ints or Quantities
270
270
# and it is designed to quickly process ints
271
- self .formal_charge = formal_charge
271
+ self .formal_charge = formal_charge # type: ignore[assignment]
272
272
self ._is_aromatic = is_aromatic
273
273
self ._stereochemistry = stereochemistry
274
274
if name is None :
@@ -308,9 +308,13 @@ def to_dict(self) -> dict[str, Union[None, str, int, bool, dict[Any, Any]]]:
308
308
"""
309
309
# TODO: Should this be implicit in the atom ordering when saved?
310
310
# atom_dict['molecule_atom_index'] = self._molecule_atom_index
311
+
312
+ # trust that the unit is e
313
+ formal_charge : int = self ._formal_charge .m # type: ignore
314
+
311
315
return {
312
316
"atomic_number" : self ._atomic_number ,
313
- "formal_charge" : self . _formal_charge . m , # Trust that the unit is e
317
+ "formal_charge" : formal_charge ,
314
318
"is_aromatic" : self ._is_aromatic ,
315
319
"stereochemistry" : self ._stereochemistry ,
316
320
"name" : self ._name ,
@@ -5960,12 +5964,7 @@ def __init__(
5960
5964
for id_component , uniqueness_component in zip (identifier , scheme .uniqueness_criteria ):
5961
5965
setattr (self , uniqueness_component , id_component )
5962
5966
5963
- < << << << HEAD
5964
-
5965
5967
def to_dict (self ) -> dict [str , tuple [str | int , ...] | Sequence [int ]]:
5966
- == == == =
5967
- def to_dict (self ) -> dict [str , tuple [str | int , ...] | Sequence [int ]]:
5968
- >> >> >> > 549 a39bc (Fix )
5969
5968
"""Serialize this object to a basic dict of strings and lists of ints.
5970
5969
5971
5970
Keys and values align with parameters used to initialize the :class:`HierarchyElement` class.
0 commit comments