From 8e729d1d14498ea7f5c437616c96dd947039b39e Mon Sep 17 00:00:00 2001 From: Jose Luis Garrido-Labrador Date: Fri, 21 Jun 2024 14:38:18 +0200 Subject: [PATCH] Update directory tree to SOFTX guide --- .github/workflows/docs.yml | 2 +- .github/workflows/python-package.yml | 3 +- .github/workflows/python-publish.yml | 4 +- .readthedocs.yaml | 32 ------------ LICENSE => License.txt | 0 logging_config.json | 49 ------------------- sitemap.xml | 14 ------ setup.cfg => src/setup.cfg | 0 setup.py => src/setup.py | 0 {sslearn => src/sslearn}/__init__.py | 0 {sslearn => src/sslearn}/base.py | 0 {sslearn => src/sslearn}/datasets/__init__.py | 0 {sslearn => src/sslearn}/datasets/_loader.py | 0 .../sslearn}/datasets/_preprocess.py | 0 {sslearn => src/sslearn}/datasets/_writer.py | 0 .../sslearn}/model_selection/__init__.py | 0 .../sslearn}/model_selection/_split.py | 0 {sslearn => src/sslearn}/restricted.py | 0 {sslearn => src/sslearn}/subview/__init__.py | 0 {sslearn => src/sslearn}/subview/_subview.py | 0 {sslearn => src/sslearn}/utils.py | 0 {sslearn => src/sslearn}/wrapper/__init__.py | 0 {sslearn => src/sslearn}/wrapper/_co.py | 0 {sslearn => src/sslearn}/wrapper/_self.py | 0 .../sslearn}/wrapper/_tritraining.py | 0 25 files changed, 6 insertions(+), 98 deletions(-) delete mode 100644 .readthedocs.yaml rename LICENSE => License.txt (100%) delete mode 100644 logging_config.json delete mode 100644 sitemap.xml rename setup.cfg => src/setup.cfg (100%) rename setup.py => src/setup.py (100%) rename {sslearn => src/sslearn}/__init__.py (100%) rename {sslearn => src/sslearn}/base.py (100%) rename {sslearn => src/sslearn}/datasets/__init__.py (100%) rename {sslearn => src/sslearn}/datasets/_loader.py (100%) rename {sslearn => src/sslearn}/datasets/_preprocess.py (100%) rename {sslearn => src/sslearn}/datasets/_writer.py (100%) rename {sslearn => src/sslearn}/model_selection/__init__.py (100%) rename {sslearn => src/sslearn}/model_selection/_split.py (100%) rename {sslearn => src/sslearn}/restricted.py (100%) rename {sslearn => src/sslearn}/subview/__init__.py (100%) rename {sslearn => src/sslearn}/subview/_subview.py (100%) rename {sslearn => src/sslearn}/utils.py (100%) rename {sslearn => src/sslearn}/wrapper/__init__.py (100%) rename {sslearn => src/sslearn}/wrapper/_co.py (100%) rename {sslearn => src/sslearn}/wrapper/_self.py (100%) rename {sslearn => src/sslearn}/wrapper/_tritraining.py (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index eb7c5aa..e0a3356 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,7 +26,7 @@ jobs: # 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: if [ -f src/requirements.txt ]; then pip install -r src/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. diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 979d055..4fe9613 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -28,7 +28,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install flake8 pytest coverage - pip install -r requirements.txt + pip install -r src/requirements.txt - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -37,6 +37,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | + cd src coverage run -m pytest test # Only if ubuntu-latest - name: Coverage diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index bdaab28..896eb25 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -31,7 +31,9 @@ jobs: python -m pip install --upgrade pip pip install build - name: Build package - run: python -m build + run: | + cd src + python -m build - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index f89fc90..0000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# .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 diff --git a/LICENSE b/License.txt similarity index 100% rename from LICENSE rename to License.txt diff --git a/logging_config.json b/logging_config.json deleted file mode 100644 index f70c258..0000000 --- a/logging_config.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "version": 1, - "disable_existing_loggers": false, - "formatters": { - "simple": { - "format": "%(asctime)s - %(pathname)s - %(funcName)s - %(levelname)s - %(message)s" - }, - "operation": { - "format": "%(asctime)s;%(pathname)s;%(funcName)s;%(message)s" - } - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "DEBUG", - "formatter": "simple", - "stream": "ext://sys.stdout" - }, - "info_file_handler": { - "class": "logging.handlers.RotatingFileHandler", - "level": "INFO", - "formatter": "simple", - "filename": "logs/info.log", - "maxBytes": 10485760, - "backupCount": 20, - "encoding": "utf8" - }, - "error_file_handler": { - "class": "logging.handlers.RotatingFileHandler", - "level": "ERROR", - "formatter": "simple", - "filename": "logs/errors.log", - "maxBytes": 10485760, - "backupCount": 20, - "encoding": "utf8" - }, - "evolution_file_handler": { - "class": "sslearn.logger.EvoHandler", - "level": "EVO", - "formatter": "evolution", - "filename": "logs/evolution.log.csv", - "encoding": "utf8" - } - }, - "root": { - "level": "NOTSET", - "handlers": ["console", "info_file_handler", "error_file_handler", "operation_file_handler"] - } -} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index 6e7fb7f..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,14 +0,0 @@ - - -https://pdoc.dev/docs/ -https://pdoc.dev/docs/sslearn.html -https://pdoc.dev/docs/sslearn/subview.html -https://pdoc.dev/docs/sslearn/model_selection.html -https://pdoc.dev/docs/sslearn/base.html -https://pdoc.dev/docs/sslearn/datasets.html -https://pdoc.dev/docs/sslearn/wrapper.html -https://pdoc.dev/docs/sslearn/restricted.html -https://pdoc.dev/docs/sslearn/utils.html - \ No newline at end of file diff --git a/setup.cfg b/src/setup.cfg similarity index 100% rename from setup.cfg rename to src/setup.cfg diff --git a/setup.py b/src/setup.py similarity index 100% rename from setup.py rename to src/setup.py diff --git a/sslearn/__init__.py b/src/sslearn/__init__.py similarity index 100% rename from sslearn/__init__.py rename to src/sslearn/__init__.py diff --git a/sslearn/base.py b/src/sslearn/base.py similarity index 100% rename from sslearn/base.py rename to src/sslearn/base.py diff --git a/sslearn/datasets/__init__.py b/src/sslearn/datasets/__init__.py similarity index 100% rename from sslearn/datasets/__init__.py rename to src/sslearn/datasets/__init__.py diff --git a/sslearn/datasets/_loader.py b/src/sslearn/datasets/_loader.py similarity index 100% rename from sslearn/datasets/_loader.py rename to src/sslearn/datasets/_loader.py diff --git a/sslearn/datasets/_preprocess.py b/src/sslearn/datasets/_preprocess.py similarity index 100% rename from sslearn/datasets/_preprocess.py rename to src/sslearn/datasets/_preprocess.py diff --git a/sslearn/datasets/_writer.py b/src/sslearn/datasets/_writer.py similarity index 100% rename from sslearn/datasets/_writer.py rename to src/sslearn/datasets/_writer.py diff --git a/sslearn/model_selection/__init__.py b/src/sslearn/model_selection/__init__.py similarity index 100% rename from sslearn/model_selection/__init__.py rename to src/sslearn/model_selection/__init__.py diff --git a/sslearn/model_selection/_split.py b/src/sslearn/model_selection/_split.py similarity index 100% rename from sslearn/model_selection/_split.py rename to src/sslearn/model_selection/_split.py diff --git a/sslearn/restricted.py b/src/sslearn/restricted.py similarity index 100% rename from sslearn/restricted.py rename to src/sslearn/restricted.py diff --git a/sslearn/subview/__init__.py b/src/sslearn/subview/__init__.py similarity index 100% rename from sslearn/subview/__init__.py rename to src/sslearn/subview/__init__.py diff --git a/sslearn/subview/_subview.py b/src/sslearn/subview/_subview.py similarity index 100% rename from sslearn/subview/_subview.py rename to src/sslearn/subview/_subview.py diff --git a/sslearn/utils.py b/src/sslearn/utils.py similarity index 100% rename from sslearn/utils.py rename to src/sslearn/utils.py diff --git a/sslearn/wrapper/__init__.py b/src/sslearn/wrapper/__init__.py similarity index 100% rename from sslearn/wrapper/__init__.py rename to src/sslearn/wrapper/__init__.py diff --git a/sslearn/wrapper/_co.py b/src/sslearn/wrapper/_co.py similarity index 100% rename from sslearn/wrapper/_co.py rename to src/sslearn/wrapper/_co.py diff --git a/sslearn/wrapper/_self.py b/src/sslearn/wrapper/_self.py similarity index 100% rename from sslearn/wrapper/_self.py rename to src/sslearn/wrapper/_self.py diff --git a/sslearn/wrapper/_tritraining.py b/src/sslearn/wrapper/_tritraining.py similarity index 100% rename from sslearn/wrapper/_tritraining.py rename to src/sslearn/wrapper/_tritraining.py