Skip to content

Commit

Permalink
Merge branch 'main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
jlgarridol committed May 6, 2024
2 parents 72b2c6b + 8190c6c commit 993598f
Show file tree
Hide file tree
Showing 35 changed files with 13,329 additions and 250 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish documentation online

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main
# Alternative: only build for tags.
# tags:
# - '*'

# security: restrict permissions for CI jobs.
permissions:
contents: read

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

# ADJUST THIS: install all dependencies (including pdoc)
- run: python -m pip install --upgrade pip
- run: python -m pip install pdoc
- run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- run: python -m pip install scikit-learn==1.2.2
# ADJUST THIS: build your documentation into docs/.
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
- run: python docs/make.py

- uses: actions/upload-pages-artifact@v3
with:
path: docs/

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
Semi-Supervised Learning Library (sslearn)
===

![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/jlgarridol/sslearn) ![Code Climate coverage](https://img.shields.io/codeclimate/coverage/jlgarridol/sslearn) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jlgarridol/sslearn/python-package.yml)
<!-- Insert logo in the middle -->
<img width="100%" src="https://raw.githubusercontent.com/jlgarridol/sslearn/main/docs/sslearn.webp"/>

![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/jlgarridol/sslearn) ![Code Climate coverage](https://img.shields.io/codeclimate/coverage/jlgarridol/sslearn) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jlgarridol/sslearn/python-package.yml) ![PyPI - Version](https://img.shields.io/pypi/v/sslearn) [![Static Badge](https://img.shields.io/badge/doc-available-blue?style=flat)](https://jlgarridol.github.io/sslearn/)

The `sslearn` library is a Python package for machine learning over Semi-supervised datasets. It is an extension of [scikit-learn](https://github.com/scikit-learn/scikit-learn).

Installation
---
## Installation


### Dependencies

* scikit_learn = 1.2.0
* joblib = 1.2.0
* numpy = 1.23.3
* pandas = 1.4.3
* scipy = 1.9.3
* statsmodels = 0.13.2
* joblib >= 1.2.0
* numpy >= 1.23.3
* pandas >= 1.4.3
* scikit_learn >= 1.2.0
* scipy >= 1.10.1
* statsmodels >= 0.13.2
* pytest = 7.2.0 (only for testing)

### `pip` installation
Expand All @@ -23,8 +27,9 @@ It can be installed using *Pypi*:

pip install sslearn

Code example
---
## Code example


```python
from sslearn.wrapper import TriTraining
from sslearn.model_selection import artificial_ssl_dataset
Expand All @@ -37,20 +42,17 @@ model = TriTraining().fit(X, y)
model.score(X_unlabel, true_label)
```

Citing
---
## Citing

```bibtex
@software{jose_luis_garrido_labrador_2023_7565222,
author = {José Luis Garrido-Labrador and
César García-Osorio and
Juan J. Rodríguez and
Jesus Maudes},
title = {jlgarridol/sslearn: V1.0.2},
@software{jose_luis_garrido_labrador_2024_10623889,
author = {José Luis Garrido-Labrador},
title = {jlgarridol/sslearn: v1.0.4},
month = feb,
year = 2023,
year = 2024,
publisher = {Zenodo},
version = {1.0.2},
doi = {10.5281/zenodo.7650049},
url = {https://doi.org/10.5281/zenodo.7650049}
version = {1.0.4},
doi = {10.5281/zenodo.10623889},
url = {https://doi.org/10.5281/zenodo.10623889}
}
```
7 changes: 7 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./sslearn.html"/>
</head>
</html>
62 changes: 62 additions & 0 deletions docs/make.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env python3
from pathlib import Path
import shutil
import textwrap
import base64

from jinja2 import Environment
from jinja2 import FileSystemLoader
from markupsafe import Markup
import pygments.formatters.html
import pygments.lexers.python

import pdoc.render

here = Path(__file__).parent.parent

# Ignore set_score_request in the docs


if __name__ == "__main__":

favicon = (here / "docs" / "sslearn_mini.webp").read_bytes()
favicon = base64.b64encode(favicon).decode("utf8")
logo = (here / "docs" / "sslearn.webp").read_bytes()
logo = base64.b64encode(logo).decode("utf8")

# Render main docs
pdoc.render.configure(

favicon="data:image/webp;base64," + favicon,
logo="data:image/webp;base64," + logo,
logo_link="/sslearn",
footer_text=f"pdoc {pdoc.__version__}",
search=True,
math=True,
include_undocumented=False,
docformat="numpy",
)

pdoc.pdoc(
here / "sslearn",
output_directory=here / "docs",
)


with (here / "sitemap.xml").open("w", newline="\n") as f:
f.write(
textwrap.dedent(
"""
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
"""
).strip()
)
for file in here.glob("**/*.html"):
if file.name.startswith("_"):
continue
filename = str(file.relative_to(here).as_posix()).replace("index.html", "")
f.write(f"""\n<url><loc>https://pdoc.dev/{filename}</loc></url>""")
f.write("""\n</urlset>""")
46 changes: 46 additions & 0 deletions docs/search.js

Large diffs are not rendered by default.

358 changes: 358 additions & 0 deletions docs/sslearn.html

Large diffs are not rendered by default.

Loading

0 comments on commit 993598f

Please sign in to comment.