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

Refactor: The channel_dim function should live in channel_props #244

Open
vprusso opened this issue Nov 15, 2023 · 3 comments
Open

Refactor: The channel_dim function should live in channel_props #244

vprusso opened this issue Nov 15, 2023 · 3 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@vprusso
Copy link
Owner

vprusso commented Nov 15, 2023

Right now, the channel_dim.py file lives in helper/ but should most likely live in channel_props/.

@vprusso vprusso added the good first issue Good for newcomers label Nov 15, 2023
@purva-thakre purva-thakre self-assigned this Nov 15, 2023
@purva-thakre purva-thakre mentioned this issue Nov 15, 2023
3 tasks
@purva-thakre
Copy link
Collaborator

purva-thakre commented Nov 16, 2023

Attempt 1 to fix this issue led to some object not callable errors. Fixing this issue will also mean we need to tackle the pytest import issues.

if python test_some_file.py was used, there were no errors. But using pytest does cause problems.

https://pytest.org/en/7.4.x/explanation/pythonpath.html#pytest-vs-python-m-pytest
https://blog.ionelmc.ro/2014/05/25/python-packaging/#alternatives
https://pytest-with-eric.com/introduction/pytest-pythonpath/#How-Does-Python-Find-The-Execution-Path
https://docs.pytest.org/en/7.1.x/explanation/pythonpath.html

In pytest documentation, following is recommended. This also does not fix the errors. https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#tests-outside-application-code

[tool.pytest.ini_options]
addopts = [
    "--import-mode=importlib",
]

Need to spend more time understanding PYTHONPATH and pytest issues. Using python -m pytest does not fix the multiple errors.

Trying out a toqito/src/toqito directory with a pytest.ini file also did not fix the errors.

Specifying the full path toqito.some_module.some_file import some_func does fix the errors but this is not recommended considering other functions imported via toqito.some_module import some_func do not lead to errors.

@purva-thakre
Copy link
Collaborator

purva-thakre commented Apr 9, 2024

Attempt 3 to resolve this issue also resulted in similar test failures.

Even after we changed the directory structure, moving the function to channel_props caused some import issues where we have to specify the full import path from toqito.channel_props.channel_dim import channel_dim. It's not like there are 2 functions labeled channel_dim?

Plus, with the full import path, there were a couple of test failures.

@purva-thakre
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
2 participants