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

Fix doctests #122

Merged
merged 10 commits into from
Oct 30, 2020
Merged

Fix doctests #122

merged 10 commits into from
Oct 30, 2020

Conversation

amolenaar
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

Doctests were not executed.

Issue Number: N/A

What is the new behavior?

Doctests are executed. Although I think a bunch of them should move to unit tests, since they have little value for (new) users.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Great idea! Did you see that Python 3.6 and 3.7 are causing a seg fault?

@amolenaar
Copy link
Member Author

Not yet. But that's why I tried it on a branch first 😊

@danyeaw
Copy link
Member

danyeaw commented Oct 26, 2020

@amolenaar I made some updates to match the tox/build config from the generic repo, and I fixed an issue setting the strength of a Variable instance. We are getting a seg fault still on the CI, any ideas?

amolenaar and others added 9 commits October 27, 2020 20:53
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
@danyeaw danyeaw force-pushed the fix-doc-tests branch 2 times, most recently from 3223625 to 1e6d5fd Compare October 30, 2020 01:40
Signed-off-by: Dan Yeaw <dan@yeaw.me>
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 30, 2020

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.08%.

Quality metrics Before After Change
Complexity 1.00 ⭐ 0.99 ⭐ -0.01 👍
Method Length 31.87 ⭐ 31.71 ⭐ -0.16 👍
Working memory 5.30 ⭐ 5.28 ⭐ -0.02 👍
Quality 89.75% 89.83% 0.08% 👍
Other metrics Before After Change
Lines 1440 1443 3
Changed files Quality Before Quality After Quality Change
gaphas/geometry.py 77.95% ⭐ 77.96% ⭐ 0.01% 👍
gaphas/item.py 91.49% ⭐ 91.49% ⭐ 0.00%
gaphas/matrix.py 93.63% ⭐ 93.63% ⭐ 0.00%
gaphas/table.py 74.43% 🙂 74.43% 🙂 0.00%
gaphas/solver/variable.py 95.95% ⭐ 96.06% ⭐ 0.11% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gaphas/geometry.py intersect_line_line 15 🙂 247 ⛔ 15 😞 33.49% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/geometry.py point_on_rectangle 19 😞 142 😞 11 😞 44.71% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gaphas/item.py Line._update_orthogonal_constraints 11 🙂 142 😞 12 😞 49.54% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/table.py Table.query 7 ⭐ 171 😞 11 😞 52.04% 🙂 Try splitting into smaller methods. Extract out complex expressions
gaphas/item.py Element.__init__ 0 166 😞 13 😞 56.11% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@danyeaw danyeaw merged commit 7b4117d into master Oct 30, 2020
@danyeaw danyeaw deleted the fix-doc-tests branch October 30, 2020 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants