Fixed handling of string values in write_nepfile

Problem

write_nepfile accepted string values (e.g. '5000 0 0' for save_potential) but wrote them corrupted to nep.in. Python strings are Iterable, so the branch intended for lists/arrays fired instead, joining the string character-by-character:

params = {'save_potential': '5000 0 0'}
write_nepfile(params, '.')
# nep.in contained:  save_potential  5 0 0 0   0   0

This broke the write/read roundtrip for any parameter whose value is passed as a pre-formatted string rather than a list.

Fix

Add and not isinstance(val, str) to the Iterable guard in write_nepfile (calorine/nep/io.py). String values now pass through as-is; list/tuple/array values continue to be space-joined as before.

Tests

Added test_write_nepfile_string_value to tests/test_nep_io.py to cover the roundtrip: write a multi-token string value and assert read_nepfile returns it unchanged.

Merge request reports

Loading