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

JDFTx IO module #4078

Open
wants to merge 271 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
271 commits
Select commit Hold shift + click to select a range
f2b326b
Merge branch 'master' of https://github.com/benrich37/pymatgen
benrich37 Sep 24, 2024
f717825
Updated .gitignore
benrich37 Sep 24, 2024
c542270
add codecov workflow
benrich37 Sep 24, 2024
97b276c
Update codecov.yml
benrich37 Sep 24, 2024
e1a4ea5
removed old main yaml
benrich37 Sep 24, 2024
1005340
Merge branch 'master' of https://github.com/benrich37/pymatgen
benrich37 Sep 24, 2024
694229b
updating gitignore
benrich37 Sep 24, 2024
e61a6c3
unwanted files
benrich37 Sep 24, 2024
407ec14
Expanding test coverage + correct some return type annotations
benrich37 Sep 24, 2024
a68f733
Notes and function fix
benrich37 Sep 24, 2024
0a28ae3
Changing which should be None or not, correct incorrect return types …
benrich37 Sep 24, 2024
e36a480
Changing which should be None or not, correct incorrect return types …
benrich37 Sep 24, 2024
e05336f
Changing which should be None or not, correct incorrect return types …
benrich37 Sep 24, 2024
2da64f3
Updating for greater coverage - currently 88%
benrich37 Sep 24, 2024
ca316b6
Removing accidentally added workflow
benrich37 Sep 24, 2024
8c5768f
pre-commit auto-fixes
pre-commit-ci[bot] Sep 24, 2024
633beb2
Expanding coverage for generic_tags
benrich37 Sep 25, 2024
5e7253c
Expanding coverage for generic_tags
benrich37 Sep 25, 2024
af7432e
Expanding coverage for jdftxoutfileslice
benrich37 Sep 25, 2024
943f0c7
Wrong error raise approach
benrich37 Sep 25, 2024
8e21488
Expanding coverage for generic_tags and commenting out unused/unreach…
benrich37 Sep 25, 2024
0127c44
Merge pull request #1 from benrich37/input_cov
benrich37 Sep 25, 2024
4b36b3f
Merge branch 'materialsproject:master' into master
benrich37 Sep 25, 2024
4de40b9
Additional coverage along with changes I cannot keep track of - in re…
benrich37 Sep 25, 2024
016dec8
replacing read/write methods of multiformattag with dummy error-raisi…
benrich37 Sep 25, 2024
c3be668
new coverage
benrich37 Sep 25, 2024
c60760b
Adding fix for incorrect site label initialization of JDFTXInfile
benrich37 Sep 25, 2024
e22fd8e
Merge pull request #2 from benrich37/input_cov
benrich37 Sep 25, 2024
003d827
Forgot to make eigstats optional!
benrich37 Sep 26, 2024
33bbe5e
Thank you @soge for identifying lack of eigstats should not break cal…
benrich37 Sep 26, 2024
0aac15d
Thank you @soge for identifying lack of eigstats should not break cal…
benrich37 Sep 26, 2024
81f7c6d
File added to make new_files dir exist
benrich37 Sep 26, 2024
1bec681
Merge pull request #3 from benrich37/new_files_dir
benrich37 Sep 26, 2024
599a7d2
Merge remote-tracking branch 'origin' into input_cov
benrich37 Sep 26, 2024
e6a201e
get_Start_lines error handling test
benrich37 Sep 26, 2024
f5214a5
removed empty case scenario for find_first_range_key that didn't seem…
benrich37 Sep 26, 2024
66a81e6
tests for find_first_range_key
benrich37 Sep 26, 2024
d7b6e9d
Removing unreachable warning
benrich37 Sep 26, 2024
ea6e791
joutstructures_start_idx test and no-find case fix
benrich37 Sep 26, 2024
47dfdb8
Moving all utility functions to the utils module
benrich37 Sep 26, 2024
ffe0a45
Moving all utility functions to the utils module
benrich37 Sep 26, 2024
010f80e
Moving all utility functions to the utils module
benrich37 Sep 26, 2024
9338d37
Moving all utility functions and classes to the utils module
benrich37 Sep 26, 2024
b53ae83
Moved all utility functions and classes to the utils module.
benrich37 Sep 26, 2024
b4f39ba
Moving util tests to test_utils
benrich37 Sep 26, 2024
c0063b3
Removing unused helper modules
benrich37 Sep 27, 2024
19ca3a8
Reducing clutter for code review
benrich37 Sep 28, 2024
877e24e
Reducing clutter
benrich37 Sep 28, 2024
7cb3f01
Removing TODO from README
benrich37 Sep 28, 2024
9c6ef03
Reorganization of testing + starting the broader "JDFTxOutput" class
benrich37 Sep 29, 2024
4fe5b14
Merge branch 'materialsproject:master' into master
benrich37 Sep 29, 2024
06ad142
Merge remote-tracking branch 'origin' into input_cov
benrich37 Sep 29, 2024
296b4bb
Generalizing the 1/2 layer AttributeError to a pytest fixture
benrich37 Sep 29, 2024
d2888f0
de-clutter
benrich37 Sep 29, 2024
587084a
Commenting out new content before master merge
benrich37 Sep 29, 2024
745469c
Merge pull request #4 from benrich37/input_cov
benrich37 Sep 29, 2024
5614db8
Adding jdftx out file typos to codespell ignore words list
benrich37 Oct 1, 2024
4786de8
Merge remote-tracking branch 'origin' into input_cov
benrich37 Oct 1, 2024
22fb1a3
Merge pull request #5 from benrich37/input_cov
benrich37 Oct 1, 2024
2b6cad4
Merge branch 'materialsproject:master' into master
benrich37 Oct 2, 2024
5d4a0ac
Moving module information into __init__.py
benrich37 Oct 2, 2024
e2a521b
Addressing redundancy of contents of "data.py" to data you can refere…
benrich37 Oct 2, 2024
cfc30b0
Removing valence electron dictionary
benrich37 Oct 2, 2024
6bdcf30
Removing commented out method
benrich37 Oct 2, 2024
56108d3
Merge pull request #6 from benrich37/review_edits
benrich37 Oct 2, 2024
f79dcd1
Adding edit to the "valence" property as described in review comment …
benrich37 Oct 3, 2024
5a1d29a
Merge branch 'materialsproject:master' into period_table_edits
benrich37 Oct 3, 2024
7278468
Merge remote-tracking branch 'origin' into period_table_edits
benrich37 Oct 3, 2024
34ae7ee
Merge branch 'period_table_edits' of https://github.com/benrich37/pym…
benrich37 Oct 3, 2024
6095f51
Merge branch 'materialsproject:master' into master
benrich37 Oct 3, 2024
c1e1f71
Merge branch 'materialsproject:master' into master
benrich37 Oct 4, 2024
f1244b8
Adding imports to jdftx module's __init__ so I can start using this p…
benrich37 Oct 4, 2024
c46d34a
Merge pull request #7 from benrich37/flexible_imports
benrich37 Oct 4, 2024
f822c11
Merge branch 'materialsproject:master' into master
benrich37 Oct 14, 2024
be6d33d
Merge branch 'master' into master
shyuep Oct 21, 2024
6fff840
Merge branch 'materialsproject:master' into master
benrich37 Oct 21, 2024
26a69d1
Merge branch 'materialsproject:master' into master
benrich37 Oct 22, 2024
39fb398
Merge remote-tracking branch 'origin' into period_table_edits
benrich37 Oct 22, 2024
359261d
Replacing "get_Atom_valence_electrons" function with newly added "Val…
benrich37 Oct 22, 2024
f06b447
Merge pull request #8 from benrich37/period_table_edits
benrich37 Oct 22, 2024
681abb1
Changing naming of JEiter(s) to JElStep(s), adding dataclass inheritance
benrich37 Oct 22, 2024
ad37d01
removing unused file
benrich37 Oct 22, 2024
b6ccf17
Merge pull request #9 from benrich37/jeiters_rename
benrich37 Oct 22, 2024
5dfcd27
Fix for Species class's valence(s) property
benrich37 Oct 23, 2024
d8e0efb
Merge pull request #10 from benrich37/period_table_edits
benrich37 Oct 23, 2024
b512704
Merge branch 'materialsproject:master' into master
benrich37 Oct 23, 2024
7ec74b4
Changing JMinSettings class to just have a "params" variable to avoid…
benrich37 Oct 23, 2024
3f18616
Fix for __getattr__ on jdftxoutfileslice not being able to access pro…
benrich37 Oct 23, 2024
f37b51a
Merge pull request #11 from benrich37/period_table_edits
benrich37 Oct 23, 2024
65c2c4e
Adding testing of out file that previously threw an error
benrich37 Oct 23, 2024
9494e82
Merge pull request #12 from benrich37/period_table_edits
benrich37 Oct 23, 2024
b9e0454
Merge branch 'materialsproject:master' into master
benrich37 Oct 24, 2024
1dc0c38
Merge branch 'materialsproject:master' into master
benrich37 Oct 25, 2024
dc6e78f
Merge branch 'materialsproject:master' into master
benrich37 Oct 28, 2024
0ec5be7
Merge branch 'materialsproject:master' into master
benrich37 Oct 30, 2024
4c36b7e
Adding more informative docustrings for JDFTXOutfile and low-priority…
benrich37 Oct 31, 2024
27fc3b4
Merge pull request #13 from benrich37/docustrings
benrich37 Oct 31, 2024
7550e86
Removing commented out code
benrich37 Oct 31, 2024
4e5652b
Removing commented out code
benrich37 Oct 31, 2024
ff16894
Removing unused test files in wrong directory
benrich37 Oct 31, 2024
1db9afc
removing commented out code, clarifying language
benrich37 Oct 31, 2024
2b93194
Merge pull request #14 from benrich37/liveshare
benrich37 Oct 31, 2024
6cdf6ed
test to assert that joustructure's can be created and store data inde…
benrich37 Oct 31, 2024
b37216b
outfile for Etot etype and testing instance var behavior for JOutStru…
benrich37 Oct 31, 2024
424d791
Merge pull request #15 from benrich37/classvar_fix
benrich37 Oct 31, 2024
a71541d
Changing naming convention of step number (previously "niter") to "ns…
benrich37 Nov 1, 2024
9a60efe
Changing naming convention of step number (previously "niter") to "ns…
benrich37 Nov 1, 2024
a274fca
Backing up changes - need to make a deep change on how JOutStructure …
benrich37 Nov 1, 2024
71d5767
Merge pull request #16 from benrich37/classvar_fix
benrich37 Nov 1, 2024
c25a11e
Letting more values be None
benrich37 Nov 1, 2024
3eeda8d
Letting more values be None
benrich37 Nov 1, 2024
2551485
removing commented out code block
benrich37 Nov 1, 2024
3b9a415
Disabling block of pseudopotentials not of GBRV or SG15 (relevant dat…
benrich37 Nov 1, 2024
e065042
Debugging new behavior and untested old behavior
benrich37 Nov 2, 2024
c4144c9
Merge branch 'master' into relax_req_vars
benrich37 Nov 2, 2024
52c835d
Merge pull request #17 from benrich37/relax_req_vars
benrich37 Nov 2, 2024
15438c1
pre-commit auto-fixes
pre-commit-ci[bot] Nov 2, 2024
ac69082
removing commented out code, renaming "iter_type" to "step_type"
benrich37 Nov 2, 2024
cca29ed
should be lower-case e
benrich37 Nov 2, 2024
dfe0de2
remove completed todo
benrich37 Nov 2, 2024
78c06a6
Filling in missing information in docustrings
benrich37 Nov 2, 2024
9d53a2f
Adding language to docustrings to provide context to attributes
benrich37 Nov 4, 2024
761e8a4
Completing incomplete refactoring (renaming backup variables to be pr…
benrich37 Nov 4, 2024
e562bf8
removing commented out code
benrich37 Nov 4, 2024
726c7a2
Moving "get_pseudo_read_section_bounds" utility function to jdftxoutf…
benrich37 Nov 4, 2024
843863b
Moving "is_<logtype>_start_line" utility functions to joutstructure a…
benrich37 Nov 4, 2024
943558f
Removing "data" module as it is no longer used
benrich37 Nov 4, 2024
765548b
Making changes to stringify/repr behavior for IO module objects to ca…
benrich37 Nov 5, 2024
fe9aa8a
Moving JDFTXInfile and JDFTXOutfile to inputs and outputs module, res…
benrich37 Nov 5, 2024
30e8de7
Removing commented out testing
benrich37 Nov 5, 2024
8d9e9c2
Updated module docustring
benrich37 Nov 5, 2024
cf3e3c2
Modified docustrings
benrich37 Nov 5, 2024
d4355a4
Merge pull request #18 from benrich37/cleanup
benrich37 Nov 5, 2024
cc5e06e
Removing unused modules and commented out code. Adding options for fl…
benrich37 Nov 5, 2024
f7b3153
Modifying comments, removing empty "sets" module for now
benrich37 Nov 6, 2024
d1b2121
Tagging @mkhorton in files ready to be reviewed
benrich37 Nov 6, 2024
2c93b42
Removing empty jdftxoutput module
benrich37 Nov 6, 2024
233c04e
Tagging @mkhorton on files ready to review + adding context to some d…
benrich37 Nov 6, 2024
6ab4f49
Tagging @mkhorton on files ready to review
benrich37 Nov 6, 2024
0dd1922
Merge pull request #19 from benrich37/cleanup
benrich37 Nov 6, 2024
00e068b
Adding an explicit pytest module for testing built-in representation …
benrich37 Nov 11, 2024
68bb469
Removing overwrite of "dir" for JDFTXOutfile
benrich37 Nov 11, 2024
82fd73f
Removing commented out testing
benrich37 Nov 11, 2024
b6d183c
Merge pull request #20 from benrich37/cleanup
benrich37 Nov 11, 2024
412a099
Merge branch 'materialsproject:master' into master
benrich37 Nov 12, 2024
fc72497
First type check syntax fix for linux workstation
benrich37 Nov 13, 2024
23112ef
Second type check syntax fix for linux workstation
benrich37 Nov 13, 2024
c8661d3
Third type check syntax fix for linux workstation
benrich37 Nov 13, 2024
0152f43
Removing commented out code
benrich37 Nov 13, 2024
6155328
Merge pull request #21 from benrich37/cleanup
benrich37 Nov 13, 2024
739553e
Merge branch 'materialsproject:master' into master
benrich37 Nov 13, 2024
e36302a
Moving project .gitignore exceptions added for files generated by cod…
benrich37 Nov 13, 2024
82c8e5a
Merge pull request #22 from benrich37/cleanup
benrich37 Nov 13, 2024
6135815
Adding problem out file which does not inherit initial lattice correc…
benrich37 Nov 13, 2024
01ba92d
Merge branch 'materialsproject:master' into master
benrich37 Nov 13, 2024
07dee61
Adding problem out file which does not inherit initial lattice correc…
benrich37 Nov 14, 2024
3d42909
Merge pull request #23 from benrich37/cleanup
benrich37 Nov 14, 2024
9780b8f
Added "initial_structure" keyword arguments to allow for default Stru…
benrich37 Nov 14, 2024
15f3dfe
Merge pull request #24 from benrich37/jstruc_init
benrich37 Nov 14, 2024
b95190c
Moving question from comment to discussion post
benrich37 Nov 14, 2024
67c9731
Merge pull request #25 from benrich37/jstruc_init
benrich37 Nov 14, 2024
36d0ec2
Fixed MultiformatTag's _determine_format_option to interpret KeyError…
benrich37 Nov 18, 2024
a7b1a2a
Merge pull request #26 from benrich37/jstruc_init
benrich37 Nov 18, 2024
b886aca
Merge branch 'master' into master
benrich37 Nov 18, 2024
953b0fd
Merge pull request #27 from benrich37/master
benrich37 Nov 18, 2024
55c0db0
Adding "tests/files/io/jdftx/*" to codespell exception
benrich37 Nov 18, 2024
b86097a
Merge pull request #28 from benrich37/jstruc_init
benrich37 Nov 18, 2024
af828ed
Changing shortening of "structure" from "struc" to "struct" as no lon…
benrich37 Nov 18, 2024
68788bd
Merge pull request #29 from benrich37/jstruc_init
benrich37 Nov 18, 2024
62aac6e
adding option for JDFTXOutfileSlice's to be initialized as None if th…
benrich37 Nov 19, 2024
9e8d679
Merge pull request #30 from benrich37/jstruc_init
benrich37 Nov 19, 2024
dc16edf
Converting JElSteps(s) docustrings to google style, privatizing non-u…
benrich37 Nov 20, 2024
c74982a
Merge pull request #31 from benrich37/google_docustring
benrich37 Nov 20, 2024
617388a
fixing incomplete function renaming refactoring
benrich37 Nov 20, 2024
655f82f
fixing incomplete function renaming refactoring
benrich37 Nov 20, 2024
1971d6b
privatizing JOutStructure initialization helpers, converting docustri…
benrich37 Nov 20, 2024
9d76fa1
privatizing JOutStructures initialization helpers, converting docustr…
benrich37 Nov 20, 2024
088ef5a
privatizing JOutStructures initialization helpers, converting docustr…
benrich37 Nov 20, 2024
fb74784
privatizing JDFTXOutfileSlice initialization helpers, converting docu…
benrich37 Nov 20, 2024
b0e70dd
converting docustrings to google style
benrich37 Nov 20, 2024
8e29a72
incomplete renaming fixes, protection from setting magnetic moments a…
benrich37 Nov 20, 2024
4767acd
privitizing jdftx io utils module
benrich37 Nov 20, 2024
0863bff
privitizing jdftx io utils module
benrich37 Nov 20, 2024
255e231
docustring update to google style
benrich37 Nov 20, 2024
0ff300a
docustring update to google style
benrich37 Nov 20, 2024
ef68b2a
site_properties behavior correction
benrich37 Nov 20, 2024
ed462f8
Merge pull request #32 from benrich37/google_docustring
benrich37 Nov 20, 2024
1f40d6a
syncing unit test for testing valences from feature-ptable branch
benrich37 Nov 21, 2024
9cde579
renaming test file
benrich37 Nov 21, 2024
79fdae8
Merge pull request #33 from benrich37/inout_sepr
benrich37 Nov 21, 2024
ce9e809
separating _utils.py into _input_utils.py and _output_utils.py
benrich37 Nov 21, 2024
8c2ba37
updating module docustring for _output_utils
benrich37 Nov 21, 2024
505d046
Merge pull request #34 from benrich37/inout_sepr
benrich37 Nov 21, 2024
12c347f
input/output utils testing separation
benrich37 Nov 21, 2024
0719540
Merge pull request #35 from benrich37/inout_sepr
benrich37 Nov 21, 2024
cfd9041
sourcing changes made in feature-jdftx-inputs
benrich37 Nov 21, 2024
16ccfb0
renaming test file to matching renaming of "JEiters" to "JElSteps"
benrich37 Nov 21, 2024
6feb998
Moving test files to directories with more descriptive names, removin…
benrich37 Nov 22, 2024
175a720
moving multi_(has/get)_attr from output utils to inputs.py (only used…
benrich37 Nov 22, 2024
38c2918
Merge pull request #36 from benrich37/inout_sepr
benrich37 Nov 22, 2024
6af3d14
changing enumeration of valence electrons (the `valences` method does…
benrich37 Nov 22, 2024
efd3fdb
explicit testing of "initial-magnetic-moments"
benrich37 Nov 25, 2024
974db67
added "to_dict" method to JDFTXOutfile
benrich37 Nov 26, 2024
b4d77fe
adding `JDFTXOutfileSlice` to "test_dict_repr" in "test_repr_out.py"
benrich37 Nov 26, 2024
4bd2e34
removing fatal error from retrieving t_s from a JOutStructure that is…
benrich37 Nov 26, 2024
767dd0e
Correction for ruff - PLC0206 (Extracting value from dictionary witho…
benrich37 Nov 26, 2024
d9cb349
changing the previous "as_dict" method to be private, making a public…
benrich37 Nov 28, 2024
b3c807d
removing __getattr__ and writing allocating everything in the __posti…
benrich37 Dec 2, 2024
79fe430
replaced all properties within JDFTXOutfile and JDFTXOutfileSlice as …
benrich37 Dec 3, 2024
0a229e4
removing review requests for files with anticipated changes coming up
benrich37 Dec 3, 2024
0d99812
replaced all properties within JElStep(s) and JOutStructure as initia…
benrich37 Dec 3, 2024
8f8cfd2
Cleaning up __post_init__ methods to iterate over a list of variables…
benrich37 Dec 3, 2024
52f507f
removing now unneeded __getattr__ from JDFTXOutfileSlice, no longer h…
benrich37 Dec 3, 2024
9ac207c
consistent "to_dict" methods
benrich37 Dec 3, 2024
b4eb059
Removing references to properties
benrich37 Dec 3, 2024
515f2a2
Merge pull request #37 from benrich37/prop_to_attr
benrich37 Dec 3, 2024
6508d4c
adding **kwargs for JOutStructure for flexibility
benrich37 Dec 3, 2024
5b69163
"from_calc_dir" init method for JDFTXOutfile
benrich37 Dec 4, 2024
3b64523
Partial cleanup of tests
benrich37 Dec 4, 2024
c95fbf1
Partial cleanup of tests
benrich37 Dec 4, 2024
aa38457
Partial cleanup of tests
benrich37 Dec 4, 2024
8a28935
parsing for necessary data to interact with eigenvals + projections f…
benrich37 Dec 5, 2024
6664361
updates to necessary stored metadata and example files for testing
benrich37 Dec 5, 2024
07179e2
Adding "structure" attribute to JOutStructure for convenient way to a…
benrich37 Dec 9, 2024
d12344f
Merge pull request #38 from benrich37/gen_outputs
benrich37 Dec 9, 2024
20a0428
Changed trajectory to pull from Structure objects (instead of JOutStr…
benrich37 Dec 9, 2024
d549434
None-type protection for setting constant_lattice in JDFTXOutfileSlic…
benrich37 Dec 9, 2024
44e7ae2
Merge pull request #39 from benrich37/gen_outputs
benrich37 Dec 9, 2024
c532f39
oversight - this should've always been a Structure
benrich37 Dec 9, 2024
9451dd4
Cleanup of inputs - homogenized wording in error messages, added valu…
benrich37 Dec 10, 2024
2872483
Merge branch 'materialsproject:master' into master
benrich37 Dec 12, 2024
6416dfc
populating attributes taken from `jstrucs` for `JDFTXOutfileSlice` wi…
benrich37 Dec 14, 2024
fe6a8b9
Removing commented out code (all attributes set within the above for …
benrich37 Dec 20, 2024
bcc9d1d
fixes to consistent ion coordinate units - added missing bohr_to_ang …
benrich37 Dec 20, 2024
f4cf97f
fixes for formatting on TagContainer writing with linebreak_nth_entry
benrich37 Dec 20, 2024
6911419
removing commented out code
benrich37 Dec 20, 2024
8c02246
activating none_slice_on_error behavior for all outfile slices EXCEPT…
benrich37 Dec 20, 2024
e34ac7f
fixed cartesian coords in from_jdftxinfile method and added Etot to p…
cote3804 Dec 21, 2024
73cc187
Merge pull request #1 from cote3804/jdftx-coords
cote3804 Dec 21, 2024
13c4c3a
fixed oversight on how 'none_slice_bools' are set on the 'none_slice_…
benrich37 Dec 23, 2024
a3384e6
Merge pull request #2 from cote3804/jdftx-coords
cote3804 Jan 7, 2025
299b6ee
Merge pull request #40 from cote3804/master
benrich37 Jan 13, 2025
b5ea1b6
pre-commit auto-fixes
pre-commit-ci[bot] Jan 13, 2025
67a44cd
Merge pull request #41 from materialsproject/master
benrich37 Jan 13, 2025
1185d95
Changing all "zopen" to just "open" due to an error raised when monty…
benrich37 Jan 14, 2025
7a6b0ad
Merge pull request #42 from benrich37/setup_teardown_inputs
benrich37 Jan 14, 2025
510d88a
Storing a list of the orbital labels instead of a dictionary of orbit…
benrich37 Jan 15, 2025
17c6e40
Merge pull request #43 from benrich37/gen_outputs
benrich37 Jan 15, 2025
ecf7072
optional "outfile_name" argument for "from_calc_dir" for JDFTXOutputs…
benrich37 Jan 15, 2025
2c7c4b0
Merge branch 'materialsproject:master' into master
benrich37 Jan 16, 2025
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ setuptools*
.*_cache
# VS Code
.vscode/*
.coverage*

# Environments
.env
Expand All @@ -37,3 +38,7 @@ ENV/
env.bak/
venv.bak/
.pdm-python

# Local runners
actions-runner/
actions-runner/*
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ skip = """*.json,
src/pymatgen/analysis/chemenv/coordination_environments/coordination_geometries_files/allcg.txt,
src/pymatgen/entries/MPCompatibility.yaml,
tests/io/lammps/test_inputs.py,
tests/files/io/jdftx/*
"""
check-filenames = true

Expand Down
53 changes: 34 additions & 19 deletions src/pymatgen/core/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

from pymatgen.util.typing import SpeciesLike


# Load element data from JSON file
with open(Path(__file__).absolute().parent / "periodic_table.json", encoding="utf-8") as ptable_json:
_pt_data = json.load(ptable_json)
Expand Down Expand Up @@ -213,7 +214,7 @@ def __getattr__(self, item: str) -> Any:
if val is None or str(val).startswith("no data"):
warnings.warn(f"No data available for {item} for {self.symbol}", stacklevel=2)
val = None
elif isinstance(val, list | dict):
elif isinstance(val, dict | list):
pass
else:
try:
Expand Down Expand Up @@ -486,28 +487,35 @@ def n_electrons(self) -> int:
return sum(t[-1] for t in self.full_electronic_structure)

@property
def valence(self) -> tuple[int | np.nan, int]:
def valences(self) -> list[tuple[int | np.nan, int]]:
"""Valence subshell angular moment (L) and number of valence e- (v_e),
obtained from full electron config, where L=0, 1, 2, or 3 for s, p, d,
and f orbitals, respectively.
"""
if self.group == 18:
return np.nan, 0 # The number of valence of noble gas is 0
return [(np.nan, 0)] # The number of valence of noble gas is 0

L_symbols = "SPDFGHIKLMNOQRTUVWXYZ"
valence: list[tuple[int, int]] = []
valences: list[tuple[int | np.nan, int]] = []
full_electron_config = self.full_electronic_structure
last_orbital = full_electron_config[-1]
for n, l_symbol, ne in full_electron_config:
idx = L_symbols.lower().index(l_symbol)
if ne < (2 * idx + 1) * 2 or (
(n, l_symbol, ne) == last_orbital and ne == (2 * idx + 1) * 2 and len(valence) == 0
(n, l_symbol, ne) == last_orbital and ne == (2 * idx + 1) * 2 and len(valences) == 0
): # check for full last shell (e.g. column 2)
valence.append((idx, ne))
if len(valence) > 1:
raise ValueError(f"{self} has ambiguous valence")
valences.append((idx, ne))
return valences

return valence[0]
@property
def valence(self) -> tuple[int | np.nan, int]:
"""Valence subshell angular moment (L) and number of valence e- (v_e),
obtained from full electron config, where L=0, 1, 2, or 3 for s, p, d,
and f orbitals, respectively.
"""
if len(self.valences) > 1:
raise ValueError(f"{self} has ambiguous valence")
return self.valences[0]

@property
def term_symbols(self) -> list[list[str]]:
Expand All @@ -534,7 +542,7 @@ def term_symbols(self) -> list[list[str]]:
# Total ML = sum(ml1, ml2), Total MS = sum(ms1, ms2)
TL = [sum(ml_ms[comb[e]][0] for e in range(v_e)) for comb in e_config_combs]
TS = [sum(ml_ms[comb[e]][1] for e in range(v_e)) for comb in e_config_combs]
comb_counter = Counter(zip(TL, TS, strict=True))
comb_counter: Counter = Counter(zip(TL, TS, strict=True))

term_symbols = []
L_symbols = "SPDFGHIKLMNOQRTUVWXYZ"
Expand Down Expand Up @@ -1199,28 +1207,35 @@ def n_electrons(self) -> int:
# NOTE - copied exactly from Element. Refactoring / inheritance may improve
# robustness
@property
def valence(self) -> tuple[int | np.nan, int]:
"""Valence subshell angular moment (L) and number of valence e- (v_e),
def valences(self) -> list[tuple[int | np.nan, int]]:
"""List of valence subshell angular moment (L) and number of valence e- (v_e),
obtained from full electron config, where L=0, 1, 2, or 3 for s, p, d,
and f orbitals, respectively.
"""
if self.group == 18:
return np.nan, 0 # The number of valence of noble gas is 0
return [(np.nan, 0)] # The number of valence of noble gas is 0

L_symbols = "SPDFGHIKLMNOQRTUVWXYZ"
valence: list[tuple[int, int]] = []
valences: list[tuple[int | np.nan, int]] = []
full_electron_config = self.full_electronic_structure
last_orbital = full_electron_config[-1]
for n, l_symbol, ne in full_electron_config:
idx = L_symbols.lower().index(l_symbol)
if ne < (2 * idx + 1) * 2 or (
(n, l_symbol, ne) == last_orbital and ne == (2 * idx + 1) * 2 and len(valence) == 0
(n, l_symbol, ne) == last_orbital and ne == (2 * idx + 1) * 2 and len(valences) == 0
): # check for full last shell (e.g. column 2)
valence.append((idx, ne))
if len(valence) > 1:
raise ValueError(f"{self} has ambiguous valence")
valences.append((idx, ne))
return valences

return valence[0]
@property
def valence(self) -> tuple[int | np.nan, int]:
"""Valence subshell angular moment (L) and number of valence e- (v_e),
obtained from full electron config, where L=0, 1, 2, or 3 for s, p, d,
and f orbitals, respectively.
"""
if len(self.valences) > 1:
raise ValueError(f"{self} has ambiguous valence")
return self.valences[0]

@property
def ionic_radius(self) -> float | None:
Expand Down
53 changes: 53 additions & 0 deletions src/pymatgen/io/jdftx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""Module for IO with JDFTx.

This module contains all class objects and methods used for io operations with JDFTX.

This includes:

- JDFTXInfile in jdfxinfile.py:
- Mutable, sub-classes dictionary
- Initializable from pre-existing JDFTx "in" files or dictionaries
- Writes new "in" files
- Extracts Structure objects
- Depends on:
- jdftxinfile_master_format.py which contains information on allowed keys
- jdftxinfile_ref_options.py which contains lists of valid options
- JDFTXOutfile in jdftxoutfile.py:
- Parses JDFTx "out" file
- Contains all typically relevant output variables from a JDFTx geometric optimization or single-point calculation.
- Contains hierarchy of class objects (each contained by the former) for storing data at the following
call frequencies.
- JDFTXOutfileSlice: Per call of JDFTx executable
- One "slice" contains all data output in a single call of JDFTx,
as broken up in the out file by the "**** JDFTx" flag
- JOutStructures: Per call of JDFTx executable (same frequency as parent)
- List of JOutStructure, used in building Trajectory objects by JDFTXOutfile
(does not inherit Trajectory or Structure)
- JOutStructure: Per geometric optimization update (only one for single-point)
- Inheritor of Structure object (contains structural data), also contains electronic minimization data
(see below) and convergence data relevant to the geometric optimization
(forces and Wolfe minimization variables)
- JElSteps: Per geometric optimization update (same frequency as parent)
- List of JElStep as well as convergence data relevant to electronic optimization.
- JElStep: Per SCF update
- Contains all electronic data logged in out file at SCF update frequency.

This folder is currently missing:

- Broader output parsing
- Future versions will still have JDFTXOutfile and all subclasses. However, this class object will likely not be
called directly, and will be a class property of a broader JDFTXOutput class capable of handling dumped output
files (ie electronic density arrays or DOS text files) in tandem to the out file.
- File organization
- Future versions will streamline the user-end interface by having all output-related methods imported through the
outputs.py module and input-related methods imported through the inputs.py module. Class objects may be moved to
these modules from their standalone modules to keep the directory tidy.
- Sets
- Common input sets are currently missing from the sets module.
"""

from __future__ import annotations

# Importing these within in __init__ so that surface-level imports can be made from the module itself
from pymatgen.io.jdftx.inputs import JDFTXInfile
from pymatgen.io.jdftx.outputs import JDFTXOutfile
38 changes: 38 additions & 0 deletions src/pymatgen/io/jdftx/_input_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Module for JDFTx IO module input utils.

Module for JDFTx IO module input utils. Functions kept in this module are here if they are
used by multiple submodules, or if they are anticipated to be used by multiple
submodules in the future.
"""

from __future__ import annotations

from typing import Any


def flatten_list(tag: str, list_of_lists: list[Any]) -> list[Any]:
"""Flatten list of lists into a single list, then stop.

Flatten list of lists into a single list, then stop.

Parameters
----------
tag : str
The tag to flatten the list of lists for.
list_of_lists : list[Any]
The list of lists to flatten.

Returns
-------
list[Any]
The flattened list.
"""
if not isinstance(list_of_lists, list):
raise TypeError(f"{tag}: You must provide a list to flatten_list()!")
flist = []
for v in list_of_lists:
if isinstance(v, list):
flist.extend(flatten_list(tag, v))
else:
flist.append(v)
return flist
Loading