Skip to content

Commit 1fa9338

Browse files
author
vm-aifluence-jro
committed
Merge branch 'main' of https://github.com/Quantmetry/qolmat
2 parents f325239 + 1d6d9d9 commit 1fa9338

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2933
-423913
lines changed

.bumpversion.cfg

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[bumpversion]
2+
current_version = 0.0.10
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:setup.py]
7+
search = VERSION = "{current_version}"
8+
replace = VERSION = "{new_version}"
9+
10+
[bumpversion:file:qolmat/_version.py]
11+
search = __version__ = "{current_version}"
12+
replace = __version__ = "{new_version}"
13+
14+
[bumpversion:file:docs/conf.py]
15+
search = version = "{current_version}"
16+
replace = version = "{new_version}"

.flake8

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[flake8]
2+
exclude = .git,__pycache__,.vscode,tests
3+
max-line-length=99
4+
ignore=E302,E305,W503,E203,E731,E402,E501,E266,E712,F401,F821
5+
indent-size = 4
6+
per-file-ignores=
7+
qolmat/imputations/imputers.py:F401
8+
*/__init__.py:F401
9+
examples/test.py:F401

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Package on PYPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
deploy:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: '3.10'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install setuptools wheel twine
23+
- name: Build package
24+
run: python setup.py sdist bdist_wheel
25+
- name: Publish package
26+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
27+
with:
28+
user: __token__
29+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Unit test Qolmat
2+
3+
on: [push, pull_request,workflow_dispatch]
4+
5+
6+
jobs:
7+
build-linux:
8+
runs-on: ${{matrix.os}}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest,windows-latest]
12+
python-version: [3.8,3.9]
13+
defaults:
14+
run:
15+
shell: bash -l {0}
16+
17+
steps:
18+
- name: Git clone
19+
uses: actions/checkout@v3
20+
- name: Set up venv for ci
21+
uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
python-version: ${{matrix.python-version}}
24+
channels: default, conda-forge
25+
- name: Lint with flake8
26+
run: |
27+
conda install flake8
28+
flake8
29+
- name: Test with pytest
30+
run: |
31+
conda install pytest
32+
#pytest
33+
echo you should uncomment pytest and delete this line
34+
- name: typing with mypy
35+
run: |
36+
#mypy qolmat
37+
echo you should uncomment mypy qolmat and delete this line

.gitignore

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,63 @@
1+
# Byte-compiled / optimized / DLL files
12
__pycache__/
3+
*.py[cod]
4+
*$py.class
25
.pyc
36
.DS_Store
4-
.ipynb_checkpoints
5-
/data
6-
/figures
7-
qolmat/notebooks/figures
8-
qolmat/notebooks/*.ipynb
9-
*.egg-info
10-
/dist
11-
/build
12-
*SOURCES.txt
13-
TimeSynth*
14-
/scripts
7+
.mypy*
8+
9+
10+
11+
# Distribution / packaging
12+
13+
.Python
14+
env/
15+
build/
16+
develop-eggs/
17+
dist/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
VERSION
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*,cover
49+
.hypothesis/
50+
qolmat/.converge
51+
52+
53+
# Notebooks
54+
**.ipynb_checkpoints
55+
examples/*.ipynb
56+
examples/figures/*
57+
examples/data/*
58+
examples/*.ipynb
59+
60+
61+
# VSCode
62+
.vscode
63+
# examples/benchmark.ipynb

.pre-commit-config.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@ repos:
1616
args:
1717
- "-l 99"
1818
# Flake8
19-
- repo: https://gitlab.com/pycqa/flake8
19+
- repo: https://github.com/PyCQA/flake8
2020
rev: 4.0.1
2121
hooks:
2222
- id: flake8
23-
exclude: (tests/)
24-
args:
25-
- --max-line-length=99
26-
- --ignore=E302,E305,W503,E203,E203,E731,E402
27-
- --per-file-ignores=
28-
- */__init__.py:F401
29-
- qolmat/imputations/models.py:F401

.readthedocs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
3+
build:
4+
image: latest
5+
6+
python:
7+
version: 3.8
8+
install:
9+
- method: pip
10+
path: .
11+
12+
conda:
13+
environment: environment.doc.yml
14+
15+
sphinx:
16+
builder: html
17+
configuration: docs/conf.py
18+
fail_on_warning: false

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ On each sample, different imputation models are tested and reconstruction errors
4848
<img src="docs/images/comparator.png" alt="comparator" width="60%"/>
4949
</p>
5050

51-
### **Installation**
51+
### **Installation for conda user**
5252

5353
```
54-
conda env create -f conda.yml
55-
conda activate env_qolmat
54+
cconda env create -f environment.dev.yml
55+
conda activate env_qolmat_dev
5656
```
57+
5758
### Install pre-commit
5859

5960
Once the environment is installed, pre-commit is installed, but need to be activated using the following command:

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
##############################################
23
RPCA for anomaly detection and data imputation
34
##############################################
@@ -71,7 +72,7 @@ What’s in this repo?
7172

7273
Some classes are implemented:
7374

74-
* :class:`RPCA` class (see p.29 of this `paper <https://arxiv.org/abs/0912.3599>`__). The optimisation problem is the following
75+
**RPCA** class based on `RPCA <https://arxiv.org/abs/0912.3599>`_ p.29.
7576

7677
.. math::
7778
@@ -80,7 +81,7 @@ Some classes are implemented:
8081
& \text{s.t.} \quad \mathbf{D} = \mathbf{X} + \mathbf{A}
8182
\end{align*}
8283
83-
* :class:`GraphRPCA` class (based on this `paper <https://arxiv.org/abs/1507.08173>`__). The optimisation problem is the following
84+
**GraphRPCA** class based on `GraphRPCA <https://arxiv.org/abs/1507.08173>`_.
8485

8586
.. math::
8687
@@ -89,7 +90,7 @@ Some classes are implemented:
8990
& \text{s.t.} \quad \mathbf{D} = \mathbf{X} + \mathbf{A}
9091
\end{align*}
9192
92-
* :class:`TemporalRPCA` class (based on this `paper <https://arxiv.org/abs/2001.05484>`__ and this `paper <https://www.hindawi.com/journals/jat/2018/7191549/>`__). The optimisation problem is the following
93+
**TemporalRPCA** class based on `Link 1 <https://arxiv.org/abs/2001.05484>`__ and this `Link 2 <https://www.hindawi.com/journals/jat/2018/7191549/>`__). The optimisation problem is the following
9394

9495
.. math::
9596

0 commit comments

Comments
 (0)