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 Dos Fingerprints
Compare Revisions
562ae7d26fa108c7c31ebe38775c767aba1e642c...f55b5ad7826793c20d93a73fab01d028fbb44b00
Commits (4)
Added equal function for fingerprints
· b22f0ca1
Martin Kuban
authored
Aug 18, 2020
b22f0ca1
Check for grid type
· 2b688a5b
Martin Kuban
authored
Jan 18, 2021
2b688a5b
Merge remote branch newest version
· edce24bf
Martin Kuban
authored
Jan 18, 2021
edce24bf
Added error handler for calculate_bytes
· f55b5ad7
Alvin Noe Ladines
authored
Jan 26, 2021
f55b5ad7
Hide whitespace changes
Inline
Side-by-side
nomad_dos_fingerprints/DOSfingerprint.py
View file @
f55b5ad7
...
...
@@ -47,6 +47,9 @@ class DOSFingerprint():
def
get_similarities
(
self
,
list_of_fingerprints
):
return
np
.
array
([
self
.
similarity_function
(
self
,
fp
)
for
fp
in
list_of_fingerprints
])
def
__eq__
(
self
,
other
):
return
self
.
bins
==
other
.
bins
and
self
.
indices
==
other
.
indices
and
self
.
stepsize
==
other
.
stepsize
and
self
.
grid_id
==
other
.
grid_id
and
self
.
filling_factor
==
other
.
filling_factor
def
_integrate_to_bins
(
self
,
xs
,
ys
):
"""
Performs stepwise numerical integration of ``ys`` over the range of ``xs``. The stepsize of the generated histogram is controlled by DOSFingerprint().stepsize.
...
...
@@ -85,7 +88,10 @@ class DOSFingerprint():
"""
grid_array
=
grid
.
grid
()
# cut the energy and dos to grid size
energy
,
dos
=
np
.
transpose
([(
e
,
d
)
for
e
,
d
in
zip
(
energy
,
dos
)
if
(
e
>=
grid_array
[
0
][
0
]
and
e
<=
grid_array
[
-
1
][
0
])])
energy_dos
=
np
.
transpose
([(
e
,
d
)
for
e
,
d
in
zip
(
energy
,
dos
)
if
(
e
>=
grid_array
[
0
][
0
]
and
e
<=
grid_array
[
-
1
][
0
])])
if
len
(
energy_dos
)
!=
2
:
return
[
0
,
0
],
''
energy
,
dos
=
energy_dos
# calculate fingerprint
bin_fp
=
''
grid_index
=
0
...
...
nomad_dos_fingerprints/grid.py
View file @
f55b5ad7
...
...
@@ -27,6 +27,8 @@ class Grid():
return
{
'grid_type'
:
grid_type
,
'num_bins'
:
int
(
num_bins
),
'mu'
:
float
(
mu
),
'sigma'
:
float
(
sigma
),
'cutoff'
:
tuple
([
float
(
x
)
for
x
in
cutoff
[
1
:
-
1
].
split
(
','
)])}
def
grid
(
self
):
if
self
.
grid_type
!=
'dg_cut'
:
raise
NotImplementedError
(
'Currently, only the grid dg_cut is implemented.'
)
asc
=
0
desc
=
0
x_grid
=
[
0
]
...
...