-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
91 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Python Tests | ||
|
||
# Trigger the workflow on push or pull request | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, 3.10, 3.11] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest | ||
python -m pip install | ||
- name: Run tests | ||
run: | | ||
python -m pytest 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import sys | ||
import os | ||
from pathlib import Path | ||
|
||
from PySide6.QtWidgets import QApplication | ||
from PySide6.QtGui import QIcon | ||
|
||
from app.main import Main | ||
|
||
# DATA = Path(__file__).parent / "data" | ||
|
||
def ex_reading_all_supported_data(file_paths=None): | ||
"""Example of reading different supported .CSV and .txt data formats""" | ||
app = QApplication() | ||
window = Main() | ||
app.setStyle("Fusion") | ||
|
||
if file_paths is not None: | ||
window.open(file_paths=file_paths) | ||
window.ui.show() | ||
sys.exit(app.exec()) | ||
|
||
|
||
if __name__ == "__main__": | ||
# DIRNAME = os.path.dirname(__file__) | ||
# DATA = os.path.join(DIRNAME, "data_test", "example", "spectroscopic_data") | ||
# file_path_1 = os.path.join(DATA, 'spectrum1_1ML.txt') | ||
# file_path_2 = os.path.join(DATA, 'spectrum4_3ML.txt') | ||
# file_path_3 = os.path.join(DATA, '2Dmap_MoS2.txt') | ||
# file_paths = ['file_path_1', 'file_path_2', 'file_path_3'] | ||
# ex_reading_all_supported_data() | ||
|
||
DATA_DIR = Path(__file__).parent / "spectroscopic_data" | ||
# DATA_DIR = DIRNAME / "data_test" / "example" / "spectroscopic_data" | ||
file_paths = [str(file) for file in DATA_DIR.glob("*.txt")] | ||
if file_paths: | ||
ex_reading_all_supported_data(file_paths=file_paths) | ||
else: | ||
print(f"No supported data files found in {DATA_DIR}") | ||
|
||
|
||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
import pytest | ||
|
||
# from data_test.examples.ex_reading_all_suported_data import ex_reading_all_suported_data | ||
|
||
|
||
def test_1(): | ||
print('test pytest') | ||
|
||
|