Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tests for python bindings #275

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

Popov-Dmitriy-Ivanovich
Copy link
Contributor

No description provided.

src/core/config/option.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/core/algorithms/algorithm.h Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/core/algorithms/algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/opt_to_str.cpp Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Show resolved Hide resolved
src/python_bindings/test_bindings.py Show resolved Hide resolved
src/core/config/option.h Outdated Show resolved Hide resolved
src/core/algorithms/algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/opt_to_str.cpp Outdated Show resolved Hide resolved
src/python_bindings/opt_to_str.cpp Outdated Show resolved Hide resolved
src/python_bindings/opt_to_str.cpp Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/core/algorithms/algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/opt_to_py.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/bindings.cpp Outdated Show resolved Hide resolved
src/python_bindings/opt_to_str.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@BUYT-1 BUYT-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass a dictionary with options directly to execute or load_data via algo.execute(**options). The methods there don't care about order of options in your dicts, so there is less to think about.

I don't think the chosen test structure is appropriate. It seems that all we are doing is setting load_data options and execute options from a predefined dictionary, in addition to a few failure cases for MetricVerifier. The code should reflect that.

I suggest the following test structure. A unittest.TestCase with a single test_correct_option_setting method where all algorithms are tested with correct options, using option dicts and loops, and a unittest.TestCase with the MetricVerifier failure cases.

Other change request may not apply after the above is done.

src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/opt_to_py.h Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/opt_to_py.h Outdated Show resolved Hide resolved
src/python_bindings/opt_to_py.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/opt_to_py.cpp Show resolved Hide resolved
src/core/algorithms/algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/bindings.cpp Outdated Show resolved Hide resolved
src/python_bindings/opt_to_py.cpp Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@BUYT-1 BUYT-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there

src/python_bindings/opt_to_py.h Outdated Show resolved Hide resolved
src/python_bindings/py_algorithm.h Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@BUYT-1 BUYT-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash the commits into one or two

src/python_bindings/test_bindings.py Outdated Show resolved Hide resolved
1. Add feature to get option values after it has been set.
2. Add testcases for desbordante algorithms to test if options
transferred correctly.
3. Modify CI/CD.
@chernishev chernishev merged commit e0c6f05 into Desbordante:main Feb 16, 2024
20 checks passed
@Popov-Dmitriy-Ivanovich Popov-Dmitriy-Ivanovich deleted the test_pybind branch February 17, 2024 11:50
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.

3 participants