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

Plotting ncl densities #120

Merged
merged 40 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1384592
Rewrite density to allow for extension towards tau and j; allow multi…
Dec 5, 2023
0ca3de0
bunch of documentation and Density.selections() to see available opti…
Dec 14, 2023
4ab2b08
capital letters
Dec 15, 2023
6cf7819
change nonpolarized to is_nonpolarized etc. to stress boolean character
Dec 17, 2023
11c7ffe
call _raise_error_if_color_is_specified
Dec 17, 2023
24867f4
check each component of noncollinear density plot
Dec 17, 2023
21276cc
check each component of noncollinear density plot (fix)
Dec 17, 2023
b92b101
fix component is str
Dec 17, 2023
cef00e7
consider 3 components of magnetization in reference output
Dec 17, 2023
1439894
consider 3 components of magnetization in reference output
Dec 17, 2023
31f5848
consider 3 components of magnetization in reference output (fix)
Dec 17, 2023
6906534
consider 3 components of magnetization in reference output (test fix)
Dec 17, 2023
e1cf394
maybe need to use order (documentation, import_, select) in import
Dec 17, 2023
68faa6b
apply code style
Dec 17, 2023
8d2510d
Refactor test
martin-schlipf Dec 19, 2023
e66c47e
Implement selections for density
martin-schlipf Dec 19, 2023
f87ddc4
Add selections for source to all classes
martin-schlipf Dec 19, 2023
2acb1c6
Update documentation, rename source to *quantity*
martin-schlipf Dec 19, 2023
cc09616
Rename source to density
martin-schlipf Dec 19, 2023
cec932a
Add _selection property
martin-schlipf Dec 19, 2023
ae5711e
Return density in different format for other sources
martin-schlipf Dec 19, 2023
01d7f1b
Add missing decorator
martin-schlipf Dec 19, 2023
ba16806
Make use_number_labels optional
martin-schlipf Dec 19, 2023
e0cdd6f
Make plotting work for more densities
martin-schlipf Dec 19, 2023
687268a
Remove print statement
martin-schlipf Dec 19, 2023
efb7edb
Fix plots for collinear systems
martin-schlipf Dec 19, 2023
d0dd23b
Implement plotting of ncl densities
martin-schlipf Dec 19, 2023
2a4d592
Raise error if accessing noncollinear parts
martin-schlipf Dec 19, 2023
1ba915c
Do not test plotting for py4vasp-core
martin-schlipf Dec 19, 2023
de1d213
Fix code style
martin-schlipf Dec 19, 2023
4e27921
Write which kind of density to string
martin-schlipf Dec 20, 2023
0147493
Add to_numpy function
martin-schlipf Dec 20, 2023
558ba01
Implement aliases for density
martin-schlipf Dec 21, 2023
4cc4b55
Format sources that are aliases different in YAML output
martin-schlipf Dec 21, 2023
ae3f327
Filter out magnetization from noncollinear density
martin-schlipf Dec 21, 2023
a7eac67
Print error message if noncollinear magnetization but no component
martin-schlipf Dec 21, 2023
a00a483
Comment out transformation to standard form
martin-schlipf Dec 21, 2023
4db2f18
Fix origin of moments vectors
martin-schlipf Dec 21, 2023
2f28d50
Add kinetic energy density
martin-schlipf Dec 22, 2023
925f7d0
Fix broken test
martin-schlipf Dec 22, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
# File open for editing in vi
*.swp
# autogenerated by dephell
Expand Down
24 changes: 23 additions & 1 deletion src/py4vasp/_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def path(self):
def _raw_data(self):
return self._data_context.data

@property
def _selection(self):
return self._data_context.selection

@data_access
def print(self):
"Print a string representation of this instance."
Expand All @@ -131,6 +135,23 @@ def read(self, *args, **kwargs):
"Convenient wrapper around to_dict. Check that function for examples and optional arguments."
return self.to_dict(*args, **kwargs)

@data_access
def selections(self):
"""Returns possible alternatives for this particular quantity VASP can produce.

The returned dictionary contains a single item with the name of the quantity
mapping to all possible selections. Each of these selection may be passed to
other functions of this quantity to select which output of VASP is used.

Returns
-------
dict
The key indicates this quantity and the values possible choices for arguments
to other functions of this quantity.
"""
sources = list(raw.selections(self._data_context.quantity))
return {self._data_context.quantity: sources}

def _repr_pretty_(self, p, cycle):
p.text(str(self))

Expand Down Expand Up @@ -308,4 +329,5 @@ def __exit__(self, *_):
self._stack.close()

def set_selection(self, selection):
self.selection = selection
if self._counter == 0:
self.selection = selection
Loading