Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
0a5912bb
Commit
0a5912bb
authored
Jul 30, 2020
by
Markus Scheidgen
Browse files
Added check mass_density for NaN.
parent
46fb6b3f
Pipeline
#79794
passed with stages
in 20 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/normalizing/encyclopedia/material.py
View file @
0a5912bb
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
from
typing
import
Dict
,
List
from
math
import
gcd
from
math
import
gcd
,
isnan
from
functools
import
reduce
from
abc
import
abstractmethod
import
re
...
...
@@ -140,7 +140,11 @@ class MaterialBulkNormalizer(MaterialNormalizer):
def
mass_density
(
self
,
properties
:
Properties
,
repr_system
:
Atoms
)
->
None
:
mass
=
atomutils
.
get_summed_atomic_mass
(
repr_system
.
get_atomic_numbers
())
orig_volume
=
repr_system
.
get_volume
()
*
(
1e-10
)
**
3
properties
.
mass_density
=
float
(
mass
/
orig_volume
)
mass_density
=
float
(
mass
/
orig_volume
)
if
isnan
(
mass_density
):
properties
.
mass_density
=
0
else
:
properties
.
mass_density
=
mass_density
def
material_name
(
self
,
material
:
Material
,
symbols
:
list
,
numbers
:
list
)
->
None
:
# Systems with one element are named after it
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment