Skip to content

Incompatible PyMca changes #563

@tschoonj

Description

@tschoonj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions