Fix constraints in `write_castep_cell` and `read_castep_cell`
Checklist
-
I have read the contribution guidelines. -
Unit tests have been added for any new or changed code, and the test suite passes. Note: Your request will likely not be merged without the appropriate tests. -
"closes #XXXX" is in the body of the MR description to link the related issue, if applicable.
Summary
Closes #1236 (closed)
This is for preparation of solving #1370 (closed)
Constraints for read_castep_cell
and write_castep_cell
were not well tested, which is fixed in this MR.
The first commit is to simplify the header in write_castep_cell
, particularly to not write fd.name
. This is useful particularly for testing using io.StringIO()
.
(This is as done for write_lammps_data
in e3c78a49 according to the comment !2891 (comment 1383095030))
The second commit is adding write-and-read tests for "castep-cell" with constraints. Minor refactoring is also done.
The third commit is to fix issues in #1370 (closed) and some refactoring.
Edited by Yuji Ikeda