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

Rename tau to kinetic energy #173

Merged
merged 35 commits into from
Nov 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7497775
Convert a Series to a frame through the to_frame method in Series
sudarshanv01 Aug 1, 2023
02d54b6
Implement to_frame for sequence of series
sudarshanv01 Aug 1, 2023
c557f72
Alter to_frame to allow it to take in multiple y-inputs
sudarshanv01 Aug 1, 2023
efca677
Refactor to_frame
sudarshanv01 Aug 1, 2023
9d180c7
Add width to series
sudarshanv01 Aug 1, 2023
18b268d
assert in to_frame that the dimension of weight and y is the same
sudarshanv01 Aug 2, 2023
0bd3f51
Allow different length series to to_frame
sudarshanv01 Aug 2, 2023
cda4814
Create the to_csv method
sudarshanv01 Aug 2, 2023
be04713
Implement to_csv method in the Mixin class
sudarshanv01 Aug 2, 2023
0b35fe1
Add to_csv and to_frame to the Mixin class
sudarshanv01 Aug 3, 2023
30b0b13
Apply black and isort
sudarshanv01 Aug 3, 2023
f5a4881
Added not_core to tests needing pandas
sudarshanv01 Aug 3, 2023
bafcb11
black and isort code formatting
sudarshanv01 Aug 3, 2023
b6db94c
Added more not_core to graph tests
sudarshanv01 Aug 3, 2023
ad66601
Change resolve to absolute when getting absolute path for mixin tests
sudarshanv01 Aug 3, 2023
92b51a4
Added documentation for the and methods
sudarshanv01 Aug 3, 2023
623124a
Update developer depedencies with ipykernel
sudarshanv01 Aug 3, 2023
bcb6f89
Merge branch 'vasp-dev:master' into master
sudarshanv01 Aug 3, 2023
a907827
Allow install github actions to run on pull requests
sudarshanv01 Aug 3, 2023
0d5838f
Merge branch 'master' of github.com:sudarshanv01/py4vasp
sudarshanv01 Aug 3, 2023
7f8739f
Added pip installation of ipykernel into install.yaml
sudarshanv01 Aug 3, 2023
f4f1515
Merge branch 'vasp-dev:master' into master
sudarshanv01 Aug 3, 2023
5c1240d
add pre-commit-config.yaml and pre-commit as a dependency
sudarshanv01 Aug 3, 2023
9a32998
Merge branch 'master' of github.com:sudarshanv01/py4vasp
sudarshanv01 Aug 3, 2023
0671d9e
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Sep 10, 2023
e5e244e
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Sep 25, 2023
f578627
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Oct 4, 2023
9f8a0ae
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Feb 2, 2024
455275b
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Feb 4, 2024
26f3480
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Feb 23, 2024
969b3c1
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Mar 25, 2024
617f7f9
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 May 28, 2024
cf67225
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Jun 9, 2024
e7a1052
Merge branch 'master' of github.com:vasp-dev/py4vasp
sudarshanv01 Nov 12, 2024
5d799ec
rename tau -> kinetic_energy
sudarshanv01 Nov 12, 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
Prev Previous commit
Next Next commit
Add width to series
sudarshanv01 committed Aug 1, 2023
commit 9d180c7f26f4e93653c9e9f30a7c3e5e3c7d1a1b
3 changes: 3 additions & 0 deletions src/py4vasp/_third_party/graph/graph.py
Original file line number Diff line number Diff line change
@@ -162,6 +162,9 @@ def to_frame(self):
df[self._name_column(series, "x", None)] = series.x
for idx, series_y in enumerate(np.atleast_2d(series.y)):
df[self._name_column(series, "y", idx)] = series_y
if series.width is not None:
for idx, series_width in enumerate(np.atleast_2d(series.width)):
df[self._name_column(series, "width", idx)] = series_width
return df

def _name_column(self, series, suffix, idx=None):
13 changes: 12 additions & 1 deletion tests/third_party/graph/test_graph.py
Original file line number Diff line number Diff line change
@@ -306,11 +306,22 @@ def test_convert_sequence_parabola_to_frame(parabola, sine, Assert):
def test_convert_multiple_lines(two_lines, Assert):
graph = Graph(two_lines)
df = graph.to_frame()
assert len(df.columns) == 3
Assert.allclose(df["two_lines.x"], two_lines.x)
Assert.allclose(df["two_lines.y0"], two_lines.y[0])
Assert.allclose(df["two_lines.y1"], two_lines.y[1])


def test_convert_two_fatbands_to_frame(two_fatbands, Assert):

print(two_fatbands._get_width(0))
graph = Graph(two_fatbands)
df = graph.to_frame()
Assert.allclose(df["two_fatbands.x"], two_fatbands.x)
Assert.allclose(df["two_fatbands.y0"], two_fatbands.y[0])
Assert.allclose(df["two_fatbands.y1"], two_fatbands.y[1])
Assert.allclose(df["two_fatbands.width0"], two_fatbands.width[0])
Assert.allclose(df["two_fatbands.width1"], two_fatbands.width[1])

@patch("plotly.graph_objs.Figure._ipython_display_")
def test_ipython_display(mock_display, parabola, not_core):
graph = Graph(parabola)