Skip to content

Commit

Permalink
Merge pull request #6 from soda-inria/package4
Browse files Browse the repository at this point in the history
Package4
  • Loading branch information
gaetanbrison authored Nov 4, 2024
2 parents 6b0ad6a + 5782030 commit 58de8f7
Show file tree
Hide file tree
Showing 21 changed files with 447 additions and 292 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 120
ignore = E203, E402, E265, F403, W503, W504, E731
exclude = .git, venv*, docs, build
per-file-ignores = **/__init__.py:F401
103 changes: 8 additions & 95 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -1,183 +1,96 @@
name: style



on:

push:

branches: [main, develop]

pull_request:

branches: [main, develop]



jobs:

flake8:

runs-on: ${{ matrix.os }}

strategy:

matrix:

os: [ubuntu-latest]

python: [3.8]
python: [3.10, 3.11]

steps:

- uses: actions/checkout@v2

- name: Set up Python

uses: actions/setup-python@v1

with:

python-version: ${{ matrix.python }}

architecture: x64

- name: Run flake8

run: |
pip install flake8
flake8 --version
flake8
flake8 carte/carte_ai
isort:

runs-on: ${{ matrix.os }}

strategy:

matrix:

os: [ubuntu-latest]

python: [3.8]
python: [3.10, 3.11]

steps:

- uses: actions/checkout@v2

- name: Set up Python

uses: actions/setup-python@v1

with:

python-version: ${{ matrix.python }}

architecture: x64

- name: Run isort

run: |
pip install isort
isort --version
isort .
isort carte/carte_ai
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then exit 1; else echo "All clear"; fi
mypy:

runs-on: ${{ matrix.os }}

strategy:

matrix:

os: [ubuntu-latest]

python: [3.8]
python: [3.10, 3.11]

steps:

- uses: actions/checkout@v2

- name: Set up Python

uses: actions/setup-python@v1

with:

python-version: ${{ matrix.python }}

architecture: x64

- name: Cache python modules

uses: actions/cache@v2

with:

path: ~/.cache/pip

key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}

- name: Install dependencies

run: |
pip install mypy
- name: Run mypy

run: |
mypy --version
mypy
mypy carte/carte_ai
black:

runs-on: ${{ matrix.os }}

strategy:

matrix:

os: [ubuntu-latest]

python: [3.8]
python: [3.10, 3.11]

steps:

- uses: actions/checkout@v2

- name: Set up Python

uses: actions/setup-python@v2

with:

python-version: ${{ matrix.python }}

architecture: x64

- name: Run black

run: |
pip install black
black --version
black --check --diff .
black --check --diff carte/carte_ai
125 changes: 125 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
venv/
ENV/
env.bak/
venv.bak/
*.egg
*.egg-info/
dist/
build/
*.egg-info/
.eggs/

# 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

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

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

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery beat schedule files
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.envrc
*.env
*.env.*

# IDEs and editors
.vscode/
.idea/
*.sublime-workspace

# PyCharm
*.iml
*.iws
.idea/
out/

# VS Code
.vscode/

# MacOS
.DS_Store

# Thumbnails
._*

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Visual Studio
.vs/
*.suo
*.user
*.userosscache
*.sln.docstates

# PyCharm working directory
.idea/


# Data
data/data_multitable/
data/data_singletable/
Expand Down
2 changes: 1 addition & 1 deletion carte_ai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from carte_ai.configs import *
from carte_ai.data import *
from carte_ai.scripts import *
from .src import CARTERegressor, CARTEClassifier, Table2GraphTransformer
from .src import CARTERegressor, CARTEClassifier, Table2GraphTransformer
10 changes: 5 additions & 5 deletions carte_ai/configs/carte_configs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Specific configurations for the CARTE paper."""

## Dataset names
# Dataset names
carte_datalist = [
"anime_planet",
"babies_r_us",
Expand Down Expand Up @@ -55,7 +55,7 @@
"zomato",
]

## Dictionary of baseline methods
# Dictionary of baseline methods
carte_singletable_baselines = dict()
carte_singletable_baselines["full"] = [
"carte-gnn",
Expand Down Expand Up @@ -110,7 +110,7 @@
]


## Dictionary of method mapping
# Dictionary of method mapping
carte_singletable_baseline_mapping = dict()
carte_singletable_baseline_mapping["carte-gnn"] = "CARTE"

Expand All @@ -137,7 +137,7 @@
# Bagging
carte_singletable_baseline_mapping["bagging"] = "Bagging"

## Colors for visualization
# Colors for visualization
carte_singletable_color_palette = dict()
carte_singletable_color_palette["CARTE"] = "C3"
carte_singletable_color_palette["CatBoost"] = "C0"
Expand All @@ -151,7 +151,7 @@
carte_singletable_color_palette["TabVec-MLP"] = "C9"
carte_singletable_color_palette["TarEnc-TabPFN"] = "#A9561E"

## Markers for visualization
# Markers for visualization
carte_singletable_markers = dict()
carte_singletable_markers["CARTE"] = "o"
carte_singletable_markers["TabVec-XGB"] = (4, 0, 45)
Expand Down
8 changes: 6 additions & 2 deletions carte_ai/configs/directory.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
from pathlib import Path

# Get the base path relative to this file's location
base_path = Path(__file__).resolve().parent.parent # This gives '/home/infres/gbrison/carte/carte_ai'
base_path = (
Path(__file__).resolve().parent.parent
) # This gives '/home/infres/gbrison/carte/carte_ai'

config_directory = dict()
config_directory["base_path"] = base_path

config_directory["data"] = str(base_path / "data/")
config_directory["pretrained_model"] = str(base_path / "data/etc/kg_pretrained.pt") # Correct path
config_directory["pretrained_model"] = str(
base_path / "data/etc/kg_pretrained.pt"
) # Correct path
config_directory["data_raw"] = str(base_path / "data/data_raw/")
config_directory["data_singletable"] = str(base_path / "data/data_singletable/")
config_directory["data_yago"] = str(base_path / "data/data_yago/")
Expand Down
Loading

0 comments on commit 58de8f7

Please sign in to comment.