Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dft_graph_database
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
dft_graph_database
Commits
7e82dd46
Commit
7e82dd46
authored
1 year ago
by
Nathan Daelman
Browse files
Options
Downloads
Patches
Plain Diff
Set libxc root rather than libxc src
parent
d3ffaa5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config.yaml
+1
-2
1 addition, 2 deletions
config.yaml
tests/test_maple_parser.py
+8
-8
8 additions, 8 deletions
tests/test_maple_parser.py
with
9 additions
and
10 deletions
config.yaml
+
1
−
2
View file @
7e82dd46
...
...
@@ -4,5 +4,4 @@ neo4j:
host
:
'
localhost'
port
:
7687
libxc
:
src
:
'
/home/nathan/Documents/libxc/src/'
xc-info
:
'
/home/nathan/Documents/libxc/bin/'
path
:
'
/home/nathan/Documents/libxc/'
This diff is collapsed.
Click to expand it.
tests/test_maple_parser.py
+
8
−
8
View file @
7e82dd46
import
pytest
import
yaml
from
maple_parser
import
find_comment
,
find_file_reference
,
find_formula
from
maple_parser
import
find_comment
s
,
find_file_reference
s
,
find_formula
s
# Read the YAML file
with
open
(
"
config.yaml
"
,
"
r
"
)
as
file
:
config
=
yaml
.
safe_load
(
file
)
file
.
close
()
libxc_src
=
config
[
"
libxc
"
][
"
src
"
]
libxc_src
=
config
[
"
libxc
"
][
"
path
"
]
@pytest.fixture
def
gga_k_apbe
():
with
open
(
f
"
{
libxc_src
}
/
../
maple/gga_exc/gga_k_apbe.mpl
"
,
"
r
"
)
as
file
:
with
open
(
f
"
{
libxc_src
}
/maple/gga_exc/gga_k_apbe.mpl
"
,
"
r
"
)
as
file
:
contents
=
[
line
.
strip
(
"
\n
"
)
for
line
in
file
.
readlines
()]
file
.
close
()
return
contents
def
test_comment
(
gga_k_apbe
):
_
,
comment_line
=
find_comment
([
gga_k_apbe
[
8
]])
_
,
comment_line
=
find_comment
s
([
gga_k_apbe
[
8
]])
assert
comment_line
[
0
]
==
"
(* type: gga_exc *)
"
_
,
comment_block
=
find_comment
(
gga_k_apbe
[
9
:
17
])
_
,
comment_block
=
find_comment
s
(
gga_k_apbe
[
9
:
17
])
assert
len
(
comment_block
)
==
6
assert
comment_block
[
0
]
==
"
(* prefix:
"
assert
comment_block
[
-
1
]
==
"
*)
"
def
test_parse_reference
(
gga_k_apbe
):
_
,
file_reference
=
find_file_reference
([
gga_k_apbe
[
16
]])
assert
file_reference
[
0
]
==
'
$include
"
gga_x_pbe.mpl
"
'
_
,
file_reference
=
find_file_reference
s
([
gga_k_apbe
[
16
]])
assert
file_reference
[
0
]
==
"
gga_x_pbe.mpl
"
def
test_parse_formula
(
gga_k_apbe
):
_
,
formula
=
find_formula
([
gga_k_apbe
[
18
]])
_
,
formula
=
find_formula
s
([
gga_k_apbe
[
18
]])
assert
(
formula
[
0
]
==
"
f := (rs, z, xt, xs0, xs1) -> gga_kinetic(pbe_f, rs, z, xs0, xs1):
"
)
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