Skip to content

Calibration.as_dict() doesnt return entire cal_list if consisting of different Calibrations added using + operator #10

@AnnaWiniwarter

Description

@AnnaWiniwarter

I generated a calibration using the ixdat methods siq_multicomp_gas_flux_calibration(), siq_gas_flux_calibration() and ecms_calibration_curve().to_siqu()". In order to get all the sensitivity factors into one calibration file I then use: ec_calibration = ixdat.config.plugins.siq.Calibration(cal_list=[F_from_gas_flux, F_from_ecms_cal])
followed by
calibration = multicomponent_cal + ec_calibration

This is necessary, because siq_multicomp_gas_flux_calibration() returns a Calibration() object, while the other methods return CalPoint objects, and I can't add those otherwise.

If I now want to save this calibration, the only data that gets saved is that from siq_multicomp_gas_flux_calibration(), the rest is discarded without a trace. I traced this back to the last line in Calibration.as_dict:


Here it seems that self_as_dict.update(self.extra_stuff) just overwrites everything that the method does prior to this line (at least that's what I gather from changing it to self_as_dict.update(extra_stuff=self.extra_stuff) and what it then returns as extra_stuff

I fixed this in my own local version to be able to export such stitched together Calibration objects. Can make PR if it makes sense.

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