Skip to content
Snippets Groups Projects

[AGIPD][CORRECT] use yaml.dump and save only empty cons info

Merged Karim Ahmed requested to merge fix/dump_empty_cons_filepath into master
2 unresolved threads

Summary:

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) :

Screenshot_from_2020-11-27_10-53-17

Reviewers:

@kluyvert @kamile @danilevc

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • 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",
  • Karim Ahmed added 1 commit

    added 1 commit

    • 56a35d33 - use safe_dump to have a more of a global format

    Compare with previous version

  • Thomas Kluyver
  • Karim Ahmed
  • Karim Ahmed added 1 commit

    added 1 commit

    • a3c468a1 - Apply suggestion to notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    • a3c468a1 - Apply suggestion to notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    Compare with previous version

  • merged

  • Karim Ahmed mentioned in commit ab5c396c

    mentioned in commit ab5c396c

  • Please register or sign in to reply
    Loading