Skip to content

Commit debb6ae

Browse files
committed
init
1 parent 137fe18 commit debb6ae

30 files changed

+7134
-1
lines changed

.coveragerc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[run]
2+
omit =
3+
tests/*

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Thank you for sending your pull request. But first, have you included
2+
unit tests, and is your code PEP8 conformant?
3+
-->
4+
## Summary
5+
6+
<!-- Explain in one sentence the goal of this PR -->
7+
8+
Solve the issue: #___
9+
10+
## Quick changelog
11+
12+
- <change log 1>
13+
- <change log 1>
14+
15+
## What's new?
16+
17+
<!-- Explain in details what this PR solve or improve. You can include visuals. -->

.github/workflows/ci.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: PySATL CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Display Python version
25+
run: python -c "import sys; print(sys.version)"
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements-dev.txt
31+
32+
- name: Run tests
33+
run: pytest --random-order
34+
35+
- name: Tests with Coveralls
36+
if: (runner.os == 'Linux' && matrix.python-version == '3.12')
37+
run: |
38+
pytest --random-order --cov=stattest --cov-config=.coveragerc
39+
40+
- name: Coveralls
41+
if: (runner.os == 'Linux' && matrix.python-version == '3.12')
42+
env:
43+
COVERALLS_REPO_TOKEN: ${{ secrets.coverallsToken }}
44+
run: |
45+
# Allow failure for coveralls
46+
coveralls || true
47+
48+
- name: Check for repository changes
49+
run: |
50+
if [ -n "$(git status --porcelain)" ]; then
51+
echo "Repository is dirty, changes detected:"
52+
git status
53+
git diff
54+
exit 1
55+
else
56+
echo "Repository is clean, no changes detected."
57+
fi
58+
59+
- name: Sort imports (isort)
60+
run: |
61+
isort --check .
62+
63+
- name: Run Ruff
64+
run: |
65+
ruff check --output-format=github
66+
67+
- name: Run Ruff format check
68+
run: |
69+
ruff format --check

.github/workflows/deploy-docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types: [published]
9+
10+
11+
# disable permissions for all of the available permissions
12+
permissions: {}
13+
14+
15+
jobs:
16+
build-docs:
17+
permissions:
18+
contents: write # for mike to push
19+
name: Deploy Docs through mike
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r docs/requirements-docs.txt
33+
34+
- name: Fetch gh-pages branch
35+
run: |
36+
git fetch origin gh-pages --depth=1
37+
38+
- name: Configure Git user
39+
run: |
40+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
41+
git config --local user.name "github-actions[bot]"
42+
43+
- name: Build and push Mike
44+
if: ${{ github.event_name == 'push' }}
45+
run: |
46+
mike deploy ${{ github.ref_name }} latest --push --update-aliases
47+
48+
- name: Build and push Mike - Release
49+
if: ${{ github.event_name == 'release' }}
50+
run: |
51+
mike deploy ${{ github.ref_name }} stable --push --update-aliases
52+
53+
- name: Show mike versions
54+
run: |
55+
mike list

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# .readthedocs.yml
2+
version: 2
3+
4+
build:
5+
os: "ubuntu-22.04"
6+
tools:
7+
python: "3.12"
8+
9+
python:
10+
install:
11+
- requirements: docs/requirements-docs.txt
12+
13+
mkdocs:
14+
configuration: mkdocs.yml

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
# pysatl-test
1+
# pysatl-criterion
2+
3+
[![Pysatl_criterion CI](https://github.com/PySATL/pysatl-criterion/workflows/PySATL%20CI/badge.svg)](https://github.com/PySATL/pysatl-experiment/actions)
4+
[![Coverage Status](https://coveralls.io/repos/github/PySATL/pysatl-criterion/badge.svg?branch=main)](https://coveralls.io/github/PySATL/pysatl-experiment?branch=main)
5+
[![Documentation](https://readthedocs.org/projects/pysatl-criterion/badge)](https://pysatl-criterion.readthedocs.io)

core/__init__.py

Whitespace-only changes.

core/expon.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from scipy.stats import expon
2+
3+
4+
def generate_expon(size, lam=1): # TODO: refactor structure with inheritance??
5+
scale = 1 / lam
6+
return expon.rvs(size=size, scale=scale)
7+
8+
9+
def cdf_expon(rvs, lam=1):
10+
scale = 1 / lam
11+
return expon.cdf(rvs, scale=scale)

core/weibull.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from scipy.stats import exponweib
2+
3+
4+
def generate_weibull(size, a=1, k=5):
5+
return exponweib.rvs(a=a, c=k, size=size)
6+
7+
8+
def generate_weibull_cdf(rvs, a=1, k=5):
9+
return exponweib.cdf(rvs, a=a, c=k)
10+
11+
12+
def generate_weibull_logcdf(rvs, a=1, k=5):
13+
return exponweib.logcdf(rvs, a=a, c=k)
14+
15+
16+
def generate_weibull_logsf(rvs, a=1, k=5):
17+
return exponweib.logsf(rvs, a=a, c=k)

0 commit comments

Comments
 (0)