theochem / iodata

Python library for reading, writing, and converting computational chemistry file formats and generating input files.
https://iodata.readthedocs.io/
GNU Lesser General Public License v3.0
131 stars 46 forks source link

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

Closed tovrstra closed 2 months ago

tovrstra commented 2 months ago

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.

sourcery-ai[bot] commented 2 months ago

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](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
deepsource-io[bot] commented 2 months ago

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.
tovrstra commented 2 months ago

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 commented 2 months ago

@sourcery-ai review

tovrstra commented 2 months ago

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.