Skip to content

Commit

Permalink
versioneer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcolinmorgan committed Feb 2, 2024
1 parent aab48b1 commit 974f9c5
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 13 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,35 @@ However, this graph does not mean to imply the trend goes on forever, as current
GPU = colab T4 + 15gb mem and colab CPU + 12gb memory



## Startup Code:
## Startup Code demonstrating speedup:

! pip install cu-cat dirty-cat
from time import time
from cu_cat._table_vectorizer import TableVectorizer as cu_TableVectorizer
from dirty_cat._table_vectorizer import TableVectorizer as dirty_TableVectorizer
from sklearn.datasets import fetch_20newsgroups
n_samples = 2000 # speed boost improves as n_samples increases, to the limit of gpu mem

news, _ = fetch_20newsgroups(
shuffle=True,
random_state=1,
remove=("headers", "footers", "quotes"),
return_X_y=True,
)

news = news[:n_samples]
news=pd.DataFrame(news)
table_vec = cu_TableVectorizer()
t = time()
aa = table_vec.fit_transform((news))
ct = time() - t
# if deps.dirty_cat:
t = time()
bb = dirty_TableVectorizer().fit_transform(news)
dt = time() - t
print(f"cu_cat: {ct:.2f}s, dirty_cat: {dt:.2f}s, speedup: {dt/ct:.2f}x")
>>> cu_cat: 58.76s, dirty_cat: 84.54s, speedup: 1.44x
## Enhanced Code using Graphistry:

# !pip install graphistry[ai] ## future releases will have this by default
!pip install git+https://github.com/graphistry/pygraphistry.git@dev/depman_gpufeat
Expand Down
5 changes: 3 additions & 2 deletions cu_cat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
from ._gap_encoder import GapEncoder # type: ignore
from ._table_vectorizer import SuperVectorizer, TableVectorizer

with open(_Path(__file__).parent / "VERSION.txt") as _fh:
__version__ = _fh.read().strip()
from ._version import get_versions

__version__ = get_versions()["version"]
del get_versions

__all__ = [
"DatetimeEncoder",
Expand Down
4 changes: 2 additions & 2 deletions cu_cat/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "graphistry-"
cfg.versionfile_source = "graphistry/_version.py"
cfg.parentdir_prefix = "cu_cat-"
cfg.versionfile_source = "cu_cat/_version.py"
cfg.verbose = False
return cfg

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# -- Project information -----------------------------------------------------

project = "CU_CAT"
copyright = "2023, Graphistry, Inc."
copyright = "2024, Graphistry, Inc."
author = "Graphistry, Inc."

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cu_cat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Table_Vectorizer
Versioneer
==================

.. automodule:: graphistry._version
.. automodule:: cu_cat._version
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/source/versioneer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.. toctree::
:maxdepth: 2

graphistry.plugins_types
cu_cat.plugins_types
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages
import versioneer
# # #github

def unique_flatten_dict(d):
return list(set(sum( d.values(), [] )))

Expand All @@ -16,9 +16,8 @@ def unique_flatten_dict(d):
'flake8>=5.0',
'psutil',
'build',
'versioneer',
'dirty-cat',
# 'cuml', ## cannot test on github actions
'dirty-cat', # only for pytest speed comparison
# 'cuml', # cannot test on github actions
# 'cudf',
# 'cupy'
]
Expand Down

0 comments on commit 974f9c5

Please sign in to comment.