Skip to content

Commit

Permalink
Merge pull request #45 from simonprovost/feature/v0.0.4
Browse files Browse the repository at this point in the history
First Release Scikit-Longitudinal Github and PyPi
  • Loading branch information
simonprovost authored Jul 4, 2024
2 parents 40f0de0 + da4150d commit 21b8f7c
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 136 deletions.
34 changes: 30 additions & 4 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.0.4] - 2024-07-04 - First Public Release and Major Enhancements

### Added

- **Documentation**: Comprehensive new documentation with Material for MKDocs. This includes a detailed tutorial on understanding vectors of waves in longitudinal datasets, a contribution guide, an FAQ section, and complete API references for all estimators, preprocessors, data preparations, and the pipeline manager.
- **Docker Installation**: Added new Docker installation process.
- **Windows Support**: Windows is now supported via Docker.
- **New Classifiers/Regressors**: Introduced Lexico Deep Forest, Lexico Gradient Boosting, and Lexico Decision Tree Regressor.
- **PyPI Availability**: Scikit-Longitudinal is now available on PyPI.
- **Continuous Integration**: Integrated unit testing, documentation, and PyPI publishing within the CI pipeline.

### Improved

- **PDM Setup and Installation**: Enhanced setup and installation processes using PDM.
- **Testing Coverage**: Improved testing coverage, ensuring that nearly 90% of the library is tested.
- **Scikit-Lexicographical-Trees**: Extracted the lexicographical scikit-learn tree node splitting function into its own repository and published it to PyPI as Scikit-Lexicographical-Trees. This is now leveraged by our lexico-based estimators.
- **.env Management**: Improved management of environment variables.
- **Lexicographical Enhancements**: Integrated lexicographical enhancements of the waves vector within the variant of scikit-learn, scikit-lexicographical-trees, improving memory and time efficiency by handling algorithmic temporality directly in C++.

### To-Do

- **Docstrings Alignment**: Ensure that docstrings in the codebase align with the official documentation to avoid confusion.
- **Native Windows Compatibility**: Achieve Windows compatibility without relying on Docker (requires access to a Windows machine).
- **Future Enhancements**: Ongoing improvements and new features as they are identified.
- **Documentation examples**: Add examples to the documentation to help users understand how to use the library with Jupyter notebooks.

## [v0.0.3] - 2023-10-31 - Usability, Maintainability, and Compliance Enhancements

### Added

- Features Group Missing Waves Handling: Introduced mechanisms for gracefully handling missing waves in features groups.
- Readiness Descriptions: New readiness indicators provide detailed descriptions of temporal data management across the library.
- AutoLD Compliance: The library is now compliant with AutoLD standards.
- Auto-Sklong Compliance: The library is now compliant with Auto-Sklong standards.
- Package Management Transition: Switched from Poetry to PDM for improved package and dependency management.
- Docker Support: Linux-based Docker environment setup for streamlined installation and deployment.
- Platform Testing: Library is tested on both Mac and Linux, with Windows support nearing completion.
Expand All @@ -21,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Irrelevant Scripts: Removed scripts related to visualisations not core to the library's functionality.
- Irrelevant Scripts: Removed scripts related to visualizations not core to the library's functionality.
- Experiments Branch: Moved all experiment-related codes to a dedicated `Experiments` branch.

## [v0.0.2] - 2023-05-17 - Enhanced Longitudinal Analysis and Parallelization Features
Expand All @@ -47,7 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- CFS per Group for Longitudinal Data: Python implementation with parallelism for better performance.

[Unreleased]: https://github.com/simonprovost/scikit-longitudinal/compare/v0.0.3...HEAD
[v0.0.4]: https://github.com/simonprovost/scikit-longitudinal/releases/tag/v0.0.4
[v0.0.3]: https://github.com/simonprovost/scikit-longitudinal/releases/tag/v0.0.3
[v0.0.2]: https://github.com/simonprovost/scikit-longitudinal/releases/tag/v0.0.2
[v0.0.1]: https://github.com/simonprovost/scikit-longitudinal/releases/tag/v0.0.1

[v0.0.1]: https://github.com/simonprovost/scikit-longitudinal/releases/tag/v0.0.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p align="center">
<h1 align="center">
<br>
<a href="https://raw.githubusercontent.com/simonprovost/scikit-longitudinal/main/logo.png?token=GHSAT0AAAAAACIVGTU4VMW5XBIL6ITAYXJSZUFEX2Q"><img src="https://raw.githubusercontent.com/simonprovost/scikit-longitudinal/main/logo.png?token=GHSAT0AAAAAACIVGTU4VMW5XBIL6ITAYXJSZUFEX2Q" alt="Scikit-longitudinal" width="200"></a>
<a href="https://i.imgur.com/jCtPpTF.png"><img src="https://i.imgur.com/jCtPpTF.png" alt="Scikit-longitudinal" width="200"></a>
<br>
Scikit-longitudinal
<br>
Expand Down
101 changes: 16 additions & 85 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,106 +1,37 @@
ARG CONDA_VER=2023.09-0
ARG OS_TYPE
ARG PYTHON_BASE=3.9-slim
FROM python:$PYTHON_BASE AS builder

FROM python:3.9.8 AS builder
RUN pip install -U pdm
ENV PDM_CHECK_UPDATE=false

# ==========================
# Dockerfile for Scikit Longitudinal Project
# System: Linux under Python 3.9.8 lightweight image
# Python: 3.9.8
# ==========================

RUN echo "==========================\nStage 1: The Build Process\n=========================="

# -----------------------------------
# 🛠 System-level Setup and Libraries 🛠
# -----------------------------------
RUN apt-get update && apt-get install -y libomp-dev

# ------------------------
# 🛠 Compiler Configurations 🛠
# ------------------------
RUN apt-get update && apt-get install -y build-essential libomp-dev libc-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
ENV CC=gcc
ENV CXX=g++
ENV CPPFLAGS="-I/usr/local/include"
ENV CFLAGS="-Wall"
ENV CXXFLAGS="-Wall"
ENV LDFLAGS="-L/usr/local/lib"

# -------------------
# 🛠 Python Utilities 🛠
# -------------------
RUN echo "🛠 Python Utilities 🛠"
RUN pip install -U pip setuptools wheel
RUN pip install pdm

# ---------------------------
# 📦 Python Dependency Setup 📦
# ---------------------------
COPY pyproject.toml pdm.lock /scikit_longitudinal/
WORKDIR /scikit_longitudinal
RUN mkdir __pypackages__

FROM python:3.9
RUN echo "==========================\nStage 2: The Run-Time Setup\n=========================="

# -----------------------------------
# 🛠 System-level Setup and Libraries 🛠
# -----------------------------------
RUN echo "🛠 System-level Setup and Libraries 🛠"
RUN apt-get update && apt-get install -y libomp-dev build-essential wget curl libc-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# -------------------------
# 🐍 Anaconda Installation 🐍
# -------------------------
RUN echo "🐍 Anaconda Installation 🐍"
ARG CONDA_VER
ARG OS_TYPE
RUN if [ -z "${OS_TYPE}" ]; then echo "OS_TYPE argument not provided"; exit 1; fi
RUN wget -q "https://repo.anaconda.com/archive/Anaconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh" -O ~/Anaconda.sh
RUN dpkg --add-architecture arm64
RUN apt update -y
RUN apt install -y libc6:arm64
RUN bash ~/Anaconda.sh -b -p /anaconda
RUN rm ~/Anaconda.sh
ENV PATH=/anaconda/bin:${PATH}
RUN conda update --quiet -y conda
COPY scikit_longitudinal/ /scikit_longitudinal/scikit_longitudinal/
COPY data/ /scikit_longitudinal/data/
COPY scripts/ /scikit_longitudinal/scripts/
COPY .env README.md .coveragerc /scikit_longitudinal/

# ------------------------
# 🛠 Compiler Configurations 🛠
# ------------------------
RUN echo "🛠 Compiler Configurations 🛠"
ENV CC=gcc
ENV CXX=g++
ENV CPPFLAGS="-I/usr/local/include"
ENV CFLAGS="-Wall"
ENV CXXFLAGS="-Wall"
ENV LDFLAGS="-L/usr/local/lib"
WORKDIR /scikit_longitudinal
RUN pdm install --check --with :all --no-editable

