From ce5f070cf14de392bc493d6ffa0e8e0686b1b6b0 Mon Sep 17 00:00:00 2001 From: Sherjeel Shabih Date: Wed, 1 Nov 2023 12:34:41 +0100 Subject: [PATCH] Adds another example for merging partial app defs without links --- examples/json_map/merge_copied.mapping.json | 31 ++++++++++++++++++ ...mapping.json => merge_linked.mapping.json} | 1 - examples/json_map/merged_copied.nxs | Bin 0 -> 28616 bytes .../{merged.nxs => merged_linked.nxs} | Bin .../dataconverter/readers/json_map/reader.py | 3 +- 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 examples/json_map/merge_copied.mapping.json rename examples/json_map/{merge_partial_appdefs.mapping.json => merge_linked.mapping.json} (99%) create mode 100644 examples/json_map/merged_copied.nxs rename examples/json_map/{merged.nxs => merged_linked.nxs} (100%) diff --git a/examples/json_map/merge_copied.mapping.json b/examples/json_map/merge_copied.mapping.json new file mode 100644 index 000000000..b1b30c660 --- /dev/null +++ b/examples/json_map/merge_copied.mapping.json @@ -0,0 +1,31 @@ +{ + "/@default": "entry", + "/ENTRY[entry]/DATA[data]/current": 0, + "/ENTRY[entry]/DATA[data]/temperature": 0, + "/ENTRY[entry]/DATA[data]/voltage": 0, + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/voltage_controller/calibration_time": "/entry/instrument/environment/voltage_controller/calibration_time", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/voltage_controller/run_control": "/entry/instrument/environment/voltage_controller/run_control", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/voltage_controller/value": "/entry/instrument/environment/voltage_controller/value", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/temperature_controller/calibration_time": "/entry/instrument/environment/temperature_controller/calibration_time", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/temperature_controller/run_control": "/entry/instrument/environment/temperature_controller/run_control", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/temperature_controller/value": "/entry/instrument/environment/temperature_controller/value", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/current_sensor/calibration_time": "/entry/instrument/environment/current_sensor/calibration_time", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/current_sensor/run_control": "/entry/instrument/environment/current_sensor/run_control", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/current_sensor/value": "/entry/instrument/environment/current_sensor/value", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/independent_controllers": ["voltage_controller", "temperature_control"], + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/measurement_sensors": ["current_sensor"], + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/NXpid[heating_pid]/description": "/entry/instrument/environment/heating_pid/description", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/NXpid[heating_pid]/setpoint": "/entry/instrument/environment/heating_pid/setpoint", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/NXpid[heating_pid]/K_p_value": "/entry/instrument/environment/heating_pid/K_p_value", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/NXpid[heating_pid]/K_i_value": "/entry/instrument/environment/heating_pid/K_i_value", + "/ENTRY[entry]/INSTRUMENT[instrument]/ENVIRONMENT[environment]/NXpid[heating_pid]/K_d_value": "/entry/instrument/environment/heating_pid/K_d_value", + "/ENTRY[entry]/PROCESS[process]/program": "Bluesky", + "/ENTRY[entry]/PROCESS[process]/program/@version": "1.6.7", + "/ENTRY[entry]/SAMPLE[sample]/name": "super", + "/ENTRY[entry]/SAMPLE[sample]/atom_types": "Si, C", + "/ENTRY[entry]/definition": "NXiv_temp", + "/ENTRY[entry]/definition/@version": "1", + "/ENTRY[entry]/experiment_identifier": "dbdfed37-35ed-4aee-a465-aaa0577205b1", + "/ENTRY[entry]/experiment_description": "A simple IV temperature experiment.", + "/ENTRY[entry]/start_time": "2022-05-30T16:37:03.909201+02:00" +} \ No newline at end of file diff --git a/examples/json_map/merge_partial_appdefs.mapping.json b/examples/json_map/merge_linked.mapping.json similarity index 99% rename from examples/json_map/merge_partial_appdefs.mapping.json rename to examples/json_map/merge_linked.mapping.json index f64b3d544..386779d8b 100644 --- a/examples/json_map/merge_partial_appdefs.mapping.json +++ b/examples/json_map/merge_linked.mapping.json @@ -18,5 +18,4 @@ "/ENTRY[entry]/experiment_identifier": "dbdfed37-35ed-4aee-a465-aaa0577205b1", "/ENTRY[entry]/experiment_description": "A simple IV temperature experiment.", "/ENTRY[entry]/start_time": "2022-05-30T16:37:03.909201+02:00" - } \ No newline at end of file diff --git a/examples/json_map/merged_copied.nxs b/examples/json_map/merged_copied.nxs new file mode 100644 index 0000000000000000000000000000000000000000..3a96de65648bb41d551bbcc3f47ddfb60deac2a3 GIT binary patch literal 28616 zcmeHQ3vd)g8txDtAv_EiFevDNycCk#%@eSg4JOe=AX$X+;wfx4*$F$k+1=YmOd=&u z1yMA-%7DVfLk~egpb&$1PUI}X^U$Nj2X)1rXx)Po&cgEa@I<}t>HptMCfTecyP73C zRlD8&ch5h6fBnxt-G6t_JZvt!Wl-|f$%GwANu)PPQKR_xJsfYkIR(?0Uj~r`2vLpY6`?!#kANQj3$3ITJ`3=6ApDbyOZ z^i9wo1VeK9y|pxf`e??CPKF62v0eS0*pD-G0N-%>+i*26=;@>!@zY`(0o32UP>rP! zdhU&Gz2+5{6eds&M!P8_^6Lff4@f(}zD8G?*yTP1o?B)eUIPiYFbSkTNu?+kms%^F zHlGh`IwB!KJ(JlhjyZ1$#9uWd&^U}1%HEv5hI4cP<51&TCRLAvbn`MrTEdKx432Ku02zT~Qwy>1s2K(%`V z^5;7w!6DiFvTKo05%78`8$tF76>e(R-A<=u7s_h|n?PCk12(5%nOP{3*rP#OL6o`E}z>Aj}3A?)VF*>rXe#k z-H?->WteZwotBk1&5)Hb)i5>FV4P&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