Skip to content

Commit

Permalink
Merge pull request #152 from MAIF/melusine_refactored
Browse files Browse the repository at this point in the history
Melusine refactored
  • Loading branch information
HugoPerrier authored Dec 12, 2023
2 parents dbf1e6f + de2f039 commit ae1c25d
Show file tree
Hide file tree
Showing 156 changed files with 25,836 additions and 155 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build & Test
on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
src: "./melusine"

test:
name: Test
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 2
matrix:
python-version: ["3.8", "3.10"]
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox

coverage:
name: Create coverage badge
needs: test
runs-on: ubuntu-latest
steps:
- name: Coverage Badge
uses: codecov/codecov-action@v3

deploy:
name: Deploy python package
needs: test
runs-on: ubuntu-latest
steps:
- run: echo "Deploying .."
109 changes: 96 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,109 @@
# Mac OS variable
.DS_Store

# Python cache
__pycache__/
*.pyc

# Doc build
_build/
build/
# Notebooks checkpoints
.ipynb_checkpoints/
notebooks/

# Byte-compiled / optimized / DLL files
*.py[cod]
*$py.class

# Package
*.egg-info/
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Python cache
__pycache__/
*.pyc
# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# IPython
profile_default/
ipython_config.py

# Notebooks checkpoints
.ipynb_checkpoints/
# pyenv
.python-version

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mlflow
mlruns/

# tensorboard
runs/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site
/docs/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# VSCode
.vscode

# Tutorial repository
tutorial/data/
tutorial/custom_conf/
# Pytest-env
pytest.ini
66 changes: 66 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-ast
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
exclude: ^chart/
- id: debug-statements
- id: end-of-file-fixer
exclude: ^(docs/|gdocs/)
- id: pretty-format-json
args: ['--autofix']
- id: trailing-whitespace
args: ['--markdown-linebreak-ext=md']
exclude: ^(docs/|gdocs/)
- id: check-added-large-files
args: ['--maxkb=500']
- id: no-commit-to-branch
args: ['--branch', 'master', '--branch', 'develop']
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
args: [--line-length=120]
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.931'
hooks:
- id: mypy
args: [--ignore-missing-imports, --disallow-untyped-defs, --show-error-codes, --no-site-packages]
files: ^melusine
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: '^tests/|^docs'
args: ['--ignore=E501,D2,D3,D4,D104,D100,D106,D107,W503,D105,E203']
additional_dependencies: [ flake8-docstrings, "flake8-bugbear==22.8.23" ]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.4.2
hooks:
- id: isort
args: ["--profile", "black", "-l", "120"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
hooks:
- id: blacken-docs
additional_dependencies: [black==21.12b0]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Contributors
* Hugo Perrier <[email protected]>
* Victor Bigand <[email protected]>

To be continued ...
To be continued ...
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ mkvirtualenv melusine
```
Go in the melusine directory
```
cd melusine
cd melusine
```
Install you local package
Install you local package
```
python setup.py develop
```
Expand All @@ -83,7 +83,7 @@ To contribute to Melusine, you will need to create a personal branch.
```
git checkout -b feature/my-contribution-branch
```
We recommand to use a convention of naming branch.
We recommand to use a convention of naming branch.
- **feature/your_feature_name** if you are creating a feature
- **hotfix/your_bug_fix** if you are fixing a bug

Expand All @@ -95,7 +95,7 @@ Before committing your modifications, we have some recommendations :
```
pytest
```
- Try to build Melusine
- Try to build Melusine
```
python setup.py bdist_wheel
```
Expand Down Expand Up @@ -125,7 +125,7 @@ git commit -m ‘detailed description of your change’
git push origin feature/my-contribution-branch
```

Your branch is now available on your remote forked repository, with your changes.
Your branch is now available on your remote forked repository, with your changes.

Next step is now to create a Pull Request so the Melusine Team can add your changes to the official repository.

Expand All @@ -138,7 +138,7 @@ To create one, on the top of your forked repository, you will find a button "Com

<img src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/melusine-compare-pr.png" alt="pull request" />

As you can see, you can select on the right side which branch of your forked repository you want to associate to the pull request.
As you can see, you can select on the right side which branch of your forked repository you want to associate to the pull request.

On the left side, you will find the official Melusine repository. Due to increase of external contributions, we advise you to create a pull request on develop so we can test before integrating it to the final release.

Expand Down
Binary file added docs/_static/melusine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/advanced/ContentTagger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Use custom message tags
5 changes: 5 additions & 0 deletions docs/advanced/CustomDetector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Use a custom MelusineDetector template

## Specify abstract methods

## Row transformations vs dataframe transformations
1 change: 1 addition & 0 deletions docs/advanced/ExchangeConnector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Connect melusine to a Microsoft Exchange Mailbox
1 change: 1 addition & 0 deletions docs/advanced/PreTrainedModelsHF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Use pre-trained models from HuggingFace
1 change: 1 addition & 0 deletions docs/contribute/how_to_contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# How to contribute to Melusine
1 change: 1 addition & 0 deletions docs/contribute/maif.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# MAIF
Empty file.
Loading

0 comments on commit ae1c25d

Please sign in to comment.