Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghui5801 committed Nov 16, 2024
1 parent c0faf3b commit 3ac6950
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy pandas setuptools wheel
sudo apt-get update
sudo apt-get install -y g++
- name: Create package structure
run: |
mkdir -p utils
mkdir -p pattern_causality/utils
cat > utils/__init__.py << 'EOL'
from .statespace import statespace
from .patternhashing import patternhashing
from .signaturespace import signaturespace
from .distancematrix import distancematrix
from .patternspace import patternspace
from .pastNNs import pastNNs
from .projectedNNs import projectedNNs
from .predictionY import predictionY
from .fillPCMatrix import fillPCMatrix
from .natureOfCausality import natureOfCausality
from .databank import databank
from .fcp import fcp
__all__ = [
'statespace', 'patternhashing', 'signaturespace', 'distancematrix',
'patternspace', 'pastNNs', 'projectedNNs', 'predictionY',
'fillPCMatrix', 'natureOfCausality', 'databank', 'fcp'
]
EOL
touch pattern_causality/utils/__init__.py
- name: Install package
run: |
pip install pytest pytest-cov
pip install -e .
- name: List directory structure
run: |
echo "Current directory structure:"
find . -type f -name "*.py" -o -name "*.cpp"
- name: Run tests
run: |
python -m pytest tests/ --cov=pattern_causality -v

0 comments on commit 3ac6950

Please sign in to comment.