DiamondLightSource / DiamondLightSource/Savu

Incompatible PyMca changes

Open
#563 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
43
Forks
42
PR merge metrics
No merged PRs in 30d

Description

The ESRF's @woutdenolf is currently working on PyMca and has given me a heads-up regarding changes he is implementing that will affect the Savu plugin.

His email:

> Dag Tom,

> Ik doe het in het Engels voor het geval je dit met je collega's moet bespreken.
>
> I'm refactoring pymca's batch fitting for hdf5 output and this could have an effect on your Savu plugin:
> https://github.com/DiamondLightSource/Savu/blob/6b12727eee4cb381204b22b07a058335e2a41411/savu/plugins/filters/pymca.py
>
> This is the relevant code:
> b = McaAdvancedFitBatch.McaAdvancedFitBatch(...)
> fit_labels = c._McaAdvancedFitBatch__images.keys()
> stack = np.array(self.b._McaAdvancedFitBatch__images.values())
>
> Using the new API this would be:
> b = McaAdvancedFitBatch.McaAdvancedFitBatch(...)
> fit_labels = b.outbuffer.labels('parameters')
> stack = b.outbuffer['parameters']
>
> Apart from 'parameters' you could have 'uncertainties', 'massfractions', 'Chisq', 'residuals' and other useful results.
>
> I can easily add a "_McaAdvancedFitBatch__images" property to McaAdvancedFitBatch to mimic the old API with a deprecation warning.
> However the current McaAdvancedFitBatch does not have a "_McaAdvancedFitBatch__images" attribute. It does have a "__images" attribute however.
> Are you performing some witchcraft (e.g. monkey-patching) somewhere?
>
> Cheers,
> Wout

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.