You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tobi found a bug in TopoStats where some .spm files fail. The issue appears to be that pm is not a valid unit when unpacking the pixel_to_nm_scaling factor. I compared TopoStats' spm loading code to AFMReader's and found that TopoStats has a unit dictionary of:
Traceback (most recent call last):
File "/Users/t/miniconda3/envs/main_topostats/bin/topostats", line 8, in <module>
sys.exit(entry_point())
File "/Users/t/Documents/topostats/main_topostats/TopoStats/topostats/entry_point.py", line 1204, in entry_point
args.func(args)
File "/Users/t/Documents/topostats/main_topostats/TopoStats/topostats/run_modules.py", line 231, in process
all_scan_data.get_data()
File "/Users/t/Documents/topostats/main_topostats/TopoStats/topostats/io.py", line 790, in get_data
self.image, self.pixel_to_nm_scaling = suffix_to_loader[suffix]()
File "/Users/t/Documents/topostats/main_topostats/TopoStats/topostats/io.py", line 640, in load_spm
return spm.load_spm(file_path=self.img_path, channel=self.channel)
File "/Users/t/miniconda3/envs/main_topostats/lib/python3.10/site-packages/AFMReader/spm.py", line 102, in load_spm
return (image, spm_pixel_to_nm_scaling(filename, channel_data))
File "/Users/t/miniconda3/envs/main_topostats/lib/python3.10/site-packages/AFMReader/spm.py", line 38, in spm_pixel_to_nm_scaling
px_to_real[1][0] * unit_dict[px_to_real[1][1]],
KeyError: 'pm'
(main_topostats) t@dyn232037 430 minicircles topostats test for Niel %
To Reproduce
The file is not shared as I presume it's secret, but ask Tobi for the .spm file and run TopoStats using it.
AFMReader Version
0.1.0
Python Version
3.11
Operating System
MacOS M1/M2 (post-2021)
Python Packages
N/A, need to be fast
The text was updated successfully, but these errors were encountered:
I had clocked these units in the _spm_pixel_to_nm_scaling() function but didn't fully appreciate the implications on loading files and thought it was a method that was used elsewhere (I've a vague recollection that this might have been added after a user wanted a more comprehensive set of units).
Sorry for not copying that over. If this is to be improved here in AFMReader we should also remove _spm_pixel_to_nm_scaling() from TopoStats (captured in #1036).
Describe the bug
Tobi found a bug in TopoStats where some
.spm
files fail. The issue appears to be thatpm
is not a valid unit when unpacking thepixel_to_nm_scaling
factor. I compared TopoStats'spm
loading code to AFMReader's and found that TopoStats has a unit dictionary of:and AFMReader has:
This needs updating ASAP. I'll do it.
Tobi's output log is attached below for evidence.
Copy of the output
To Reproduce
The file is not shared as I presume it's secret, but ask Tobi for the
.spm
file and run TopoStats using it.AFMReader Version
0.1.0
Python Version
3.11
Operating System
MacOS M1/M2 (post-2021)
Python Packages
N/A, need to be fast
The text was updated successfully, but these errors were encountered: