Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
0a5912bb
Commit
0a5912bb
authored
4 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Added check mass_density for NaN.
parent
46fb6b3f
No related branches found
No related tags found
1 merge request
!139
V0.8.4
Pipeline
#79794
passed
4 years ago
Stage: build
Stage: test
Stage: deploy
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nomad/normalizing/encyclopedia/material.py
+6
-2
6 additions, 2 deletions
nomad/normalizing/encyclopedia/material.py
with
6 additions
and
2 deletions
nomad/normalizing/encyclopedia/material.py
+
6
−
2
View file @
0a5912bb
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# limitations under the License.
# limitations under the License.
from
typing
import
Dict
,
List
from
typing
import
Dict
,
List
from
math
import
gcd
from
math
import
gcd
,
isnan
from
functools
import
reduce
from
functools
import
reduce
from
abc
import
abstractmethod
from
abc
import
abstractmethod
import
re
import
re
...
@@ -140,7 +140,11 @@ class MaterialBulkNormalizer(MaterialNormalizer):
...
@@ -140,7 +140,11 @@ class MaterialBulkNormalizer(MaterialNormalizer):
def
mass_density
(
self
,
properties
:
Properties
,
repr_system
:
Atoms
)
->
None
:
def
mass_density
(
self
,
properties
:
Properties
,
repr_system
:
Atoms
)
->
None
:
mass
=
atomutils
.
get_summed_atomic_mass
(
repr_system
.
get_atomic_numbers
())
mass
=
atomutils
.
get_summed_atomic_mass
(
repr_system
.
get_atomic_numbers
())
orig_volume
=
repr_system
.
get_volume
()
*
(
1e-10
)
**
3
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
:
def
material_name
(
self
,
material
:
Material
,
symbols
:
list
,
numbers
:
list
)
->
None
:
# Systems with one element are named after it
# Systems with one element are named after it
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment