-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #554 from maurov/fix553
Fix issue #553
- Loading branch information
Showing
8 changed files
with
112 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,25 @@ jobs: | |
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python from Miniconda/conda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
miniconda-version: latest | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
activate-environment: anaconda-client-env | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install conda dependencies | ||
run: | | ||
printenv | ||
conda install -y -c conda-forge python=${{ matrix.python-version }} "numpy>=1.23" "scipy>=1.12" "matplotlib>=3.8" "h5py>=3.5" "wxpython>=4.2" scikit-learn jupyter plotly pytest pytest-cov coverage | ||
- name: Install xraylarch and other dependencies with pip | ||
run: | | ||
pip install ".[all]" | ||
- name: Run test suite | ||
run: | | ||
cd tests | ||
python -m pytest | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y xvfb | ||
- name: Set up Python from Miniconda/conda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
miniconda-version: latest | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
activate-environment: anaconda-client-env | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install conda dependencies | ||
run: | | ||
printenv | ||
conda install -y -c conda-forge python=${{ matrix.python-version }} "numpy>=1.23" "scipy>=1.12" "matplotlib>=3.8" "h5py>=3.5" "wxpython>=4.2" scikit-learn jupyter plotly pytest pytest-cov coverage | ||
- name: Install xraylarch and other dependencies with pip | ||
run: | | ||
pip install ".[all]" | ||
- name: Run test suite | ||
run: pytest --xvfb-backend xvfb tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,7 @@ doc = | |
dev = | ||
pytest | ||
pytest-cov | ||
pytest-xvfb #: For GUI testing | ||
coverage | ||
build | ||
pre-commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
"""Test larch.wxlib.cif_browser""" | ||
|
||
import sys, os | ||
import pytest | ||
from pathlib import Path | ||
from larch.wxlib.cif_browser import CIFViewer | ||
|
||
toppath = Path(__file__).parent.parent | ||
structpath = toppath / "examples" / "structuredata" / "struct2xas" | ||
|
||
|
||
@pytest.mark.skipif(os.name == "nt" and sys.version_info < (3,10), reason="fails for windows and python3.9") | ||
def test_cif2feff(): | ||
cif_file = structpath / "ZnO_mp-2133.cif" | ||
viewer = CIFViewer(with_feff=True) | ||
frame = viewer.GetTopWindow() | ||
frame.onImportCIF(path=cif_file.as_posix()) | ||
frame.onGetFeff() | ||
frame.onRunFeff() | ||
# viewer.MainLoop() | ||
|
||
|
||
if __name__ == "__main__": | ||
test_cif2feff() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python | ||
"""Test larch.wxlib.structure2feff_browser""" | ||
|
||
import pytest | ||
from pathlib import Path | ||
from larch.wxlib.structure2feff_browser import Structure2FeffViewer | ||
|
||
toppath = Path(__file__).parent.parent | ||
structpath = toppath / "examples" / "structuredata" / "struct2xas" | ||
|
||
|
||
def test_structure2feff(): | ||
struct_file = structpath / "GaBr_single_frame.xyz" | ||
viewer = Structure2FeffViewer() | ||
frame = viewer.GetTopWindow() | ||
frame.onImportStructure(path=struct_file.as_posix()) | ||
frame.onGetFeff() | ||
frame.onRunFeff() | ||
# viewer.MainLoop() | ||
|
||
|
||
if __name__ == "__main__": | ||
test_structure2feff() |