AFM-SPM / TopoStats

An AFM image analysis program to batch process data and obtain statistics from images
https://afm-spm.github.io/TopoStats/
GNU Lesser General Public License v3.0
60 stars 11 forks source link

Fixes None tracing outputs attempted to be concatenated #973

Closed MaxGamill-Sheffield closed 1 month ago

MaxGamill-Sheffield commented 1 month ago

Apologies, the previous PR was a tad early, I thought the "merge when ready" would wait for until tests finished...

This should provide a hotfix to the errors and similar like them:

disordered_trace_results[str(img)] = disordered_trace_result.dropna(axis=1, how="all")
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'dropna'

This occurred because the disabled modules would return None instead of an empty dataframe and we expected to have the dataframe function DataFrame.dropna() which obvs didn't exist.

This fix should ensure that dataframes are returned by disabled modules.

It also adds another exception I found when forcing the disordered traces step to fail causing KeyErrors in NodeStats and Ordered Tracing as they couldn't find the image name keys of a skeleton to grab.

ns-rse commented 1 month ago

Just looking through this and will be adding a commit to parametrize the tests and have one question which I need to investigate further before asking.

llwiggins commented 1 month ago

Max already added it in the general tidying PR as he didn’t realise it was included in this one, so it might already be there?

Dr. Laura Wiggins (she/her) Post Doctoral Research Associate

Pyne Lab Department of Materials Science and Engineering University of Sheffield Sir Robert Hadfield Building Mappin Street Sheffield, S1 3JD

On Wed, 23 Oct 2024 at 16:11, github-merge-queue[bot] < @.***> wrote:

Merged #973 https://github.com/AFM-SPM/TopoStats/pull/973 into main.

— Reply to this email directly, view it on GitHub https://github.com/AFM-SPM/TopoStats/pull/973#event-14817689778, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2ODALUJ23S2BUV5EOBEXLZ46VCHAVCNFSM6AAAAABQFXK3TWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUHAYTONRYHE3TOOA . You are receiving this because you modified the open/close state.Message ID: @.***>

ns-rse commented 1 month ago

Max already added it in the general tidying PR as he didn’t realise it was included in this one, so it might already be there?

I realised I was commenting on the wrong PR, sorry.