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 Python 3.10 Support and Fix Compilation Issues #194

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CoolJosh0221
Copy link

Description

This pull request addresses several important updates to the libact package:

  1. Added Support for Python 3.10
  2. Modified libact/query_strategies/_hintsvm.pyx to Ensure Successful Compilation
    • Fixed syntax errors to ensure successful compilation.
  3. Updated Installation Instructions in README. md
    • Revised installation steps to include Python 3.10 setup.
  4. Updated examples/plot.py to include HintSVM example
  5. Resolved Dataset Error: Updated libact/base/dataset.py to fix the ValueError: setting an array element with a sequence issue during tests.

Current Status

  • Compilation Issues Fixed: Successfully addressed the compilation problems in _hintsvm. pyx .
  • Testing: Tests have not passed yet.
    • two of them fail, and one throws an error:
======================================================================
ERROR: test_cost_sensitive_random_pair_encoding (libact.query_strategies.multilabel.tests.test_multilabel_realdata.MultilabelRealdataTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspaces/libact/libact/query_strategies/multilabel/tests/test_multilabel_realdata.py", line 118, in test_cost_sensitive_random_pair_encoding
    qs = CostSensitiveReferencePairEncoding(
  File "/workspaces/libact/libact/query_strategies/multilabel/cost_sensitive_reference_pair_encoding.py", line 79, in __init__
    self.csrpe_ = CSRPE(scoring_fn=scoring_fn, base_clf=base_model,
  File "/workspaces/libact/libact/query_strategies/multilabel/cost_sensitive_reference_pair_encoding.py", line 156, in __init__
    self.nn_ = NearestNeighbors(1, algorithm='ball_tree',
TypeError: NearestNeighbors.__init__() takes 1 positional argument but 2 positional arguments (and 3 keyword-only arguments) were given

======================================================================
FAIL: test_density_weighted_meta_uncertainty_lc (libact.query_strategies.tests.test_density_weighted_meta.DensityWeightedMetaTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspaces/libact/libact/query_strategies/tests/test_density_weighted_meta.py", line 40, in test_density_weighted_meta_uncertainty_lc
    assert_array_equal(qseq, np.array([13, 18,  9, 12,  8, 16, 10, 19, 15, 17]))
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/numpy/_utils/__init__.py", line 85, in wrapper
    return fun(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/numpy/testing/_private/utils.py", line 1020, in assert_array_equal
    assert_array_compare(operator.__eq__, actual, desired, err_msg=err_msg,
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/numpy/testing/_private/utils.py", line 884, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

Mismatched elements: 3 / 10 (30%)
Max absolute difference among violations: 10
Max relative difference among violations: 0.58823529
 ACTUAL: array([18, 13,  9, 12,  8, 16, 10, 19, 15,  7])
 DESIRED: array([13, 18,  9, 12,  8, 16, 10, 19, 15, 17])

======================================================================
FAIL: test_DensityWeightedUncertaintySampling (libact.query_strategies.tests.test_realdata.RealdataTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspaces/libact/libact/query_strategies/tests/test_realdata.py", line 155, in test_DensityWeightedUncertaintySampling
    assert_array_equal(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/numpy/_utils/__init__.py", line 85, in wrapper
    return fun(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/numpy/testing/_private/utils.py", line 1020, in assert_array_equal
    assert_array_compare(operator.__eq__, actual, desired, err_msg=err_msg,
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/numpy/testing/_private/utils.py", line 884, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

Mismatched elements: 9 / 10 (90%)
Max absolute difference among violations: 227
Max relative difference among violations: 7.56666667
 ACTUAL: array([257, 220, 179,  84, 208,  70, 245,  62,  50,  69])
 DESIRED: array([ 30, 179, 104, 186,  28,  65, 142,  62, 257, 221])

----------------------------------------------------------------------

2. Modified README.md (changed the order of installing dependencies && changed the installation method)
Current Status: 2 of the tests fail and 1 throws an error
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.

1 participant