Skip to content

Commit

Permalink
Merge pull request #182 from uclamii/logo_ascii_LS
Browse files Browse the repository at this point in the history
Move logo to different script; streamlined
  • Loading branch information
elemets authored Feb 3, 2025
2 parents 3cc335d + 980e18c commit 84dabeb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 12 deletions.
50 changes: 38 additions & 12 deletions src/model_tuner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
"""
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ __ __ _ _ _____ $
$ | \/ | ___ __| | ___| | |_ _| _ _ __ ___ _ __ $
$ | |\/| |/ _ \ / _` |/ _ \ | | || | | | '_ \ / _ \ '__| $
$ | | | | (_) | (_| | __/ | | || |_| | | | | __/ | $
$ |_| |_|\___/ \__,_|\___|_| |_| \__,_|_| |_|\___|_| $
$ $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
from .main import *
from .logo import *

import os
import sys
import builtins

# Detailed Documentation

detailed_doc = """
The `model_tuner` library is a versatile and powerful tool designed to
facilitate the training, evaluation, and tuning of machine learning models.
It supports various functionalities such as handling imbalanced data, applying
different scaling and imputation techniques, calibrating models, and conducting
cross-validation. This library is particularly useful for model selection,
hyperparameter tuning, and ensuring optimal performance across different metrics.
PyPI: https://pypi.org/project/model-tuner/
Documentation: https://uclamii.github.io/model_tuner/
Version: 0.0.25a
"""

# Assign only the detailed documentation to __doc__
__doc__ = detailed_doc


__version__ = "0.0.25a"
__author__ = "Arthur Funnell, Leonid Shpaner, Panayiotis Petousis"
__email__ = "lshpaner@ucla.edu; alafunnell@gmail.com; pp89@ucla.edu"

from .main import *

# Define the custom help function
def custom_help(obj=None):
"""
Custom help function to dynamically include ASCII art in help() output.
"""
if (
obj is None or obj is sys.modules[__name__]
): # When `help()` is called for this module
print(model_tuner_logo) # Print ASCII art first
print(detailed_doc) # Print the detailed documentation
else:
original_help(obj) # Use the original help for other objects


# Backup the original help function
original_help = builtins.help

# Override the global help function in builtins
builtins.help = custom_help
18 changes: 18 additions & 0 deletions src/model_tuner/logo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##################################################################################
# ASCII Art
##################################################################################

import os

model_tuner_logo = """
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ __ __ _ _ _____ $
$ | \/ | ___ __| | ___| | |_ _| _ _ __ ___ _ __ $
$ | |\/| |/ _ \ / _` |/ _ \ | | || | | | '_ \ / _ \ '__| $
$ | | | | (_) | (_| | __/ | | || |_| | | | | __/ | $
$ |_| |_|\___/ \__,_|\___|_| |_| \__,_|_| |_|\___|_| $
$ $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
"""

0 comments on commit 84dabeb

Please sign in to comment.