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

Issue with CySimpleEllipseDispatcher During Test Case Execution #264

Open
Btushir opened this issue Jul 1, 2024 · 3 comments
Open

Issue with CySimpleEllipseDispatcher During Test Case Execution #264

Btushir opened this issue Jul 1, 2024 · 3 comments
Assignees

Comments

@Btushir
Copy link

Btushir commented Jul 1, 2024

I am currently testing the RidePy project and have encountered an issue with the CySimpleEllipseDispatcher during the execution of the test case test_same_location_with_detour. The installation was verified following the instructions provided, but the test case fails with an assertion error. I would really appreciate if you could please help me resolve this: Below are the details:

Environment
OS: macOS
Python Version: 3.9.19
RidePy Version: Latest from the repository
Below is the output of the test case:
================================================================================================ test session starts ================================================================================================
platform darwin -- Python 3.9.19, pytest-8.2.2, pluggy-1.5.0
rootdir: /Users/bhagyashritushir/PycharmProjects/ridepy/ridepy
configfile: pytest.ini
plugins: hypothesis-6.104.2, anyio-4.4.0
collected 9 items

test/test_simple_ellipse_dispatcher.py .....F... [100%]

===================================================================================================== FAILURES ======================================================================================================
______________________________________________________________________________________ test_same_location_with_detour[cython] _______________________________________________________________________________________

kind = 'cython'

@pytest.mark.parametrize("kind", ["cython"])
def test_same_location_with_detour(kind):
    # fmt: off
    # location, cpat, tw_min, tw_max, occupancy
    stoplist_properties = [
        [(0, 0), 0, 0, inf],
        [(0, 1), 1, 0, inf],
        [(0, 1), 1, 0, inf],
        [(0, 5), 5, 0, inf],
        [(0, 5), 5, 0, inf],
    ]
    # fmt: on
    eps = 1e-4

    request_properties = dict(
        request_id=42,
        creation_timestamp=1,
        origin=(0, 1),
        destination=(0, 5),
        pickup_timewindow_min=0,
        pickup_timewindow_max=inf,
        delivery_timewindow_min=0,
        delivery_timewindow_max=inf,
    )
    (
        space,
        request,
        stoplist,
        _,
    ) = setup_insertion_data_structures(
        stoplist_properties=stoplist_properties,
        request_properties=request_properties,
        space_type="Manhattan2D",
        kind=kind,
    )
    min_cost, new_stoplist, *_ = CySimpleEllipseDispatcher(loc_type=space.loc_type)(
        request, stoplist, space, seat_capacity=10, max_relative_detour=1
    )

    assert min_cost == 0
    assert new_stoplist[1].location == request.origin
  assert new_stoplist[-3].location == request.destination

E assert (0.0, 1.0) == (0.0, 5.0)
E
E At index 1 diff: 1.0 != 5.0
E Use -v to get more diff

test/test_simple_ellipse_dispatcher.py:355: AssertionError
================================================================================================= warnings summary ==================================================================================================
src/ridepy/init.py:1
/Users/bt/PycharmProjects/ridepy/ridepy/src/ridepy/init.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import get_distribution, DistributionNotFound

../../../../../opt/anaconda3/envs/ridepy/lib/python3.9/site-packages/pkg_resources/init.py:2832
/opt/anaconda3/envs/ridepy/lib/python3.9/site-packages/pkg_resources/init.py:2832: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('sphinxcontrib').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================================== short test summary info ==============================================================================================
FAILED test/test_simple_ellipse_dispatcher.py::test_same_location_with_detour[cython] - assert (0.0, 1.0) == (0.0, 5.0)
====================================================================================== 1 failed, 8 passed, 2 warnings in 1.29s ======================================================================================

@fxjung
Copy link
Member

fxjung commented Jul 9, 2024

Thanks for posting this, looks strange indeed. I will look into this.

@fxjung fxjung self-assigned this Jul 9, 2024
@Btushir
Copy link
Author

Btushir commented Jul 9, 2024

@fxjung Thanks. Looking forward to it. Let me know if you need more information.

@fxjung
Copy link
Member

fxjung commented Jul 18, 2024

I have just tried to reproduce the problem, and unfortunately failed. Under Linux, using the exact same Python version, the test passes. Have you created a fresh virtual environment? If not, you could try to do so. Also, if you have a Linux or Windows installation at hand, you could try to see whether the error persists there.

Could you please post the output of pip freeze in the environment you were using? Maybe this caused by some change in a third-party package...

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

No branches or pull requests

2 participants