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

Random doctest failures #575

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Random doctest failures #575

merged 2 commits into from
Apr 30, 2024

Conversation

purva-thakre
Copy link
Collaborator

@purva-thakre purva-thakre commented Apr 30, 2024

Description

Fixes #473

This is technically not a fix as we have to specify the full import path for a bunch of files only. If this is indeed the source of the issue where Python could not distinguish between the module and functions, we should rename all .py files to not have the same names as the functions in them.

For example, rename toqito/state_props/is_antidistinguishable.py to toqito/state_props/is_antidistinguishable_function.py

Changes

Notable changes that this PR has either accomplished or will accomplish. Feel free to add more lines to the itemized list
below.

  • Added full import path for the failing doctest examples

Checklist

Before marking your PR ready for review, make sure you checked the following locally. If this is your first PR, you might be notified of some workflow failures after a maintainer has approved the workflow jobs to be run on your PR.

Additional information is available in the documentation.

  • Use ruff and pylint for errors related to code style and formatting.
  • Verify all previous and newly added unit tests pass in pytest.
  • Check the documentation build does not lead to any failures. Sphinx build can be checked locally for any failures related to your PR
  • Use linkcheck to check for broken links in the documentation
  • Use doctest to verify the examples in the function docstrings work as expected.

@vprusso
Copy link
Owner

vprusso commented Apr 30, 2024

Definitely a useful one to make! Thank you, @purva-thakre !

@purva-thakre purva-thakre marked this pull request as ready for review April 30, 2024 01:50
@purva-thakre
Copy link
Collaborator Author

purva-thakre commented Apr 30, 2024

@vprusso Ha! No worries, the random failures were driving me crazy. BTW you commented before I got the chance to edit the PR description. I think the issue is due to Python getting confused about importing the module or the function. An easier solution would be to rename all the .py files.

Edit: We could also hold on for a couple of days to check if the doctest workflow fails after merging this PR. I am still not sure if this is indeed the problem that's causing these failures.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.1%. Comparing base (e0aed37) to head (72a366a).

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #575   +/-   ##
======================================
  Coverage    98.1%   98.1%           
======================================
  Files         162     162           
  Lines        3108    3108           
  Branches      760     760           
======================================
  Hits         3050    3050           
  Misses         37      37           
  Partials       21      21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vprusso
Copy link
Owner

vprusso commented Apr 30, 2024

Hmm, renaming the files seems dangerous and could break backwards compatibility. Not sure exactly what's going on with the failures, but I would consider something like that as a last ditch effort I'd say.

@purva-thakre
Copy link
Collaborator Author

So, do you want me to create an issue so that we work on this sometime in the future? I did add a comment in case we accidentally remove these.

I have a feeling this PR and #244 are closely related.

@vprusso
Copy link
Owner

vprusso commented Apr 30, 2024

For now if this works, that's great. Still curious why this is failing though as it seems to abide by the same pattern as other functions abide by. Curious, but for now, LGTM

@purva-thakre purva-thakre merged commit c2d1d6e into master Apr 30, 2024
18 checks passed
@purva-thakre purva-thakre deleted the doctest_import_path branch April 30, 2024 17:08
@purva-thakre
Copy link
Collaborator Author

Still curious why this is failing though as it seems to abide by the same pattern as other functions abide by.

Same here!

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.

Failing examples in the doctest workflow
2 participants