nicer reporting
This commit is contained in:
parent
e8b69c7871
commit
0f26da0ec1
|
@ -114,12 +114,13 @@ class Crystal():
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""Represent."""
|
"""Represent."""
|
||||||
return '\n'.join([f'Crystal family {self.family}']
|
family = f'Crystal family: {self.family}'
|
||||||
+ ([] if self.lattice is None else [f'Bravais lattice {self.lattice}']+
|
return family if self.lattice is None else \
|
||||||
list(map(lambda x:f'{x[0]}: {x[1]:.5g}',
|
'\n'.join([family,
|
||||||
zip(['a','b','c','α','β','γ',],
|
f'Bravais lattice: {self.lattice}',
|
||||||
self.parameters))))
|
'a={:.5g}m, b={:.5g}m, c={:.5g}m'.format(*self.parameters[:3]),
|
||||||
)
|
'α={:.5g}°, β={:.5g}°, γ={:.5g}°'.format(*np.degrees(self.parameters[3:]))])
|
||||||
|
|
||||||
|
|
||||||
def __eq__(self,other):
|
def __eq__(self,other):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue