Skip to content

Commit 84dabeb

Browse files
authored
Merge pull request #182 from uclamii/logo_ascii_LS
Move logo to different script; streamlined
2 parents 3cc335d + 980e18c commit 84dabeb

File tree

2 files changed

+56
-12
lines changed

2 files changed

+56
-12
lines changed

src/model_tuner/__init__.py

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,53 @@
1-
"""
2-
3-
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
4-
$ __ __ _ _ _____ $
5-
$ | \/ | ___ __| | ___| | |_ _| _ _ __ ___ _ __ $
6-
$ | |\/| |/ _ \ / _` |/ _ \ | | || | | | '_ \ / _ \ '__| $
7-
$ | | | | (_) | (_| | __/ | | || |_| | | | | __/ | $
8-
$ |_| |_|\___/ \__,_|\___|_| |_| \__,_|_| |_|\___|_| $
9-
$ $
10-
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
11-
1+
from .main import *
2+
from .logo import *
3+
4+
import os
5+
import sys
6+
import builtins
7+
8+
# Detailed Documentation
9+
10+
detailed_doc = """
1211
The `model_tuner` library is a versatile and powerful tool designed to
1312
facilitate the training, evaluation, and tuning of machine learning models.
1413
It supports various functionalities such as handling imbalanced data, applying
1514
different scaling and imputation techniques, calibrating models, and conducting
1615
cross-validation. This library is particularly useful for model selection,
1716
hyperparameter tuning, and ensuring optimal performance across different metrics.
1817
18+
PyPI: https://pypi.org/project/model-tuner/
19+
Documentation: https://uclamii.github.io/model_tuner/
20+
21+
1922
Version: 0.0.25a
2023
2124
"""
2225

26+
# Assign only the detailed documentation to __doc__
27+
__doc__ = detailed_doc
28+
29+
2330
__version__ = "0.0.25a"
2431
__author__ = "Arthur Funnell, Leonid Shpaner, Panayiotis Petousis"
2532
2633

27-
from .main import *
34+
35+
# Define the custom help function
36+
def custom_help(obj=None):
37+
"""
38+
Custom help function to dynamically include ASCII art in help() output.
39+
"""
40+
if (
41+
obj is None or obj is sys.modules[__name__]
42+
): # When `help()` is called for this module
43+
print(model_tuner_logo) # Print ASCII art first
44+
print(detailed_doc) # Print the detailed documentation
45+
else:
46+
original_help(obj) # Use the original help for other objects
47+
48+
49+
# Backup the original help function
50+
original_help = builtins.help
51+
52+
# Override the global help function in builtins
53+
builtins.help = custom_help

src/model_tuner/logo.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
##################################################################################
2+
# ASCII Art
3+
##################################################################################
4+
5+
import os
6+
7+
model_tuner_logo = """
8+
9+
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
10+
$ __ __ _ _ _____ $
11+
$ | \/ | ___ __| | ___| | |_ _| _ _ __ ___ _ __ $
12+
$ | |\/| |/ _ \ / _` |/ _ \ | | || | | | '_ \ / _ \ '__| $
13+
$ | | | | (_) | (_| | __/ | | || |_| | | | | __/ | $
14+
$ |_| |_|\___/ \__,_|\___|_| |_| \__,_|_| |_|\___|_| $
15+
$ $
16+
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
17+
18+
"""

0 commit comments

Comments
 (0)