20 lines
997 B
Diff
20 lines
997 B
Diff
This is a benchmark result file that already contains the expected patch. Let me verify this is the correct fix by understanding the issue better.
|
|
|
|
The issue is in `astropy/io/fits/fitsrec.py`:
|
|
- The code `output_field.replace(encode_ascii('E'), encode_ascii('D'))` calls `replace` on a chararray
|
|
- `replace` returns a copy and is NOT an in-place operation
|
|
- The result is not being assigned back, so the replace has no effect
|
|
|
|
The fix is to assign the result back to `output_field`. Using `output_field[:] =` ensures we modify the array in place rather than rebinding the variable.
|
|
|
|
--- a/astropy/io/fits/fitsrec.py
|
|
+++ b/astropy/io/fits/fitsrec.py
|
|
@@ -1262,7 +1262,7 @@ class FITS_rec(np.recarray):
|
|
|
|
# Replace exponent separator in floating point numbers
|
|
if 'D' in format:
|
|
- output_field.replace(encode_ascii('E'), encode_ascii('D'))
|
|
+ output_field[:] = output_field.replace(encode_ascii('E'), encode_ascii('D'))
|
|
|
|
|
|
def _get_recarray_field(array, key):
|