Skip to content

Draft: fix: CCV markdown tablefmt from pipe to grid for a better rst conversion and pdf display

Karim Ahmed requested to merge fix/ccv_markdown_tablefmt into master

Description

After we started using textlive/2022, the markdown tables for the retrieved constants are not properly converted in RST and Latex.

This MR fixes the issue by introducing an environment variable NB_CONVERT_RUNNING and a display_latex_retrieved_constants function to be able to display_retrieved_constants in either markdown or latex based on the existence of NB_CONVERT_RUNNING

Changes:

  • NB_CONVERT_RUNNING environment variable when notebooks are executed using xfel-calibrate
  • display_retrieved_constants() method deciding in which format the retrieved constants table should be generated.
  • display_latex_retrieved_constants() method to display a table of retrieved constants in latex.
  • Update detector notebooks':
  • Jungfrau
  • epix100
  • pnCCD
  • AGIPD
  • [ ] LPDs
  • Gotthard2

How Has This Been Tested?

  • Automated tests.

Relevant Documents (optional)

This is a screenshot for the current issue: Screenshot_from_2024-07-10_15-20-44

MASTER state

This is how the table looks like in RST files:

+---------+--------------+--------------+--------------+--------------+
| Modules | Noise        | Offset       | BadPixelsFF  | B            |
|         |              |              |              | adPixelsDark |
+=========+==============+==============+==============+==============+
| AGIPD00 | `2021-07-30  | `2021-07-30  | `2021-07-29  | `2021-07-30  |
|         | 21:23        | 21:23        | 17:44        | 21:23        |
|         | <https://in. | <https://in. | <https://in. | <https://in. |
|         | xfel.eu/cali | xfel.eu/cali | xfel.eu/cali | xfel.eu/cali |
|         | bration/cali | bration/cali | bration/cali | bration/cali |
|         | bration_cons | bration_cons | bration_cons | bration_cons |
|         | tant_version | tant_version | tant_version | tant_version |
|         | s//84948>`__ | s//84932>`__ | s//93997>`__ | s//84959>`__ |
+---------+--------------+--------------+--------------+--------------+
| AGIPD01 | `2021-07-30  | `2021-07-30  | `2021-07-29  | `2021-07-30  |
|         | 21:23        | 21:23        | 17:44        | 21:23        |
|         | <https://in. | <https://in. | <https://in. | <https://in. |
|         | xfel.eu/cali | xfel.eu/cali | xfel.eu/cali | xfel.eu/cali |
|         | bration/cali | bration/cali | bration/cali | bration/cali |
|         | bration_cons | bration_cons | bration_cons | bration_cons |
|         | tant_version | tant_version | tant_version | tant_version |
|         | s//84942>`__ | s//84930>`__ | s//93977>`__ | s//84954>`__ |
+---------+--------------+--------------+--------------+--------------+
| AGIPD02 | `2021-07-30  | `2021-07-30  | `2021-07-29  | `2021-07-30  |
|         | 21:23 <      | 21:23 <      | 17:44        | 21:23 <      |
|         | https://in.x | https://in.x | <https://in. | https://in.x |
|         | fel.eu/calib | fel.eu/calib | xfel.eu/cali | fel.eu/calib |
|         | ration/calib | ration/calib | bration/cali | ration/calib |
|         | ration_const | ration_const | bration_cons | ration_const |
|         | ant_versions | ant_versions | tant_version | ant_versions |
|         | //202755>`__ | //202750>`__ | s//93983>`__ | //202760>`__ |
+---------+--------------+--------------+--------------+--------------+
| AGIPD03 | `2021-07-30  | `2021-07-30  | `2021-07-29  | `2021-07-30  |
|         | 21:23 <      | 21:23 <      | 17:44        | 21:23 <      |
|         | https://in.x | https://in.x | <https://in. | https://in.x |
|         | fel.eu/calib | fel.eu/calib | xfel.eu/cali | fel.eu/calib |
|         | ration/calib | ration/calib | bration/cali | ration/calib |
|         | ration_const | ration_const | bration_cons | ration_const |
|         | ant_versions | ant_versions | tant_version | ant_versions |
|         | //202748>`__ | //202747>`__ | s//93979>`__ | //202751>`__ |
+---------+--------------+--------------+--------------+--------------+
| AGIPD04 | `2021-07-30  | `2021-07-30  | `2021-07-29  | `2021-07-30  |
|         | 21:23 <      | 21:23 <      | 17:44        | 21:23 <      |
|         | https://in.x | https://in.x | <https://in. | https://in.x |
|         | fel.eu/calib | fel.eu/calib | xfel.eu/cali | fel.eu/calib |
|         | ration/calib | ration/calib | bration/cali | ration/calib |
|         | ration_const | ration_const | bration_cons | ration_const |
|         | ant_versions | ant_versions | tant_version | ant_versions |
|         | //202762>`__ | //202756>`__ | s//93975>`__ | //202764>`__ |
+---------+--------------+--------------+--------------+--------------+

Current Version

Screenshot_from_2024-07-26_08-01-01

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Reviewers

@kluyvert @schmidtp

Edited by Karim Ahmed

Merge request reports

Loading