forked from chstan/arpes
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #2 from FAIRmat-NFDI/fix-tests
Updats ci and fixes momentum tests
- Loading branch information
Showing
7 changed files
with
206 additions
and
406 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,76 +1,37 @@ | ||
name: Run Tests | ||
name: pytest | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
branches: [master] | ||
pull_request: | ||
branches: "**" | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
QT_QPA_PLATFORM: offscreen | ||
strategy: | ||
max-parallel: 5 | ||
fail-fast: false | ||
matrix: | ||
python_version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: Get conda package dir | ||
id: conda-cache | ||
run: | | ||
echo "::set-output name=dir::$(conda info --json | python -c "import sys, json; print(json.load(sys.stdin)['pkgs_dirs'][0])")" | ||
- name: Cache conda and PyPI modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-conda-and-pypi | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
path: | | ||
${{ steps.pip-cache.outputs.dir }} | ||
${{ steps.conda-cache.outputs.dir }} | ||
key: ${{ runner.os }}-build-${{ env.cache-name}}-${{ hashFiles('**/environment*.yml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda | ||
python-version: ${{ matrix.python_version }} | ||
- name: Install dependencies | ||
run: | | ||
conda env create --quiet --file environment.yml | ||
- name: Source environment, test with pytest and generate coverage | ||
python -m pip install --upgrade pip | ||
- name: Install package | ||
run: | | ||
source activate arpes | ||
conda env update --file environment-update-test.yml | ||
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 | ||
echo "Installed dependencies as below" | ||
pip freeze | ||
echo "Now running tests" | ||
python -m pytest -c pytest-config/pytest-coverage-codecov.ini | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
path_to_write_report: ./coverage/codecov_report.txt | ||
verbose: true | ||
pip install -e ".[core, test]" | ||
pip install pytest pytest-qt | ||
- name: Test with pytest | ||
run: | | ||
pytest -sv --show-capture=no 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,13 @@ | |
from setuptools.command.install import install | ||
|
||
NAME = "arpes" | ||
DESCRIPTION = "Modular data analysis code for angle resolved photoemission spectroscopy (ARPES)" | ||
DESCRIPTION = ( | ||
"Modular data analysis code for angle resolved photoemission spectroscopy (ARPES)" | ||
) | ||
URL = "https://gitlab.com/lanzara-group/python-arpes" | ||
EMAIL = "[email protected]" | ||
AUTHOR = "Conrad Stansbury" | ||
REQUIRES_PYTHON = ">=3.8.0,<3.9" # we're being less permissive because of pyqtgraph | ||
REQUIRES_PYTHON = ">=3.8.0,<3.12" # we're being less permissive because of pyqtgraph | ||
|
||
about = {} | ||
with open("./arpes/__init__.py") as fp: | ||
|
@@ -28,7 +30,7 @@ | |
"h5py>=3.2.1", | ||
"pyqtgraph>=0.12.0,<0.13.0", | ||
"PyQt5==5.15", | ||
"netCDF4>=1.5.0,<2.0.0", | ||
"netCDF4>=1.5.0,<1.7.0", | ||
"colorcet", | ||
"pint", | ||
"pandas", | ||
|
@@ -60,7 +62,9 @@ | |
], | ||
} | ||
|
||
requirements = [y for k, v in DEPENDENCY_GROUPS.items() for y in v if k not in {"igor", "ml"}] | ||
requirements = [ | ||
y for k, v in DEPENDENCY_GROUPS.items() for y in v if k not in {"igor", "ml"} | ||
] | ||
|
||
DEV_DEPENDENCIES = { | ||
"jupyter": [ | ||
|
@@ -91,19 +95,17 @@ | |
You should follow standard best practices for working with IPython and Jupyter. | ||
To get the interactive volumetric data explorer `qt_tool` you will need to install | ||
`PyQt5` and `pyqtgraph`. | ||
`PyQt5` and `pyqtgraph`. | ||
To use the Igor data loading libraries in PyARPES you will need to install the `igor` | ||
To use the Igor data loading libraries in PyARPES you will need to install the `igor` | ||
module from 'https://github.com/chstan/igorpy/tarball/712a4c4#egg=igor-0.3.1'. | ||
Some functionality, including PCA/Factor Analysis decomposition tools, require | ||
additional heavy dependencies such as `scikit-learn` and `scikit-image`. | ||
Some functionality, including PCA/Factor Analysis decomposition tools, require | ||
additional heavy dependencies such as `scikit-learn` and `scikit-image`. | ||
For Jupyter integration, please have a look at the documentation (link above). | ||
For support issues, contact [email protected] or [email protected]. | ||
""".format( | ||
DOCUMENTATION_URL | ||
) | ||
""".format(DOCUMENTATION_URL) | ||
|
||
packages = find_packages( | ||
exclude=( | ||
|
Oops, something went wrong.