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

Add command-line option --allow-changes to iodata-convert #374

Merged
merged 3 commits into from
Jul 14, 2024

Conversation

tovrstra
Copy link
Member

@tovrstra tovrstra commented Jul 14, 2024

This addresses one of the steps of #191. The iodata-convert script gets an option to decide whether a (not trivially reversible) conversion of data should raise an error (default) or a warning (with the option). The default is not error when there is data degradation, out of an abundance of caution.

Summary by Sourcery

This pull request introduces a new command-line option --allow-changes to the iodata-convert script, allowing users to permit non-trivially reversible data conversions with warnings. The convert function has been updated to support this new option, and corresponding unit tests have been added to ensure its correct functionality.

  • New Features:
    • Added a command-line option --allow-changes to the iodata-convert script, allowing users to permit non-trivially reversible conversions with warnings instead of errors.
  • Enhancements:
    • Updated the convert function to handle the new allow_changes parameter, enabling conditional data modification for compatibility with the output format.
  • Tests:
    • Introduced new unit tests to verify the behavior of the --allow-changes option, including scenarios where data degradation is allowed and where it raises errors.

@tovrstra tovrstra added this to the 1.0.0 milestone Jul 14, 2024
Copy link
Contributor

sourcery-ai bot commented Jul 14, 2024

Reviewer's Guide by Sourcery

This pull request introduces a new command-line option --allow-changes to the iodata-convert script, allowing users to permit data reorganization to ensure compatibility with the output format. The convert function and associated tests have been updated to support and verify this new functionality.

File-Level Changes

Files Changes
iodata/test/test_cli.py
iodata/__main__.py
Introduced and integrated the --allow-changes command-line option, updated the convert function to handle this new parameter, and added corresponding unit tests.

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

deepsource-io bot commented Jul 14, 2024

Here's the code health analysis summary for commits 4dceda6..0a4d979. 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 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: 3 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/__main__.py Outdated Show resolved Hide resolved
iodata/test/test_cli.py Show resolved Hide resolved
iodata/test/test_cli.py Show resolved Hide resolved
iodata/test/test_cli.py Outdated Show resolved Hide resolved
PaulWAyers
PaulWAyers previously approved these changes Jul 14, 2024
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.

Sourcery is really incredible at this....catches spelling errors even. Wow.

No concerns with this; the bot's a better reviewer than me ...

@tovrstra
Copy link
Member Author

Thanks for the quick check. I'm going to fix that and follow one of its suggestions for unit tests. Sourcery sometimes has a good idea of what still needs testing, but actual code changes still require some human oversight. (Or I am too picky.)

@tovrstra
Copy link
Member Author

@sourcery-ai review

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: 2 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟡 Complexity: 1 issue found
  • 🟢 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/__main__.py Outdated Show resolved Hide resolved
iodata/__main__.py Show resolved Hide resolved
iodata/test/test_cli.py Show resolved Hide resolved
iodata/test/test_cli.py Show resolved Hide resolved
iodata/__main__.py Outdated Show resolved Hide resolved
@tovrstra
Copy link
Member Author

It's indeed good at catching spelling mistakes. :) Even if not all the AI comments are spot on, it just makes you rethink things, which is also helpful.

@tovrstra tovrstra merged commit f8af4e8 into theochem:main Jul 14, 2024
12 checks passed
@tovrstra tovrstra deleted the cli-allow-changes branch July 14, 2024 18:25
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.

2 participants