# ---------------------------
# 🐍 Python Environment Setup 🐍
# ---------------------------
RUN echo "🐍 Python Environment Setup 🐍"
ENV PYTHONPATH=/scikit_longitudinal/pkgs
FROM python:$PYTHON_BASE

# ----------------------
# 📦 Project File Setup 📦
# ----------------------
RUN echo "📦 Project File Setup 📦"
COPY --from=builder /scikit_longitudinal/.venv/ /scikit_longitudinal/.venv
ENV PATH="/scikit_longitudinal/.venv/bin:$PATH"
COPY pyproject.toml pdm.lock /scikit_longitudinal/
COPY scikit_longitudinal/ /scikit_longitudinal/scikit_longitudinal/
COPY scikit-learn/ /scikit_longitudinal/scikit-learn/
COPY data/ /scikit_longitudinal/data/
COPY scripts/ /scikit_longitudinal/scripts/
COPY .env README.md .coveragerc /scripts/linux/docker_scikit_longitudinal_installs.sh /scripts/linux/docker_start_pdm_env.sh /scikit_longitudinal/
COPY .env README.md .coveragerc /scikit_longitudinal/

# -------------------------------
# 🚀 Scikit Longitudinal Installation 🚀
# -------------------------------
RUN echo "🚀 Scikit Longitudinal Installation 🚀"
WORKDIR /scikit_longitudinal
RUN pip install pdm
ENV PDM_IN_ENV=in-project
RUN chmod +x /scikit_longitudinal/scripts/linux/docker_scikit_longitudinal_installs.sh /scikit_longitudinal/scripts/linux/docker_start_pdm_env.sh
RUN /scikit_longitudinal/scripts/linux/docker_scikit_longitudinal_installs.sh
CMD ["/bin/bash"]
41 changes: 39 additions & 2 deletions docs/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ Please follow the instructions below for setting up your development environment
!!! warning "Fully-working environment setup is not guaranteed on Windows. We recommend using a Unix-based system for
development. Such as MacOS or Linux. On Windows, Docker is recommended having been tested on Windows 10 & 11."

To manually configure your environment, please adhere to the following procedure meticulously:
Prior-all, you need to open the `.env` file at the root and set:
```bash
SKLONG_PYTHON_VERSION=<your_python_version> # e.g. 3.9.8
SKLONG_PYTHON_PATH=<your_python_path> # e.g. /usr/bin/python3.9
```

Next, to manually configure your environment, please adhere to the following procedure meticulously:

1. **Setting up the package manager:**
- Initialise the package manager with Conda as the backend for virtual environments:
Expand Down Expand Up @@ -208,7 +214,38 @@ feel free to open an issue on the GitHub repository for additional support.
```bash
git config --global core.autocrlf true
```


!!! tip "Docker and Jetbrains"
If you are using JetBrains, you should be able to leverage the `.run/` configurations at the root of the folder.
They should be automatically detected by your Jetbrains IDE (e.g PyCharm) and you can run the tests from there.
Make sure to edit the configuration to adapt to your use-case.

Configs available:
- `Scikit_longitudinal_ARM_architecture.run.xml`: If you are on an ARM architecture. Such as Macbook with Apple Silicon chips.
- `Scikit_longitudinal_Intel_architecture.run.xml`: If you are on an Intel architecture. Such as most of the Windows and Linux machines or Macbook with Intel chips.

!!! warning "Docker with Apple Silicon"
If you are on an Apple Silicon chip, the current library is `x86_64` based. Therefore, you should configure Docker
so that it runs on such architecture. Be at the root of the project and run the following commands:

1. **Prepare [QUS](https://github.com/dbhi/qus) for Docker:**
```bash
docker run --rm --privileged aptman/qus -- -r
docker run --rm --privileged aptman/qus -s -- -p x86_64
```
2. **Build the Docker Image:**
```bash
docker buildx create --use
docker buildx build --platform linux/amd64 -t scikit_longitudinal:latest .
```
3. **Run the Docker Container:**
```bash
docker run -it scikit_longitudinal:latest /bin/bash
```
4. **Run the tests:**
```bash
pytest scikit_longitudinal/ --cov=./ --cov-report=html --cov-config=.coveragerc --cov-report=html:htmlcov/scikit_longitudinal -s -vv --capture=no
```
## ⚙️ How To Build The Distribution Packages

To build the distribution packages for the project, follow these steps:
Expand Down
7 changes: 6 additions & 1 deletion docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ hide:
# :construction:Coming Soon!
# :construction: Coming Soon!

We're currently working on creating a comprehensive examples page for you. This page will feature `Jupyter notebooks` that demonstrate how to use `Scikit-Longitudinal` effectively.
We're currently working on creating a comprehensive examples page for you.
This page will feature `Jupyter notebooks` that demonstrate how to use `Scikit-Longitudinal` effectively.

!!! note
In the meantime, throughout each estimator, preprocessors, data preparations, and the pipeline manager,
you can find some starting-point examples in the end of each documentation-based page.

<iframe
src="https://giphy.com/embed/l3vQYe7l1TInypnYA"
Expand Down
8 changes: 4 additions & 4 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "Scikit-longitudinal"
version = "0.0.2"
version = "0.0.4"
description = "Scikit-longitudinal, an open-source Python lib for longitudinal data analysis, builds on Scikit-learn's foundation. It offers specialized tools to tackle challenges of repeated measures data, ideal for researchers, data scientists, & analysts."
authors = [
{name = "Provost Simon", email = "simon.gilbert.provost@gmail.com"},
Expand All @@ -25,11 +25,10 @@ dependencies = [
"joblib>=0.11",
"deep-forest>=0.1.7",
"starboost==0.0.2",
"scikit-lexicographical-trees>=0.0.2",
"scikit-lexicographical-trees==0.0.2",
]
requires-python = ">=3.9,<3.10"
readme = "README.md"
license = { file = "LICENSE" }

[project.urls]
Homepage = "https://github.com/simonprovost/scikit-longitudinal"
Expand Down Expand Up @@ -75,12 +74,12 @@ doc = [
_set_pdm_use_venv = { cmd = "pdm use --venv ${PDM_IN_ENV}" }
_use_python39.shell = "pdm use \"${SKLONG_PYTHON_PATH}\""
_use_python39.env_file = ".env"
_create_env.shell = "pdm venv create --with-pip ${SKLONG_PYTHON_VERSION} --force"
_create_env.shell = "pdm venv create --with-pip ${SKLONG_PYTHON_VERSION}"
_create_env.env_file = ".env"
_check_sklong_vars = {shell = "echo 'Make sure to set the SKLONG_PYTHON_PATH and SKLONG_PYTHON_VERSION environment variables'"}
_set_env_var = {shell = "echo 'could you please run `export PDM_IN_ENV=in-project`'"}
_activate_env = {cmd = "echo 'could you please activate the environment via `eval $(pdm venv activate (dollar-sign)PDM_IN_ENV)`'"}
setup_sklong = {composite = ["_check_sklong_vars", "_use_python39", "_create_env", "_set_env_var", "_activate_env"]}
setup_sklong = {composite = ["_check_sklong_vars", "_create_env", "_set_env_var", "_activate_env"]}
remove_env = { cmd = "pdm venv remove ${PDM_IN_ENV}" }
_clean_project = {cmd = "echo could you please deactivate the environment via `conda deactivate` then run `pdm run remove_env`"}
clean = {composite = ["_check_pdm_vars", "_clean_project"] }
Expand Down
25 changes: 0 additions & 25 deletions scripts/linux/docker_scikit_longitudinal_installs.sh

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/linux/docker_start_pdm_env.sh

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup( # pragma: no cover
name="Scikit-longitudinal",
version="0.0.22",
version="0.0.4",
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url="https://github.com/simonprovost/scikit-longitudinal",
Expand Down

0 comments on commit 21b8f7c

Please sign in to comment.