This update automatically uses the correct write mode for Python 3 or Python 2. It addresses an indexing-related issue with writing to .py files. I added a new t_savecase.py file with a t_savecase() test. This is original with PYPOWER, rather than being ported from MATPOWER.
For writing to .mat files, I have maintained a close correspondence to the steps in MATPOWER's savecase.m so it is easy to compare the two versions. The savemat() function in SciPy works consistently when non-scalar values are in the form of NumPy arrays, so I have done conversion before assigning the values to the case dict.
This update automatically uses the correct write mode for Python 3 or Python 2. It addresses an indexing-related issue with writing to .py files. I added a new t_savecase.py file with a t_savecase() test. This is original with PYPOWER, rather than being ported from MATPOWER.
For writing to .mat files, I have maintained a close correspondence to the steps in MATPOWER's savecase.m so it is easy to compare the two versions. The savemat() function in SciPy works consistently when non-scalar values are in the form of NumPy arrays, so I have done conversion before assigning the values to the case dict.