Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of JDFTx code #955

Open
wants to merge 258 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
258 commits
Select commit Hold shift + click to select a range
203d083
Merge pull request #4 from cote3804/jdft_sets
cote3804 Aug 3, 2024
a39a4ea
JdftxInputGenerator works from added BaseJdftxSet.yaml
cote3804 Aug 6, 2024
d8b692c
Merge pull request #5 from cote3804/jdftx_parsers
cote3804 Aug 6, 2024
90035d6
Initial commit for emmet work
cote3804 Aug 9, 2024
0a57246
Merge pull request #6 from cote3804/emmet
cote3804 Aug 9, 2024
6d36074
very simple base script
soge8904 Aug 12, 2024
2ad2dbd
Merge pull request #7 from cote3804/jdft_sets
cote3804 Aug 13, 2024
67d43db
empty init
benrich37 Sep 3, 2024
8631a3c
empty init - these testchecks will have to be migrated over to pymatg…
benrich37 Sep 3, 2024
2836896
example files to use for io testchecking
benrich37 Sep 3, 2024
e1bc816
Jobs.py uses Custodian's Job class and should be stored there when re…
soge8904 Sep 3, 2024
7ffb6f9
first testcheck (putting a pin in this to deal with a greater problem)
benrich37 Sep 3, 2024
403e2b5
Changing reference to "data" module for outside references
benrich37 Sep 3, 2024
9e3229f
first working test
benrich37 Sep 3, 2024
6003cef
Merge branch 'main' into jdft_sets
cote3804 Sep 4, 2024
5928fa7
Merge pull request #8 from cote3804/jdft_sets
cote3804 Sep 4, 2024
87f70be
moving known values to a comparison dict
benrich37 Sep 4, 2024
faf07f8
updates
benrich37 Sep 4, 2024
415c428
Addede schemas and new JDFTXOutfile methods
cote3804 Sep 4, 2024
c7521dd
Merge pull request #9 from cote3804/emmet
cote3804 Sep 4, 2024
62c076b
updating before merge
benrich37 Sep 4, 2024
5fec9fe
Merge remote-tracking branch 'origin' into io_testchecks
benrich37 Sep 4, 2024
ff9e895
Merge branch 'materialsproject:main' into main
cote3804 Sep 4, 2024
cef977a
functionalization of outfile reader
benrich37 Sep 4, 2024
5202c48
Merge remote-tracking branch 'origin' into io_testchecks
benrich37 Sep 4, 2024
232d36f
syntax changes mostly
soge8904 Sep 4, 2024
bf085a5
Merge branch 'materialsproject:main' into jdft_sets
soge8904 Sep 4, 2024
472885b
This was working, and now its not. I'm not sure how it was finding th…
benrich37 Sep 4, 2024
cc060bc
Prefix is able to be None if not set in JDFTx
benrich37 Sep 4, 2024
9a36ea5
Class method for getting the pp type - it assumes either "GBRV" or "S…
benrich37 Sep 4, 2024
f30d210
Baby steps into getting class functions to set instance variables
benrich37 Sep 4, 2024
f5b1c15
import fix
benrich37 Sep 4, 2024
ed0c930
Moved code collecting data from lines read from pseudopotential into…
benrich37 Sep 5, 2024
60ac63e
copy pasting here for now, will eeventually move important functions …
benrich37 Sep 5, 2024
f6741f3
PSYCH doing it rn (shoutout refactoring)
benrich37 Sep 5, 2024
d526340
implementing run.py
soge8904 Sep 5, 2024
d3174e1
Updating out_to_log functions to take that "text" list of str instead…
benrich37 Sep 5, 2024
eb650bc
Collection of class objects for (relatively) flexible storing of conv…
benrich37 Sep 5, 2024
d534eb5
Updated testing
benrich37 Sep 5, 2024
da2eae7
Organization + typing
benrich37 Sep 6, 2024
8326192
Moving JEiters test to test_JEiters.py
benrich37 Sep 6, 2024
ac838ea
taking a leap of faith on forces units
benrich37 Sep 6, 2024
8a1f8cf
Staging to pour one out for JAtoms
benrich37 Sep 6, 2024
f3d53cd
Restructuring for convergence info to only be held be JEiters, not an…
benrich37 Sep 6, 2024
984dd33
Restructuring for convergence info to only be held by JEiters, not an…
benrich37 Sep 6, 2024
201b202
Can't think of anything else to test for this suite of classes
benrich37 Sep 6, 2024
24ed025
Adding to eventually replace read_file to remove io time spent on ana…
benrich37 Sep 6, 2024
736ab92
Adding JStructures class super to List to be a list of JStructure
benrich37 Sep 6, 2024
63fe282
Fixing super init
benrich37 Sep 7, 2024
9e78597
typo
benrich37 Sep 7, 2024
33e6299
new files to use for testing
benrich37 Sep 7, 2024
f4769d7
This might be overkill but creating class series for storing input se…
benrich37 Sep 7, 2024
63a8a43
Set the generic settings types upon init
benrich37 Sep 7, 2024
e007c92
Functionalizing existing operations within "from_file" - there's a lo…
benrich37 Sep 7, 2024
1d5f207
Commenting this out for now - need to talk to Cooper to discuss
benrich37 Sep 7, 2024
bcf9ae9
Made changes to base.py to get it to write input
soge8904 Sep 7, 2024
c7cd7b4
Docustrings for JStructures suite
benrich37 Sep 7, 2024
a8000a9
test checks for GC optimizations
benrich37 Sep 7, 2024
698e5d0
Comment on deprecation
benrich37 Sep 7, 2024
2f5e4dd
Updated docustrings (got the format wrong) + changed _set_Nbands's me…
benrich37 Sep 7, 2024
7f9b156
docustrings
benrich37 Sep 7, 2024
a1e9a67
Consistent indentation
benrich37 Sep 7, 2024
85baae9
No longer using the old out_to_log functions
benrich37 Sep 7, 2024
256581c
docustrings
benrich37 Sep 7, 2024
9d080d0
Refactoring class objects to their own python file so my IDE stops st…
benrich37 Sep 7, 2024
c8e7a2e
docustrings
benrich37 Sep 7, 2024
67b10d3
Accidentally removed get_start_lines needed for read_outfile
benrich37 Sep 7, 2024
0193ed5
Restructured JDFTXOutfile to be an inherited list of JDFTXOutfileSlic…
benrich37 Sep 7, 2024
3b3463d
Fixed imports to refer to full path (include atomate2)
benrich37 Sep 7, 2024
0c2e9c3
Reorganize so that the helper class functions are at the end, and the…
benrich37 Sep 7, 2024
40658e9
Removing unused functions and imports
benrich37 Sep 8, 2024
047ca68
Removed comment block
benrich37 Sep 8, 2024
6002383
Removed comment block
benrich37 Sep 8, 2024
a7b9600
fixed import
benrich37 Sep 8, 2024
f2b4f8b
Use jstrucs to get total_electrons
benrich37 Sep 8, 2024
ffad1d8
This shouldn't have been added
benrich37 Sep 8, 2024
6e2f50b
This should've been removed yesterday
benrich37 Sep 8, 2024
7fc2f4f
Removing assumption of spin polarization
benrich37 Sep 8, 2024
e38ae6c
misc updates
benrich37 Sep 8, 2024
5a84358
Fixing inheritance so that inherited attributes refer to the last sli…
benrich37 Sep 8, 2024
993df41
Choosing the fftgrid to be the first logged fftbox size - later logge…
benrich37 Sep 8, 2024
137a1bf
Realizing this value is in units Kelvin, not Hartrees
benrich37 Sep 8, 2024
505b09a
fixed expected ordering of lines in an SCF step log
benrich37 Sep 8, 2024
a874469
example files with similar filename pattern
benrich37 Sep 8, 2024
63fc9bf
Satisfied for now
benrich37 Sep 8, 2024
c6ed7bb
Renaming JStructure(s) to JOutStructure(s) to avoid confusion with JD…
benrich37 Sep 8, 2024
28ee5d7
All files seem to work together and do what expected to run a BEAST c…
soge8904 Sep 9, 2024
ecbdc03
Merge branch 'materialsproject:main' into jdft_sets
soge8904 Sep 9, 2024
f720e49
merge conflicts resolved with jdft_sets
cote3804 Sep 9, 2024
7518af0
Merge branch 'main' into io_testchecks
cote3804 Sep 9, 2024
42d5ee1
Merge pull request #11 from cote3804/io_testchecks
cote3804 Sep 9, 2024
f2bc804
adding these real quick before pulling main into this branch
benrich37 Sep 9, 2024
6d6566e
Merge branch 'io_testchecks' of https://github.com/cote3804/atomate2 …
benrich37 Sep 9, 2024
b0fe756
Talked to Jacob - these lines were indeed typos.
benrich37 Sep 9, 2024
2adaef1
removing unused import
benrich37 Sep 9, 2024
fa9f68b
This line is needed
benrich37 Sep 9, 2024
b858719
for debugging
benrich37 Sep 9, 2024
d593ede
storing for now
benrich37 Sep 9, 2024
f6d4085
Merge branch 'main' into io_testchecks
benrich37 Sep 9, 2024
9a84f7a
Merge pull request #12 from cote3804/io_testchecks
benrich37 Sep 9, 2024
c8c700c
renamed emmet to schemas and finished initial Calculation schema
cote3804 Sep 10, 2024
f45f5f5
Initial TaskDoc completed with from_directory() method implemented
cote3804 Sep 10, 2024
f3fd820
Merge branch 'emmet'
cote3804 Sep 10, 2024
f0c4f60
Merge branch 'main' of github.com:cote3804/atomate2
cote3804 Sep 10, 2024
135b2fa
fixed Status doc import
cote3804 Sep 10, 2024
29e1998
added jdftx_job wrapper and should_stop_children function as well as …
cote3804 Sep 10, 2024
58ebcfa
removed ASE dependency and fixed import paths in JDFTXOutfileSlice an…
cote3804 Sep 10, 2024
c2e62fc
wrapped make method of BaseJdftxMaker in jdftx_job()
cote3804 Sep 10, 2024
790f526
fixed imports + added t_s property to JDFTXOutfile
benrich37 Sep 10, 2024
1715a73
just committing for less work
benrich37 Sep 10, 2024
a49dbdb
Merge pull request #14 from cote3804/io_testchecks
benrich37 Sep 10, 2024
5afde67
testing to make sure iter_type is defined correctly
benrich37 Sep 10, 2024
4bdb5b4
using example_sp.out's beginning lines as a complete in file (all tag…
benrich37 Sep 10, 2024
688fab2
Merge remote-tracking branch 'origin/main' into io_testchecks
benrich37 Sep 10, 2024
ff72a2e
Changing TagContainer's "read" class function to return a list within…
benrich37 Sep 10, 2024
47301a6
replaced open with zopen and converted os.path to pathlib operations
cote3804 Sep 11, 2024
907a129
made dump-name jdftx. for BaseJdftxSet.yaml
cote3804 Sep 11, 2024
a4a030d
wrote condense_jdftxinputs() to merge structure and inputs to one jdf…
cote3804 Sep 11, 2024
1cce6ff
cleaning up files to get job to run on Perlmutter
cote3804 Sep 11, 2024
2ef0867
Merge branch 'main' into emmet
cote3804 Sep 11, 2024
5fdfb39
Merge pull request #15 from cote3804/emmet
cote3804 Sep 11, 2024
fd8880b
Fixes from trying to read example_sp.in
benrich37 Sep 11, 2024
935119e
Fixes to old assumptions broken by problem1.out example out file
benrich37 Sep 11, 2024
1046228
Merge pull request #16 from cote3804/io_testchecks
benrich37 Sep 11, 2024
c6744f0
Nervous because this file isn't supposed to be edited
benrich37 Sep 11, 2024
22b21be
HUGE strides wrt fixing the infile parser (multiformattag was calling…
benrich37 Sep 11, 2024
951a213
passing self-consistency test-check now!
benrich37 Sep 11, 2024
02191ae
pre-commit changes + jobs/sets changes (deleted jobs.py bc went to cu…
soge8904 Sep 11, 2024
2e9feee
Merge branch 'main' of https://github.com/cote3804/atomate2
soge8904 Sep 11, 2024
7e5c805
misc
benrich37 Sep 11, 2024
6e0c348
pre-commit changes
soge8904 Sep 11, 2024
03e93c2
more pre-commit
soge8904 Sep 11, 2024
171f9ef
Pushing small restructure of Outfile paser
benrich37 Sep 11, 2024
300e611
Merge branch 'main' into io_testchecks
benrich37 Sep 11, 2024
fc4f47c
Merge pull request #17 from cote3804/io_testchecks
benrich37 Sep 11, 2024
cc55676
Removed stray quotation mark
benrich37 Sep 11, 2024
ae5cab7
Restructuring JOutStructures to no longer inherit JOutStructure (shou…
benrich37 Sep 11, 2024
d53382f
Restructured inheritance of JEiters for better IDE access of class va…
benrich37 Sep 11, 2024
9189b2b
not a real dump var
benrich37 Sep 11, 2024
ce94d4e
Fixing refdrences to include
benrich37 Sep 11, 2024
7af080f
Adding "built-in" functions so outfile acts like a list
benrich37 Sep 12, 2024
81800e2
heartbreaking accidental re-use of variable name
benrich37 Sep 12, 2024
e681f18
Added known value test to testchecks
benrich37 Sep 12, 2024
e1da8a0
Removing commented out old code, starting change to snake case
benrich37 Sep 12, 2024
1aef3ad
converting modules to snake case
benrich37 Sep 12, 2024
729365d
pep8 nonsense
benrich37 Sep 12, 2024
dfcef7e
Merge branch 'materialsproject:main' into jdftx_parsers
jacobclary Sep 12, 2024
e1609fc
temporary fix for initial-magnetic-moments tag
jacobclary Sep 12, 2024
85e48fa
Merge branch 'jdftx_parsers' of https://github.com/cote3804/atomate2 …
jacobclary Sep 12, 2024
2fa23d6
Merge branch 'main' into jdftx_parsers
cote3804 Sep 12, 2024
e6ea6c9
Merge pull request #18 from cote3804/jdftx_parsers
cote3804 Sep 12, 2024
5e08d8f
pre-commit changes on schemas
cote3804 Sep 12, 2024
1349441
Merge branch 'main' into io_testchecks
benrich37 Sep 12, 2024
445b07c
Merge pull request #19 from cote3804/io_testchecks
benrich37 Sep 12, 2024
0f4b1ba
more minor schema changes
cote3804 Sep 12, 2024
ecc7207
minor schema changes
cote3804 Sep 12, 2024
feb5334
jobs/base.py import fixes
cote3804 Sep 12, 2024
25fc58b
merged main to emmet
cote3804 Sep 12, 2024
fcee9d3
removed unused core schemas folder
cote3804 Sep 12, 2024
cb2aa9c
Added JDFTX_CMD to settings.py
cote3804 Sep 12, 2024
fae5a3a
Fixed JDFTX_CMD typo
cote3804 Sep 12, 2024
a8f6752
Fixed JDFTX_CMD description
cote3804 Sep 12, 2024
25434ee
PEP8 reformatting + adding full DFT functional options in jdftxinfile…
benrich37 Sep 12, 2024
cab8e1e
Moved common deepcopy tag containers to jdftxinfile_ref_options
benrich37 Sep 12, 2024
0525e0d
added deepcopy to references to func options lists
benrich37 Sep 12, 2024
20ad4fb
Renaming elec_ec_corr_func... to func... for line lengths + PEP8
benrich37 Sep 12, 2024
0b35c4e
PEP8
benrich37 Sep 12, 2024
5f5ab75
Now passes pre-commit
benrich37 Sep 12, 2024
cecd293
PEP8 fix for JEiters requires restructuring. No longer inherits JEite…
benrich37 Sep 12, 2024
d4cec6e
Renaming to snake case (pytest files are modules apparently)
benrich37 Sep 12, 2024
ee17c41
snake case test functions too
benrich37 Sep 12, 2024
726cfbc
PEP8
benrich37 Sep 12, 2024
e224424
Moving global functions to a helper module
benrich37 Sep 12, 2024
883473c
sacrificial commit to pre-commit gods - not much restructuring here a…
benrich37 Sep 12, 2024
831498f
minimal pre-commit sacrifices
benrich37 Sep 13, 2024
f9654b2
updates for pre-commit - putting a pin in this for now
benrich37 Sep 13, 2024
f9f72a6
removed unused code from task.py in schemas
cote3804 Sep 13, 2024
e13adb2
minor schema changes
cote3804 Sep 13, 2024
5562535
set default filenames in files.py
cote3804 Sep 13, 2024
5a19daa
pre-commit adjustments
benrich37 Sep 13, 2024
bda9b21
Partial satisfaction of pre-commit
benrich37 Sep 14, 2024
7d3c07e
Merge pull request #20 from cote3804/io_testchecks
benrich37 Sep 14, 2024
021b9f2
fixed FILE_NAMES sircular import by moving from files to sets/base.py
cote3804 Sep 14, 2024
6f93f00
Merge branch 'main' into emmet
cote3804 Sep 14, 2024
9036156
Incomplete import
benrich37 Sep 14, 2024
e320a45
working on vasp sets bc cp2k not working
soge8904 Sep 16, 2024
35793e2
Working on tests so making changes to vasp and
soge8904 Sep 16, 2024
49278de
Merge branch 'main' of https://github.com/cote3804/atomate2 into tests
soge8904 Sep 17, 2024
1348e58
Issues with parser and 'freq' tag. Committing to give acces to Ben.
soge8904 Sep 17, 2024
e8155b8
minor changes to set filename conventions
cote3804 Sep 17, 2024
fb317e9
Merge pull request #21 from cote3804/emmet
cote3804 Sep 17, 2024
4bb3749
Merge branch 'main' of https://github.com/cote3804/atomate2 into tests
soge8904 Sep 17, 2024
ae2ca52
Pushing to update changes. Need to finish check_input in conftest but…
soge8904 Sep 17, 2024
00e16fc
test_core_new.py works with conftest.py. _conftest_old.py is just to …
soge8904 Sep 18, 2024
dc35e58
Finished updating JDFTx conftest.py and jobs test_core.py
soge8904 Sep 22, 2024
c00c8b6
final core tests
soge8904 Sep 26, 2024
5953f5d
Changed imports to pymatgen io.
soge8904 Sep 29, 2024
ecabec7
pre-commit changes on test scripts
soge8904 Sep 29, 2024
caecba4
.
soge8904 Sep 29, 2024
98ed2de
Merge pull request #22 from cote3804/tests
soge8904 Sep 29, 2024
eb8e663
Changed mock_cwd fixture in jdftx conftest to return a string instead…
soge8904 Nov 1, 2024
50bc750
Refactored to change pymatgen.io.jdftx module import names
cote3804 Nov 13, 2024
a667260
Merge pull request #23 from cote3804/pymatgen_io
cote3804 Nov 13, 2024
51badf3
Merge remote-tracking branch 'upstream/main'
soge8904 Nov 14, 2024
67c2991
Added k-point calculation in JdftxInputGenerator and default BEAST co…
cote3804 Nov 17, 2024
a4fc048
moved jobs to adsroption.py
cote3804 Nov 18, 2024
ea2af62
Updated base JDFTX set generator.
cote3804 Nov 18, 2024
20772d7
Added defaults to configuration yamls in jdftx/sets
cote3804 Nov 18, 2024
4c99994
Added JDFTX_PSEUDOS_DIR to settings.py
cote3804 Nov 18, 2024
f50e8fb
cleaning up small file changes
cote3804 Nov 18, 2024
75b4488
Fixes for base set generator
cote3804 Nov 20, 2024
a93edf8
BaseJdftxSet.yaml tag syntax fix
cote3804 Nov 20, 2024
9826057
automatic magnetic moment setting
cote3804 Nov 20, 2024
2c1fb07
f string fix in JdftxInputGenerator
cote3804 Nov 20, 2024
a90e4df
Added schema attributes
cote3804 Nov 21, 2024
e299f0a
Merge branch 'main' into tests
cote3804 Nov 21, 2024
5fea4e4
Merge branch 'surface_flows' into tests
cote3804 Nov 21, 2024
44d5260
fixed Enum syntax error
cote3804 Nov 21, 2024
dc4608b
new emptry files for schemas tests
cote3804 Nov 21, 2024
ed6a8f4
Merge branch 'schemas' into tests
cote3804 Nov 21, 2024
ade28de
Added TaskDoc Schema test
cote3804 Nov 22, 2024
a2fc932
Schema fixes. Compliant with initial TaskDoc test
cote3804 Nov 22, 2024
9d39fac
Merge branch 'schemas' into tests
cote3804 Nov 22, 2024
867e149
pseudopotentials and run command cleanup
cote3804 Nov 22, 2024
ac54256
cleaning up file name defaults
cote3804 Nov 22, 2024
926d3b2
elec-nbands fix to be current with parsers
cote3804 Dec 2, 2024
cf03560
another elec-n-bands fix
cote3804 Dec 2, 2024
71d9d6d
Convergence schema change for parser compliance
cote3804 Dec 3, 2024
9db7599
user_settings update in get_input_set
cote3804 Dec 4, 2024
5a3e014
cartesian coordinate default for coulomb-truncation setting
cote3804 Dec 4, 2024
5f0419b
coulomb-truncation-embed calculation fixes
cote3804 Dec 4, 2024
dda6434
added test to check coulomb-truncation-embed
cote3804 Dec 4, 2024
4124d4b
pre-commit compliance and old file cleanup
cote3804 Dec 4, 2024
a58a278
removed errant in.kpts file
cote3804 Dec 4, 2024
70d1072
removed magnetic initialization from core sets
cote3804 Dec 4, 2024
9a5ea38
Merge pull request #24 from cote3804/surface_flows
cote3804 Dec 4, 2024
acc1b15
Merge branch 'materialsproject:main' into main
cote3804 Dec 4, 2024
dd6ee03
TODO add jdftx_calculation kwargs to Calculation schema
cote3804 Dec 5, 2024
acbd1c9
removed forced Cartesian coords-type
cote3804 Dec 5, 2024
735a02f
small typo fix
cote3804 Dec 5, 2024
8843a49
reafactored tests
cote3804 Dec 5, 2024
af343cb
Merge pull request #25 from cote3804/surface_flows
cote3804 Dec 5, 2024
6e59d65
removed comments from taskdoc test
cote3804 Dec 6, 2024
ea4195f
removed fluid from core sets and added BEAST core set
cote3804 Dec 6, 2024
a7f6fd0
default input file changes in tests
cote3804 Dec 6, 2024
151a2e8
CalculationOutput includes Structure instead of JOuStructure
cote3804 Dec 8, 2024
90be64e
Removed Structure from TaskDoc fields
cote3804 Dec 8, 2024
5113ba5
Merge pull request #26 from cote3804/surface_flows
cote3804 Dec 8, 2024
af895b6
Fixed charges, forces, and stress atributes in the calculation docs
cote3804 Dec 20, 2024
474bd5e
Merge pull request #27 from cote3804/surface_flows
cote3804 Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions jdftxcov.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" ?>
<coverage version="7.6.1" timestamp="1727213408713" lines-valid="68" lines-covered="58" line-rate="0.8529" branches-valid="12" branches-covered="10" branch-rate="0.8333" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.6.1 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>/Users/sophi/envs/jobflow_py310/src/atomate2/src/atomate2/jdftx/jobs</source>
</sources>
<packages>
<package name="." line-rate="0.8529" branch-rate="0.8333" complexity="0">
<classes>
<class name="__init__.py" filename="__init__.py" complexity="0" line-rate="1" branch-rate="1">
<methods/>
<lines/>
</class>
<class name="base.py" filename="base.py" complexity="0" line-rate="0.9744" branch-rate="0.75">
<methods/>
<lines>
<line number="3" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1" branch="true" condition-coverage="50% (1/2)" missing-branches="17"/>
<line number="17" hits="0"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="24" hits="1"/>
<line number="25" hits="1"/>
<line number="26" hits="1"/>
<line number="28" hits="1"/>
<line number="37" hits="1"/>
<line number="44" hits="1"/>
<line number="55" hits="1"/>
<line number="70" hits="1"/>
<line number="73" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="74" hits="1"/>
<line number="93" hits="1"/>
<line number="94" hits="1"/>
<line number="97" hits="1"/>
<line number="98" hits="1"/>
<line number="99" hits="1"/>
<line number="101" hits="1"/>
<line number="102" hits="1"/>
<line number="116" hits="1"/>
<line number="119" hits="1"/>
<line number="121" hits="1"/>
<line number="123" hits="1"/>
<line number="124" hits="1"/>
<line number="126" hits="1"/>
<line number="130" hits="1"/>
<line number="137" hits="1"/>
<line number="139" hits="1"/>
</lines>
</class>
<class name="core.py" filename="core.py" complexity="0" line-rate="0.9524" branch-rate="0.875">
<methods/>
<lines>
<line number="3" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="13" hits="1" branch="true" condition-coverage="50% (1/2)" missing-branches="14"/>
<line number="14" hits="0"/>
<line number="17" hits="1"/>
<line number="20" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="21" hits="1"/>
<line number="24" hits="1"/>
<line number="25" hits="1"/>
<line number="27" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="28" hits="1"/>
<line number="31" hits="1"/>
<line number="32" hits="1"/>
<line number="34" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="35" hits="1"/>
<line number="38" hits="1"/>
<line number="39" hits="1"/>
</lines>
</class>
<class name="test_run.py" filename="test_run.py" complexity="0" line-rate="0" branch-rate="1">
<methods/>
<lines>
<line number="1" hits="0"/>
<line number="2" hits="0"/>
<line number="3" hits="0"/>
<line number="4" hits="0"/>
<line number="6" hits="0"/>
<line number="7" hits="0"/>
<line number="8" hits="0"/>
<line number="9" hits="0"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>
1 change: 1 addition & 0 deletions src/atomate2/jdftx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module for JDFTx workflows."""
38 changes: 38 additions & 0 deletions src/atomate2/jdftx/files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""File operations and default JDFTx file names."""

import logging

# if TYPE_CHECKING:
from pathlib import Path

from pymatgen.core import Structure

from atomate2.jdftx.sets.base import JdftxInputGenerator

logger = logging.getLogger(__name__)


def write_jdftx_input_set(
structure: Structure,
input_set_generator: JdftxInputGenerator,
directory: str | Path = ".",
**kwargs,
) -> None:
"""
Write JDFTx input set.

Parameters
----------
structure : .Structure
A structure.
input_set_generator : .JdftxInputGenerator
A JDFTx input set generator.
directory : str or Path
The directory to write the input files to.
**kwargs
Keyword arguments to pass to :obj:`.JdftxInputSet.write_input`.
"""
cis = input_set_generator.get_input_set(structure)

logger.info("Writing JDFTx input set.")
cis.write_input(directory, **kwargs)
1 change: 1 addition & 0 deletions src/atomate2/jdftx/jobs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module for JDFTx jobs."""
42 changes: 42 additions & 0 deletions src/atomate2/jdftx/jobs/adsorption.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Core jobs for running JDFTx calculations."""

from __future__ import annotations

import logging
from dataclasses import dataclass, field
from typing import TYPE_CHECKING

from atomate2.jdftx.jobs.base import BaseJdftxMaker
from atomate2.jdftx.sets.core import IonicMinSetGenerator

if TYPE_CHECKING:
from atomate2.jdftx.sets.core import JdftxInputGenerator

logger = logging.getLogger(__name__)


@dataclass
class SurfaceMinMaker(BaseJdftxMaker):
"""Maker to create surface relaxation job."""

name: str = "surface_ionic_min"
input_set_generator: JdftxInputGenerator = field(
default_factory=lambda: IonicMinSetGenerator(
coulomb_truncation=True,
auto_kpoint_density=1000,
calc_type="surface",
)
)


@dataclass
class MolMinMaker(BaseJdftxMaker):
"""Maker to create molecule relaxation job."""

name: str = "surface_ionic_min"
input_set_generator: JdftxInputGenerator = field(
default_factory=IonicMinSetGenerator(
coulomb_truncation=True,
calc_type="molecule",
)
)
140 changes: 140 additions & 0 deletions src/atomate2/jdftx/jobs/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
"""Definition of base JDFTx job maker."""

from __future__ import annotations

import logging
import os
from dataclasses import dataclass, field
from typing import TYPE_CHECKING

from jobflow import Maker, Response, job

from atomate2.jdftx.sets.base import JdftxInputGenerator

if TYPE_CHECKING:
from collections.abc import Callable
from pathlib import Path

from pymatgen.core import Structure
from pymatgen.core.trajectory import Trajectory
from pymatgen.electronic_structure.bandstructure import (
BandStructure,
BandStructureSymmLine,
)

from atomate2.jdftx.files import write_jdftx_input_set
from atomate2.jdftx.run import run_jdftx, should_stop_children
from atomate2.jdftx.schemas.task import TaskDoc

logger = logging.getLogger(__name__)

_DATA_OBJECTS = [ # TODO update relevant list for JDFTx
BandStructure,
BandStructureSymmLine,
Trajectory,
"force_constants",
"normalmode_eigenvecs",
"bandstructure", # FIX: BandStructure is not currently MSONable
]

_INPUT_FILES = [
"init.in",
"init.lattice",
"init.ionpos",
]

# Output files.
_OUTPUT_FILES = [ # TODO finish this list
"output.out",
"Ecomponents",
"wfns",
"bandProjections",
"boundCharge",
"lattice",
"ionpos",
]


def jdftx_job(method: Callable) -> job:
"""
Decorate the ``make`` method of JDFTx job makers.

Parameters
----------
method : callable
A BaseJdftxMaker.make method. This should not be specified directly and is
implied by the decorator.

Returns
-------
callable
A decorated version of the make function that will generate JDFTx jobs.
"""
return job(method, data=_DATA_OBJECTS, output_schema=TaskDoc)


@dataclass
class BaseJdftxMaker(Maker):
"""
Base JDFTx job maker.

Parameters
----------
name : str
The job name.
input_set_generator : .JdftxInputGenerator
A generator used to make the input set.
write_input_set_kwargs : dict
Keyword arguments that will get passed to :obj:`.write_jdftx_input_set`.
run_jdftx_kwargs : dict
Keyword arguments that will get passed to :obj:`.run_jdftx`.
task_document_kwargs : dict
Keyword arguments that will get passed to :obj:`.TaskDoc.from_directory`.

"""

name: str = "base JDFTx job"
input_set_generator: JdftxInputGenerator = field(
default_factory=JdftxInputGenerator
)
write_input_set_kwargs: dict = field(default_factory=dict)
run_jdftx_kwargs: dict = field(default_factory=dict)
task_document_kwargs: dict = field(default_factory=dict)

@jdftx_job
def make(self, structure: Structure) -> Response:
"""Run a JDFTx calculation.

Parameters
----------
structure : Structure
A pymatgen structure object.

Returns
-------
Response: A response object containing the output, detours and stop
commands of the JDFTx run.
"""
# write jdftx input files
write_jdftx_input_set(
structure, self.input_set_generator, **self.write_input_set_kwargs
)
logger.info("Wrote JDFTx input files.")
# run jdftx
run_jdftx(**self.run_jdftx_kwargs)

current_dir = os.getcwd()
task_doc = get_jdftx_task_document(current_dir, **self.task_document_kwargs)

stop_children = should_stop_children(task_doc)

return Response(
stop_children=stop_children,
stored_data={},
output=task_doc,
)


def get_jdftx_task_document(path: Path | str, **kwargs) -> TaskDoc:
"""Get JDFTx Task Document using atomate2 settings."""
return TaskDoc.from_directory(path, **kwargs)
50 changes: 50 additions & 0 deletions src/atomate2/jdftx/jobs/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Core jobs for running JDFTx calculations."""

from __future__ import annotations

import logging
from dataclasses import dataclass, field
from typing import TYPE_CHECKING

from atomate2.jdftx.jobs.base import BaseJdftxMaker
from atomate2.jdftx.sets.core import (
IonicMinSetGenerator,
LatticeMinSetGenerator,
SinglePointSetGenerator,
)

if TYPE_CHECKING:
from atomate2.jdftx.sets.base import JdftxInputGenerator


logger = logging.getLogger(__name__)


@dataclass
class SinglePointMaker(BaseJdftxMaker):
"""Maker to create JDFTx ionic optimization job."""

name: str = "single_point"
input_set_generator: JdftxInputGenerator = field(
default_factory=SinglePointSetGenerator
)


@dataclass
class IonicMinMaker(BaseJdftxMaker):
"""Maker to create JDFTx ionic optimization job."""

name: str = "ionic_min"
input_set_generator: JdftxInputGenerator = field(
default_factory=IonicMinSetGenerator
)


@dataclass
class LatticeMinMaker(BaseJdftxMaker):
"""Maker to create JDFTx lattice optimization job."""

name: str = "lattice_min"
input_set_generator: JdftxInputGenerator = field(
default_factory=LatticeMinSetGenerator
)
Loading