Closed tovrstra closed 3 months ago
This pull request introduces a new sanity check to ensure required attributes are present before dumping data to a file. The changes include adding a _check_required function in iodata/api.py, updating the WFN format documentation in iodata/formats/wfn.py, and adding new unit tests in iodata/test/test_api.py to validate these checks. Additionally, FileFormatError and FileFormatWarning were added to iodata/utils.py.
Files | Changes |
---|---|
iodata/api.py iodata/formats/wfn.py |
Introduced a new function _check_required to validate required attributes before dumping data to a file and updated the WFN format documentation to reflect the correct required attributes. |
iodata/utils.py iodata/test/test_api.py |
Added FileFormatError and FileFormatWarning to utils and created new unit tests to ensure the new attribute checks work correctly. |
Here's the code health analysis summary for commits a127856..6c70851
. View details on DeepSource ↗.
Analyzer | Status | Summary | Link |
---|---|---|---|
Shell | ✅ Success | View Check ↗ | |
Python | ✅ Success | View Check ↗ |
💡 If you’re a repository administrator, you can configure the quality gates from the settings.
I've merged main into this PR to run the tests properly.
Thanks for reviewing! Going in....
This is the first step in a series of pull requests for issue #191. This is an old and complex issue, but important for data management, and it involves API changes. I've sliced up the issue in smaller tasks to make pull requests as small as possible.
This PR introduces an extra sanity check before dumping to a file. This also revealed a minor documentation mistake in the WFN format, which had to be fixed to make the tests pass.
I will YOLO-merge this on Friday, June 21, unless reviewed earlier.
Summary by Sourcery
This pull request adds a sanity check to ensure required attributes are present before dumping data to a file, corrects documentation for the WFN format, and introduces new unit tests to verify the behavior of the dump functions when required attributes are missing.