[AGIPD][CORRECT] use yaml.dump and save only empty cons info
2 unresolved threads
2 unresolved threads
Summary:
- yaml.safe_dump is not supporting python objects https://pyyaml.org/wiki/PyYAMLDocumentation.
- Saving only first two indices, which contains empty constant info, in case of no retrieved constant
Tests:
xfel-calibrate AGIPD correct \
--in-folder /gpfs/exfel/exp/SPB/202031/p900145/raw \
--run 236 \
--out-folder /gpfs/exfel/data/scratch/ahmedk/test/AGIPD_CM_75266 \
--slurm-mem 750 \
--karabo-id-control SPB_IRU_AGIPD1M1 \
--karabo-da-control AGIPD1MCTRL00 \
--h5path-ctrl /CONTROL/{}/MDL/FPGA_COMP \
--karabo-id SPB_DET_AGIPD1M-1 \
--sequences 0,1,2,3,4,5 \
--rel-gain
Errors:
1- Error related to using yaml.safe_dump
:
`RepresenterError: ('cannot represent an object', 0)`
2- Wrong saved nested lists for non retrieved constants (Only first two elements needed) :
Reviewers:
Merge request reports
Activity
Filter activity
- Resolved by Karim Ahmed
I suspect a better solution is to convert the numpy scalar 0 into a standard Python int, and keep using
safe_dump
.AIUI, the ability to store arbitrary Python objects as custom types in YAML is one of those things that seemed like a clever idea 10 years ago, but 99% of the time is not what you want.
303 301 " f\"{mdata_const.filename}\"\n", 304 302 " mdata_dict[cname][\"creation-time\"] = f\"{mdata_const.begin_at}\"\n", 305 303 " else:\n", 306 " mdata_dict[cname][\"file-path\"] = const_dict[cname]\n", 304 " mdata_dict[cname][\"file-path\"] = const_dict[cname][:2]\n", added 1 commit
- 56a35d33 - use safe_dump to have a more of a global format
- Resolved by Karim Ahmed
- Resolved by Karim Ahmed
added 1 commit
- a3c468a1 - Apply suggestion to notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb
added 1 commit
- a3c468a1 - Apply suggestion to notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb
- Resolved by Karim Ahmed
mentioned in commit ab5c396c
Please register or sign in to reply