Skip to content

refactor: use mock_timeit utility in categorical timeit test - #1223

Open
ovodela wants to merge 19 commits into
capitalone:devfrom
capitalone-contributions:refactor-categorical-timeit-tests
Open

refactor: use mock_timeit utility in categorical timeit test#1223
ovodela wants to merge 19 commits into
capitalone:devfrom
capitalone-contributions:refactor-categorical-timeit-tests

Conversation

@ovodela

@ovodela ovodela commented Sep 9, 2026

Copy link
Copy Markdown

Summary

  • Replaces manual time.time patch (hardcoded float array) with shared test_utils.mock_timeit() context manager
  • Consistent with other tests in the same file (lines 940, 1004)
  • Removes unused from unittest.mock import patch

Test plan

  • test_timeit_profile passes with the new mock
  • No other tests affected

Closes #806

taylorfturner and others added 19 commits June 14, 2024 13:11
* refactor: Upgrade the models to use keras 3.0 (capitalone#1138)

* Replace snappy with cramjam (capitalone#1091)

* add downloads tile (capitalone#1085)

* Replace snappy with cramjam

* Delete test_no_snappy

---------

Co-authored-by: Taylor Turner <taylorfturner@gmail.com>

* pre-commit fix (capitalone#1122)

* Bug fix for float precision calculation using categorical data with trailing zeros. (capitalone#1125)

* Revert "Bug fix for float precision calculation using categorical data with t…" (capitalone#1133)

This reverts commit d3159bd.

* refactor: move layers outside of class

* refactor: update model to keras 3.0

* fix: manifest

* fix: bugs in compile and train

* fix: bug in load_from_library

* fix: bugs in CharCNN

* refactor: loading tf model labeler

* fix: bug in data_labeler identification

* fix: update model to use proper softmax layer names

* fix: formatting

* fix: remove unused line

* refactor: drop support for 3.8

* fix: comments

* fix: comment

---------

Co-authored-by: Gábor Lipták <gliptak@gmail.com>
Co-authored-by: Taylor Turner <taylorfturner@gmail.com>
Co-authored-by: James Schadt <jamesrschadt@gmail.com>

* Fix Tox (capitalone#1143)

* tox new

* update

* update

* update

* update

* update

* update

* update

* update tox.ini

* update

* update

* remove docs

* empty retrigger

* update (capitalone#1146)

* bump version

* update 3.11

* remove dist/

---------

Co-authored-by: JGSweets <JGSweets@users.noreply.github.com>
Co-authored-by: Gábor Lipták <gliptak@gmail.com>
Co-authored-by: James Schadt <jamesrschadt@gmail.com>
* refactor: Upgrade the models to use keras 3.0 (capitalone#1138)

* Replace snappy with cramjam (capitalone#1091)

* add downloads tile (capitalone#1085)

* Replace snappy with cramjam

* Delete test_no_snappy

---------



* pre-commit fix (capitalone#1122)

* Bug fix for float precision calculation using categorical data with trailing zeros. (capitalone#1125)

* Revert "Bug fix for float precision calculation using categorical data with t…" (capitalone#1133)

This reverts commit d3159bd.

* refactor: move layers outside of class

* refactor: update model to keras 3.0

* fix: manifest

* fix: bugs in compile and train

* fix: bug in load_from_library

* fix: bugs in CharCNN

* refactor: loading tf model labeler

* fix: bug in data_labeler identification

* fix: update model to use proper softmax layer names

* fix: formatting

* fix: remove unused line

* refactor: drop support for 3.8

* fix: comments

* fix: comment

---------





* Fix Tox (capitalone#1143)

* tox new

* update

* update

* update

* update

* update

* update

* update

* update tox.ini

* update

* update

* remove docs

* empty retrigger

* update (capitalone#1146)

* Add Python 3.11 to GHA (capitalone#1090)

* add downloads tile (capitalone#1085)

* Add Python 3.11 to GHA

* Replace snappy with cramjam (capitalone#1091)

* add downloads tile (capitalone#1085)

* Replace snappy with cramjam

* Delete test_no_snappy

---------



* Update dask modules

* Install dask dataframe

* Update dask modules in precommit

* Correct copy/paste error

* Try again to clear Unicode

* Rolled back pre-commit dask version

* Add py311 to tox

* Bump dask to 2024.4.1

* Bump python-snappy 0.7.1

* Rewrite labeler test

* Correct isort

* Satisfy black

* And flake8

* Synced with requirements

---------



* [Vuln Fix]: Resolve mend vulnerabilities related to requests. (capitalone#1162)

* resolved check-manifest issue

* updating keras version pin to <=3.4.0

* adding comment in requirements.txt to trigger mend check

---------



---------

Co-authored-by: JGSweets <JGSweets@users.noreply.github.com>
Co-authored-by: Gábor Lipták <gliptak@gmail.com>
Co-authored-by: Taylor Turner <taylorfturner@gmail.com>
Co-authored-by: James Schadt <jamesrschadt@gmail.com>
Co-authored-by: Michael Davis <36012613+micdavis@users.noreply.github.com>
* chore: create publish-docs.yml

* brought in docs directory
* chore: update workflow to properly install pandoc
* chore: update build to build to a LATEST directory
* chore: permissions for publish-docs
…ng (capitalone#1181)

* docs: add architecture.rst for algorithm rationale, testing, and versioning details

* docs: remove manual table of contents from architecture.rst for Furo compatibility and edit  content
* ops: drop python 3.9 (EOL)
* ops: add whitesource config
* fix: don't add python 3.12 yet
* ops: add whitesource config to MANIFEST
* fix: remove `--forked` to fix coverage
* fix: remove tests that depend on `--forked`
* ops: update vulnerable libraries
* ops: properly configure whitesource
* ops: add whitesource config to MANIFEST
* Update data_utils.py

* revert: chardet import

* fix: chardet requirements

* fix: pandas req limit

* fix: tests with approx

* fix: missing test fix
* refactor: move from deprecated pkg_resources

* fix: base str traversal

* fix: to use func

* fix: add missing change

* refactor: move from data_files to package_files

* refactor: resources to be in package

* fix: utils

* fix: path error

* fix: str required

* fix: tests bc of almost

* feat: refactor to pass in a path or string or None

* fix: import for older versions

* fix: Tranversable must be done at runtime

* fix: add test

* fix: accidentally duplicated test on rebase

* fix: remove pass
)

* refactor: move from deprecated pkg_resources

* fix: to use func

* fix: add missing change

* refactor: resources to be in package

* fix: tests bc of almost

* feat: refactor to pass in a path or string or None

* fix: import for older versions

* fix: Tranversable must be done at runtime

* refactor: keras reqs and others

* refactor: losses for keras and tests

* fix: remove unneeded global

* fix: accidentally duplicated test on rebase

* fix: rebase duplicates

* fix: keras reqs

* refactor: update to be more than 3.4.0 for keras

* refactor: numpy2 and mypy

* fix: mypy 3.10

* fix: bugs

* fix: float

* refactor: for hist fix too

* fix: issue with none in hist

* fix: remove comment

* refactor: to still utilize dict mapping for losses

* fix: int pre-commit

* fix: train labeling

* refactor notes, reqs, and change log

* fix: pre-commit

* refactor: add unit tests validating usage of the old load format
* refactor: add py3.12 and py3.13 to tests

* fix: commit setting

* fix: mypy issues

* fix: typing

* refactor: update mypy

* fix: issues with mypy

* fix: cnn typing

* fix: typing again

* fix: numpy typing

* fix: typing more

* fix: typing more

* fix: req issue

* fix: test failure

* fix: bug in test

* fix: assertalmostequal
* docs: add 0.14.0 changelog

* chore: trigger checks
Replace manual time.time patch with shared test_utils.mock_timeit()
context manager for consistency with other tests in the file.

Closes capitalone#806
@ovodela
ovodela requested a review from a team as a code owner September 9, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants