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 typecheck: TextIOBase instead of TextIO #368

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

tovrstra
Copy link
Member

@tovrstra tovrstra commented Jul 9, 2024

This fixes one aspect of #367, includes test.

As far as I understand, type hints should still use TextIO from the typing module, so I'm not changing these.

Summary by Sourcery

This pull request fixes a type checking issue by replacing TextIO with TextIOBase in the _interpret_file_lineno function and adds a new test to verify the handling of mixed pure Cartesian data.

  • Bug Fixes:
    • Fixed type checking by replacing TextIO with TextIOBase in the _interpret_file_lineno function.
  • Tests:
    • Added a new test test_mixed_pure_cartesian to verify the handling of mixed pure Cartesian data in the molden_dump_one function.

@tovrstra tovrstra added the bug label Jul 9, 2024
@tovrstra tovrstra requested a review from PaulWAyers July 9, 2024 05:48
Copy link

deepsource-io bot commented Jul 9, 2024

Here's the code health analysis summary for commits 22475e1..d3fbc2b. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Contributor

sourcery-ai bot commented Jul 9, 2024

Reviewer's Guide by Sourcery

This pull request addresses a type checking issue by replacing TextIO with TextIOBase in the iodata/utils.py file. Additionally, a new test function test_mixed_pure_cartesian has been added to iodata/test/test_molden.py to validate the handling of mixed pure Cartesian data.

File-Level Changes

Files Changes
iodata/test/test_molden.py
iodata/utils.py
Added a new test case in test_molden.py and fixed type checking by replacing TextIO with TextIOBase in utils.py.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @tovrstra - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟡 Testing: 4 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

iodata/utils.py Show resolved Hide resolved
iodata/test/test_molden.py Show resolved Hide resolved
iodata/test/test_molden.py Show resolved Hide resolved
iodata/test/test_molden.py Show resolved Hide resolved
iodata/test/test_molden.py Show resolved Hide resolved
Copy link
Member

@PaulWAyers PaulWAyers left a comment

Choose a reason for hiding this comment

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

LGTM

@tovrstra
Copy link
Member Author

tovrstra commented Jul 9, 2024

Thanks for checking, Paul!

@tovrstra tovrstra merged commit a26356e into theochem:main Jul 9, 2024
12 checks passed
@tovrstra tovrstra deleted the fix-type-check-textiobase branch July 9, 2024 16:39
@tovrstra tovrstra added this to the 1.0.0 milestone Jul 9, 2024
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.

2 participants