Closed ramav87 closed 8 months ago
This functionality has been added to the fitter_fn branch:
https://github.com/pycroscopy/sidpy/tree/fitter_fn
For reading the functions, I modified pyNSID:
https://github.com/pycroscopy/pyNSID/tree/decode_functions
Though pyNSID passes tests, sippy fails almost all of them with this update. Will need to look into it.
I will try to find out more about the failing tests.
HI @ramav87 ,
Assertion failing at line 63(validate_dataset_properties function) in sidpy/tests/sid/test_dataset.py when executing test_fitter.py.
Reason: there is an additional key "fitting_functions" within the dataset.metadata that is not present in the standalone metadata dictionary.
metadata.keys(): dict_keys(['info_1', 'instrument', 'fit_parms_dict'])
dataset.metadata.keys(): dict_keys(['info_1', 'instrument', 'fit_parms_dict', 'fitting_functions'])
QHow do you suggest to handle this?
The best way to proceed is that you should modify the test so it can now also look for the fitting function if available, and if available, it should be able to read it properly (so the test should be modified to reflect that)
On Tue, Mar 5, 2024 at 12:18 AM utkarshp1161 @.***> wrote:
Assertion failing at line 63(validate_dataset_properties function) in /Users/utkarshpratiush/project/sidpy_rama_branch/sidpy/tests/sid/test_dataset.py when executing test_fitter.py:
Reason: there is an additional key "fitting_functions" within the dataset.metadata that is not present in the standalone metadata dictionary.
metadata.keys(): dict_keys(['info_1', 'instrument', 'fit_parms_dict'])
dataset.metadata.keys(): dict_keys(['info_1', 'instrument', 'fit_parms_dict', 'fitting_functions'])
QHow do you suggest to handle this?
— Reply to this email directly, view it on GitHub https://github.com/pycroscopy/sidpy/issues/200#issuecomment-1977985297, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNDQFK4TL2GGX5WOTHSBRTYWVIQTAVCNFSM6AAAAABDCEHAYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZXHE4DKMRZG4 . You are receiving this because you authored the thread.Message ID: @.***>
In the sippy fitter class, we should save the fitting function. We can do this by serializing the function with dill, before saving it to hdf5. Assuming the we got the fit_data from the fitter class, we can do:
Then to access the function again, we can do