batplot 1.8.48__tar.gz → 1.8.51__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {batplot-1.8.48 → batplot-1.8.51}/DEVELOPING.md +25 -1
- {batplot-1.8.48 → batplot-1.8.51}/PKG-INFO +69 -11
- {batplot-1.8.48 → batplot-1.8.51}/README.md +66 -10
- {batplot-1.8.48 → batplot-1.8.51}/batplot/__init__.py +1 -1
- {batplot-1.8.48 → batplot-1.8.51}/batplot/args.py +79 -14
- {batplot-1.8.48 → batplot-1.8.51}/batplot/batch.py +12 -4
- {batplot-1.8.48 → batplot-1.8.51}/batplot/batplot.py +82 -12
- {batplot-1.8.48 → batplot-1.8.51}/batplot/canvas_interactive.py +17 -2
- {batplot-1.8.48 → batplot-1.8.51}/batplot/color_utils.py +297 -78
- {batplot-1.8.48 → batplot-1.8.51}/batplot/config.py +66 -50
- batplot-1.8.51/batplot/converters.py +373 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/data/CHANGELOG.md +23 -0
- batplot-1.8.51/batplot/data/latest_release_notes.json +7 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/dev_upgrade.py +45 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_commands.py +33 -25
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_panel_state.py +12 -0
- batplot-1.8.51/batplot/plot_modes/batch_session/batch_scoped_sync.py +131 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/cpc_batch_helpers.py +231 -6
- batplot-1.8.51/batplot/plot_modes/batch_session/dqdv_2d_batch_helpers.py +84 -0
- batplot-1.8.51/batplot/plot_modes/batch_session/ec_batch_helpers.py +823 -0
- batplot-1.8.51/batplot/plot_modes/batch_session/kinds.py +285 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/load.py +31 -36
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/menu_cpc.py +64 -8
- batplot-1.8.51/batplot/plot_modes/batch_session/menu_dqdv_2d.py +436 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/menu_ec.py +65 -41
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/menu_histo.py +6 -2
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/menu_operando.py +155 -28
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/menu_xy.py +222 -20
- batplot-1.8.51/batplot/plot_modes/batch_session/operando_batch_helpers.py +1234 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/routing.py +3 -5
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/xy_batch_helpers.py +76 -3
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/axis_state.py +25 -4
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/batch_font.py +19 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/font_extras.py +10 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/fonts.py +12 -0
- batplot-1.8.51/batplot/plot_modes/common/line_dash.py +110 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/menu_rendering.py +56 -2
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/menus.py +28 -7
- batplot-1.8.51/batplot/plot_modes/common/overview_metrics.py +782 -0
- batplot-1.8.51/batplot/plot_modes/common/session_data_guarantee.py +197 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/session_helpers.py +164 -1
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/session_key_smoke.py +1 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/sources.py +10 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/spines.py +87 -9
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/terminal.py +12 -1
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/actions.py +92 -9
- batplot-1.8.51/batplot/plot_modes/cpc/add_file.py +545 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/colors.py +25 -9
- batplot-1.8.51/batplot/plot_modes/cpc/interactive.py +1102 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/labels.py +28 -9
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/legend.py +22 -5
- batplot-1.8.51/batplot/plot_modes/cpc/legend_order.py +199 -0
- batplot-1.8.51/batplot/plot_modes/cpc/load.py +277 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/menu.py +5 -2
- batplot-1.8.51/batplot/plot_modes/cpc/overview.py +202 -0
- batplot-1.8.51/batplot/plot_modes/cpc/panel_menus.py +644 -0
- batplot-1.8.51/batplot/plot_modes/cpc/routing.py +393 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/session.py +146 -64
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/snapshots.py +19 -1
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/style.py +93 -89
- batplot-1.8.51/batplot/plot_modes/cpc/wasd_menu.py +307 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/actions.py +7 -4
- batplot-1.8.51/batplot/plot_modes/electrochem/capacity_cum.py +117 -0
- batplot-1.8.51/batplot/plot_modes/electrochem/colors.py +846 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/dqdv_2d.py +118 -0
- batplot-1.8.51/batplot/plot_modes/electrochem/dual_axis_menu.py +944 -0
- batplot-1.8.51/batplot/plot_modes/electrochem/interactive.py +1958 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/labels.py +62 -11
- batplot-1.8.51/batplot/plot_modes/electrochem/legend_order.py +139 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/line_style.py +58 -8
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/menu.py +11 -4
- batplot-1.8.51/batplot/plot_modes/electrochem/overview.py +186 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/routing.py +18 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/session.py +428 -224
- batplot-1.8.51/batplot/plot_modes/electrochem/smoothing_menu.py +577 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/spine_colors.py +67 -25
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/style.py +652 -56
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/style_apply.py +222 -34
- batplot-1.8.51/batplot/plot_modes/electrochem/undo_state.py +774 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/actions.py +8 -7
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/colors.py +17 -10
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/density_curve.py +12 -6
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/interactive.py +73 -8
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/labels.py +14 -7
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/plot.py +12 -4
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/session.py +27 -2
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/spines.py +3 -1
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/actions.py +8 -5
- batplot-1.8.51/batplot/plot_modes/operando/axes_limits_menu.py +602 -0
- batplot-1.8.51/batplot/plot_modes/operando/axis_units.py +436 -0
- batplot-1.8.51/batplot/plot_modes/operando/cif_menu.py +479 -0
- batplot-1.8.51/batplot/plot_modes/operando/colors.py +358 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/grid.py +17 -5
- batplot-1.8.51/batplot/plot_modes/operando/intensity_menu.py +271 -0
- batplot-1.8.51/batplot/plot_modes/operando/interactive.py +1897 -0
- batplot-1.8.51/batplot/plot_modes/operando/ions_axis.py +417 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/labels.py +29 -10
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/layout.py +21 -1
- batplot-1.8.51/batplot/plot_modes/operando/line_style.py +193 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/menu.py +20 -3
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/peaks.py +244 -29
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/plot.py +294 -25
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/session.py +162 -24
- batplot-1.8.51/batplot/plot_modes/operando/spine_colors.py +148 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/style.py +88 -30
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/style_apply.py +294 -91
- batplot-1.8.51/batplot/plot_modes/operando/undo_state.py +1004 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/visibility.py +4 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/actions.py +7 -1
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/arrange.py +6 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/axis_range.py +34 -24
- batplot-1.8.51/batplot/plot_modes/xy/axis_units.py +877 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/cif.py +584 -28
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/colors.py +24 -4
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/data_ops.py +24 -8
- batplot-1.8.51/batplot/plot_modes/xy/full_data.py +416 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/interactive.py +333 -813
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/labels.py +25 -4
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/line_style.py +11 -33
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/menu.py +23 -4
- batplot-1.8.51/batplot/plot_modes/xy/offset_menu.py +247 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/pipeline.py +216 -86
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/session.py +298 -53
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/style.py +345 -29
- batplot-1.8.51/batplot/plot_modes/xy/undo_state.py +764 -0
- batplot-1.8.51/batplot/readers.py +145 -0
- batplot-1.8.51/batplot/readers_common.py +127 -0
- batplot-1.8.48/batplot/readers.py → batplot-1.8.51/batplot/readers_ec.py +9 -211
- {batplot-1.8.48 → batplot-1.8.51}/batplot/readers_xrd.py +28 -4
- batplot-1.8.51/batplot/screen_color.py +950 -0
- batplot-1.8.51/batplot/strip_header.py +281 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/ui.py +291 -21
- {batplot-1.8.48 → batplot-1.8.51}/batplot/utils.py +242 -66
- {batplot-1.8.48 → batplot-1.8.51}/batplot/version_check.py +2 -2
- {batplot-1.8.48 → batplot-1.8.51}/batplot.egg-info/PKG-INFO +69 -11
- {batplot-1.8.48 → batplot-1.8.51}/batplot.egg-info/SOURCES.txt +76 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot.egg-info/requires.txt +2 -0
- {batplot-1.8.48 → batplot-1.8.51}/pyproject.toml +8 -3
- batplot-1.8.51/tests/test_all_menus_smoke.py +2076 -0
- batplot-1.8.51/tests/test_batch_all_modes_sync.py +409 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_menu_parity.py +12 -5
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_pisb_contract.py +17 -5
- batplot-1.8.51/tests/test_batch_scoped_sync_modes.py +466 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_session.py +307 -9
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_spine_sync.py +14 -5
- batplot-1.8.51/tests/test_bc_new_fields_defaults.py +101 -0
- batplot-1.8.51/tests/test_cif_tick_crystallography.py +82 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_cli_all_flags.py +16 -3
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_cli_smoke.py +9 -0
- batplot-1.8.51/tests/test_color_display_hex.py +59 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_color_listing_visible.py +11 -5
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_common_palettes.py +6 -1
- batplot-1.8.51/tests/test_convert_xrd.py +143 -0
- batplot-1.8.51/tests/test_cpc_add_file.py +332 -0
- batplot-1.8.51/tests/test_cpc_legend_order.py +263 -0
- batplot-1.8.51/tests/test_cross_os_oe_paths.py +158 -0
- batplot-1.8.51/tests/test_deep_noninteractive_bugs.py +282 -0
- batplot-1.8.51/tests/test_default_sizes_and_oe_persistence.py +223 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_dqdv_contour_session_keys.py +41 -0
- batplot-1.8.51/tests/test_dqdv_smooth_status.py +94 -0
- batplot-1.8.51/tests/test_dual_axis_menu_audit.py +263 -0
- batplot-1.8.51/tests/test_dual_mode_pisb.py +351 -0
- batplot-1.8.51/tests/test_dual_pisb_hard_gates.py +285 -0
- batplot-1.8.51/tests/test_dual_tk_a_coupling.py +266 -0
- batplot-1.8.51/tests/test_dual_top_wasd_both_layers.py +315 -0
- batplot-1.8.51/tests/test_ec_cycle_identity_roundtrip.py +208 -0
- batplot-1.8.51/tests/test_ec_multifile_color_menu.py +310 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_ec_roundtrip.py +2 -1
- batplot-1.8.51/tests/test_ec_session_bc_new_keys.py +202 -0
- batplot-1.8.51/tests/test_gc_cumulative.py +103 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_histo.py +1 -1
- batplot-1.8.51/tests/test_interactive_menu_smoke.py +602 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_interactive_state.py +30 -1
- batplot-1.8.51/tests/test_line_dash_styles.py +282 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_menu_handler_imports.py +7 -0
- batplot-1.8.51/tests/test_operando_axis_units.py +258 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_operando_batch_menu.py +1 -1
- batplot-1.8.51/tests/test_operando_cif_add.py +213 -0
- batplot-1.8.51/tests/test_operando_cif_color.py +183 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_operando_layout_menu.py +1 -1
- batplot-1.8.51/tests/test_operando_peaks_axis_units.py +121 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_operando_roundtrip.py +190 -12
- batplot-1.8.51/tests/test_operando_submenu_smoke.py +226 -0
- batplot-1.8.51/tests/test_overview_metrics.py +216 -0
- batplot-1.8.51/tests/test_pi_axis_units_persistence.py +140 -0
- batplot-1.8.51/tests/test_pisb_deep_all_modes.py +656 -0
- batplot-1.8.51/tests/test_recent_axis_names.py +248 -0
- batplot-1.8.51/tests/test_screen_color.py +195 -0
- batplot-1.8.51/tests/test_screen_color_pisb.py +62 -0
- batplot-1.8.51/tests/test_secondary_spine_colors.py +60 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_session_backward_compat.py +6 -0
- batplot-1.8.51/tests/test_session_full_data_guarantee.py +453 -0
- batplot-1.8.51/tests/test_session_style_restore_parity.py +331 -0
- batplot-1.8.51/tests/test_spine_colors_pisb.py +283 -0
- batplot-1.8.51/tests/test_strip_header.py +104 -0
- batplot-1.8.51/tests/test_tick_visibility_save_truth.py +166 -0
- batplot-1.8.51/tests/test_undo_deep_all_modes.py +177 -0
- batplot-1.8.51/tests/test_xrd_crosshair_bragg.py +53 -0
- batplot-1.8.51/tests/test_xy_axis_units.py +494 -0
- batplot-1.8.51/tests/test_xy_cif_add.py +408 -0
- batplot-1.8.51/tests/test_xy_full_data_retention.py +134 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_xy_modules.py +16 -2
- batplot-1.8.51/tests/test_xy_offset_menu.py +65 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_xy_roundtrip.py +43 -0
- batplot-1.8.48/batplot/converters.py +0 -366
- batplot-1.8.48/batplot/data/latest_release_notes.json +0 -7
- batplot-1.8.48/batplot/plot_modes/batch_session/ec_batch_helpers.py +0 -457
- batplot-1.8.48/batplot/plot_modes/batch_session/kinds.py +0 -48
- batplot-1.8.48/batplot/plot_modes/batch_session/operando_batch_helpers.py +0 -472
- batplot-1.8.48/batplot/plot_modes/cpc/interactive.py +0 -1722
- batplot-1.8.48/batplot/plot_modes/cpc/routing.py +0 -544
- batplot-1.8.48/batplot/plot_modes/electrochem/colors.py +0 -859
- batplot-1.8.48/batplot/plot_modes/electrochem/interactive.py +0 -3359
- batplot-1.8.48/batplot/plot_modes/electrochem/legend_order.py +0 -56
- batplot-1.8.48/batplot/plot_modes/operando/colors.py +0 -173
- batplot-1.8.48/batplot/plot_modes/operando/interactive.py +0 -3790
- batplot-1.8.48/batplot/plot_modes/operando/ions_axis.py +0 -141
- batplot-1.8.48/batplot/plot_modes/operando/line_style.py +0 -106
- batplot-1.8.48/tests/test_batch_all_modes_sync.py +0 -134
- batplot-1.8.48/tests/test_interactive_menu_smoke.py +0 -254
- {batplot-1.8.48 → batplot-1.8.51}/LICENSE +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/MANIFEST.in +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/NOTICE +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/_mpl_backend.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/cif.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/cli.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/cli_save.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/ec_common.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/modes.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_crosshair.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_figure_io.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_geom_helpers.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_io.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_menu_helpers.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/batch_menu_io.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/common.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/batch_session/histo_batch_helpers.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/crosshair_export.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/files.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/interactive_state.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/palettes.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/size_spec.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/smoothing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/state_capture.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/style_routing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/common/title_offsets.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/cpc/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/export.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/electrochem/legend.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/fonts.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/line_style.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/load.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/routing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/toggles.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/wizard.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/histo/y_range.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/layout_menu.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/operando/routing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/session_routing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/__init__.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/derivative.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/game.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/peaks.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/smoothing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plot_modes/xy/spines.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/plotting.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/session.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/showcol.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot/style.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot.egg-info/dependency_links.txt +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot.egg-info/entry_points.txt +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/batplot.egg-info/top_level.txt +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/setup.cfg +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/setup.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_crosshair.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_ec_cycles_status.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_font_menu.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_geom_menu.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_batch_panel_status.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_bruker_intensity.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_cli_save.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_color_utils.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_common_files.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_contracts.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_cpc_roundtrip.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_critical_stability_fixes.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_cross_platform_parity.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_crosshair_export.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_csv_readers.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_dev_upgrade.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_histo_interactive_imports.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_imk_stderr_guard.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_menu_prompt_order.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_mpl_backend.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_session_font_restore.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_state_capture.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_style_routing.py +0 -0
- {batplot-1.8.48 → batplot-1.8.51}/tests/test_xy_source_files.py +0 -0
|
@@ -112,6 +112,9 @@ Important files:
|
|
|
112
112
|
- `colors.py`, `line_style.py`, `labels.py`, `axis_range.py`, `smoothing.py`,
|
|
113
113
|
`derivative.py`, `peaks.py`, `cif.py`, `data_ops.py`, `arrange.py`: focused
|
|
114
114
|
XY features.
|
|
115
|
+
- `undo_state.py`: undo snapshot capture/restore (`xy_push_state` /
|
|
116
|
+
`xy_restore_state`), called through thin wrappers in `interactive.py`.
|
|
117
|
+
- `offset_menu.py`: the `o` curve-offset submenu.
|
|
115
118
|
|
|
116
119
|
### Electrochemistry Mode
|
|
117
120
|
|
|
@@ -125,6 +128,10 @@ Important files:
|
|
|
125
128
|
- `dqdv_2d.py`: dQ/dV 2D companion contour persistence and helpers.
|
|
126
129
|
- `style.py`, `colors.py`, `line_style.py`, `labels.py`, `legend.py`,
|
|
127
130
|
`legend_order.py`, `spine_colors.py`: EC styling features.
|
|
131
|
+
- `undo_state.py`: undo snapshot capture/restore (`ec_push_state` /
|
|
132
|
+
`ec_restore_state`), called through thin wrappers in `interactive.py`.
|
|
133
|
+
- `dual_axis_menu.py`: the `a` capacity/ions/dual-X submenu.
|
|
134
|
+
- `smoothing_menu.py`: the `sm` dQ/dV smoothing submenu.
|
|
128
135
|
|
|
129
136
|
Shared EC/CPC defaults live in `batplot/ec_common.py`. Canvas size, plot layout,
|
|
130
137
|
and mass-resolution behavior should be changed there when the goal is parity
|
|
@@ -141,6 +148,9 @@ Important files:
|
|
|
141
148
|
- `interactive.py`: CPC-specific interactive command loop.
|
|
142
149
|
- `actions.py`: save/export/undo actions.
|
|
143
150
|
- `legend.py`, `colors.py`, `labels.py`, `snapshots.py`: CPC-specific behavior.
|
|
151
|
+
- `wasd_menu.py`: the `t` WASD spine/tick/label toggle submenu.
|
|
152
|
+
- `panel_menus.py`: the `v`/`k`/`d`/`ry`/`l`/`m`/`ie` submenus (visibility,
|
|
153
|
+
spine colors, display mode, efficiency axis, widths, markers, inversion).
|
|
144
154
|
- `session.py`: public CPC session wrappers.
|
|
145
155
|
|
|
146
156
|
CPC shares several expectations with EC but has a second y-axis and scatter
|
|
@@ -162,6 +172,12 @@ Important files:
|
|
|
162
172
|
display behavior.
|
|
163
173
|
- `style.py`, `colors.py`, `labels.py`, `line_style.py`, `peaks.py`: styling
|
|
164
174
|
and annotation behavior.
|
|
175
|
+
- `undo_state.py`: undo snapshot capture/restore (`op_snapshot` /
|
|
176
|
+
`op_restore`), called through thin wrappers in `interactive.py`.
|
|
177
|
+
- `cif_menu.py`: the `c` CIF tick-label submenu.
|
|
178
|
+
- `axes_limits_menu.py`: the `ox`/`oy`/`et`/`ex`/`ey` range and ions/time
|
|
179
|
+
submenus.
|
|
180
|
+
- `intensity_menu.py`: the `oz` color-scale submenu (including the drag bar).
|
|
165
181
|
- `session.py`: public operando session wrappers.
|
|
166
182
|
|
|
167
183
|
Operando state has more moving parts than the other modes. Keep changes focused
|
|
@@ -171,7 +187,15 @@ and add round-trip tests for persistence changes.
|
|
|
171
187
|
|
|
172
188
|
### Readers
|
|
173
189
|
|
|
174
|
-
File parsing lives primarily in `batplot/readers.py
|
|
190
|
+
File parsing lives primarily in `batplot/readers.py`, which re-exports every
|
|
191
|
+
public reader so `from batplot.readers import ...` always works. The
|
|
192
|
+
implementations are split by area:
|
|
193
|
+
|
|
194
|
+
- `readers.py`: generic CSV/XY readers plus the re-export facade.
|
|
195
|
+
- `readers_ec.py`: electrochemistry readers (BioLogic, Neware, Landt, CS-B,
|
|
196
|
+
BATX, dQ/dV numerics, time-voltage).
|
|
197
|
+
- `readers_xrd.py`: XRD vendor formats.
|
|
198
|
+
- `readers_common.py`: low-level numeric parsing helpers shared by the above.
|
|
175
199
|
|
|
176
200
|
Add a reader here when:
|
|
177
201
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batplot
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.51
|
|
4
4
|
Summary: Interactive plotting tool for material science (1D plot) and electrochemistry (GC, CV, dQ/dV, CPC, operando) with batch processing
|
|
5
5
|
Author-email: Tian Dai <tianda@uio.no>
|
|
6
6
|
License: MIT License
|
|
@@ -45,10 +45,12 @@ License-File: LICENSE
|
|
|
45
45
|
License-File: NOTICE
|
|
46
46
|
Requires-Dist: numpy>=1.21.0
|
|
47
47
|
Requires-Dist: matplotlib>=3.5.0
|
|
48
|
+
Requires-Dist: scipy>=1.7.0
|
|
48
49
|
Requires-Dist: rich>=10.0.0
|
|
49
50
|
Requires-Dist: openpyxl>=3.0.0
|
|
50
51
|
Provides-Extra: test
|
|
51
52
|
Requires-Dist: pytest>=7.0; extra == "test"
|
|
53
|
+
Requires-Dist: pytest-timeout>=2.0; extra == "test"
|
|
52
54
|
Requires-Dist: basedpyright>=1.28.0; extra == "test"
|
|
53
55
|
Dynamic: license-file
|
|
54
56
|
|
|
@@ -64,12 +66,14 @@ With a single line of command to easily plot publication-ready plots with custom
|
|
|
64
66
|
- **Electrochemistry Plot**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
|
|
65
67
|
- **1D XY plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
|
|
66
68
|
- **Operando Contour plot**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
|
|
69
|
+
- **XRD axis units**: Interactive Options `u` converts 2θ ↔ Q ↔ d (XY and operando); CIF phase ticks follow the current domain
|
|
67
70
|
- **Histogram mode**: Column histograms from tabular `.csv`/`.txt` data (e.g. particle-size lists)
|
|
68
71
|
- **Interactive plotting**: Real-time editing customized for each type of plottings
|
|
69
72
|
- **Session Persistence**: Save and reload complete plot states with `.pkl` files
|
|
70
73
|
- **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files (histogram: `.bpsh`)
|
|
71
74
|
- **Batch Processing**: Export each file separately with `--all`
|
|
72
75
|
- **Column preview**: `--showcol` prints numbered columns, header names when found, and the first 10 values per column (CSV, Excel, text, .mpt, .brml, Bruker .raw, etc.)
|
|
76
|
+
- **Strip header lines**: `--strip-header N` removes the first N lines from a file or a folder of files (with `--ext`) and writes copies into a `stripped/` subfolder (originals untouched)
|
|
73
77
|
|
|
74
78
|
## Installation
|
|
75
79
|
|
|
@@ -82,7 +86,6 @@ pip install batplot
|
|
|
82
86
|
|
|
83
87
|
- Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
|
|
84
88
|
- Tutorial files: https://github.com/chem-plot/batplot/blob/main/batplot_tutorial.zip
|
|
85
|
-
- Manual: https://github.com/chem-plot/batplot/blob/main/batplot_user_manual.pdf
|
|
86
89
|
|
|
87
90
|
---
|
|
88
91
|
|
|
@@ -94,11 +97,12 @@ In batplot, --xaxis is frequently used to indicate the data type.
|
|
|
94
97
|
|
|
95
98
|
```bash
|
|
96
99
|
|
|
97
|
-
# Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
|
|
100
|
+
# Specify X-axis type (Q, 2theta, d, r, k, energy, time or any user defined names)
|
|
98
101
|
# By defauly, batplot will skip the header lines, plot the first and second columns as x and y
|
|
99
102
|
# Q and q are equivalent (case-insensitive)
|
|
100
103
|
batplot pattern.xye --xaxis 2theta --i
|
|
101
104
|
batplot data.qye --xaxis q --i
|
|
105
|
+
batplot data.xye --xaxis d --wl 1.54 --i
|
|
102
106
|
batplot data.txt --xaxis whatever --i
|
|
103
107
|
|
|
104
108
|
# Set X-axis range
|
|
@@ -109,20 +113,41 @@ batplot pattern.xye --xaxis 2theta --out figure
|
|
|
109
113
|
batplot pattern.txt --xaxis Energy --out figure.png
|
|
110
114
|
```
|
|
111
115
|
|
|
112
|
-
###
|
|
116
|
+
### Strip header lines (export copies)
|
|
113
117
|
|
|
114
118
|
```bash
|
|
115
|
-
#
|
|
116
|
-
batplot data.
|
|
119
|
+
# Single file: drop first 5 lines → ./stripped/data.txt
|
|
120
|
+
batplot data.txt --strip-header 5
|
|
121
|
+
|
|
122
|
+
# Folder: only .xy files → folder/stripped/*.xy
|
|
123
|
+
batplot /path/to/folder --strip-header 3 --ext .xy
|
|
124
|
+
|
|
125
|
+
# Multiple extensions (comma-separated)
|
|
126
|
+
batplot /path/to/folder --strip-header 2 --ext .xy,.dat,.txt
|
|
127
|
+
```
|
|
117
128
|
|
|
118
|
-
|
|
129
|
+
Originals are never modified. Binary formats (`.brml`, `.raw`, `.xlsx`, …) are skipped.
|
|
130
|
+
|
|
131
|
+
### Wavelength and XRD unit conversion (plot vs export)
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Plot: convert 2θ→Q for display (λ in Å). --xaxis not needed when --wl / file:λ is given
|
|
135
|
+
batplot data.raw --wl 1.5406 --i
|
|
119
136
|
batplot scan1.brml:1.5406 scan2.xye:0.7093 --i
|
|
120
137
|
|
|
121
|
-
#
|
|
122
|
-
|
|
123
|
-
batplot data.
|
|
138
|
+
# Export: --convert writes into a converted/ subfolder next to each input
|
|
139
|
+
# Units: q|Q, d|D, 2theta|2th|tth — or a number = 2θ at that wavelength
|
|
140
|
+
batplot data.xye --convert 1.54 q # 2θ(λ=1.54) → Q → *.qye
|
|
141
|
+
batplot data.qye --convert q 1.54 # Q → 2θ(λ=1.54) → *.xy
|
|
142
|
+
batplot data.qye --convert q d # Q ↔ d (no λ)
|
|
143
|
+
batplot data.xy --convert d 2theta --wl 1.5406
|
|
144
|
+
batplot data.xye --convert 0.26 1.54 # 2θ(λ1) → 2θ(λ2)
|
|
145
|
+
|
|
146
|
+
# Folder of .xy → Q with typed extension filter / output extension
|
|
147
|
+
batplot /path/to/folder --ext .xy --convert 0.26 q
|
|
148
|
+
batplot /path/to/folder --ext xy --convert 2theta q --wl 0.26 --convert-ext .qye
|
|
124
149
|
|
|
125
|
-
#
|
|
150
|
+
# Custom columns when converting
|
|
126
151
|
batplot data.csv --readcol 3 4 --convert 1.54 q
|
|
127
152
|
batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q
|
|
128
153
|
```
|
|
@@ -191,6 +216,27 @@ batplot file1.xy file2.xy --stack --i
|
|
|
191
216
|
batplot allfiles --xaxis 2theta --xrange 15 75 --i
|
|
192
217
|
```
|
|
193
218
|
|
|
219
|
+
**XRD Options `u` (axis units):** On diffraction plots only, press `u` to convert the x-axis among **2θ ↔ Q ↔ d**. Conversions that involve 2θ need a wavelength (`--wl`, `file:wl`, or a prompt). Data, axis labels/limits, and CIF ticks stay in sync. Not available for PDF/XAS or other non-XRD axes.
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Launch in 2θ, then use Options u → q (or d) inside the menu
|
|
223
|
+
batplot data.xye:0.709 --xaxis 2theta --i
|
|
224
|
+
batplot data.xye --xaxis 2theta --wl 1.5406 --i
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### CIF phase ticks
|
|
228
|
+
|
|
229
|
+
Add one or more `.cif` files to overlay Bragg reflection markers. Peaks are stored in Q and drawn in the current axis domain (2θ / Q / d). Use `cif` in the interactive menu to add, rename, or hide sets; after Options `u`, ticks redraw in the new units.
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Q plot + CIF ticks
|
|
233
|
+
batplot scan.xye:1.54 phase.cif --i
|
|
234
|
+
|
|
235
|
+
# 2θ plot: give λ for data and/or CIF (file.cif:wl)
|
|
236
|
+
batplot scan.xye phase.cif:0.709 --xaxis 2theta --wl 0.709 --i
|
|
237
|
+
batplot scan.xye:1.54 phase.cif --stack --i
|
|
238
|
+
```
|
|
239
|
+
|
|
194
240
|
### Session save without interactive menu (`--save`)
|
|
195
241
|
|
|
196
242
|
```bash
|
|
@@ -219,10 +265,16 @@ batplot file1.csv file2.csv --gc --save
|
|
|
219
265
|
|
|
220
266
|
GC mode plots potential vs. capacity for each charge/discharge cycle—the primary visualization for battery cycling data. Batplot automatically detects cycles from Neware `.csv` or Biologic `.mpt` files, assigns each cycle a distinct color, and supports both specific capacity (mAh/g) and raw capacity. For `.mpt` files, pass `--mass` (mg) to compute specific capacity. Discontinuous or paused experiments are handled by splitting data into contiguous charge/discharge segments. Use the interactive menu to customize colors, visibility, and export.
|
|
221
267
|
|
|
268
|
+
By default each half-cycle resets capacity near 0 (cycles overlaid). With `--gc --cum`, capacity is laid **end-to-end** (cumulative / throughput capacity) so charge and discharge connect from the start to the end of the experiment; cycle colors, multifile overlay, overview, display mode, style/session save, and `--ro` still apply.
|
|
269
|
+
|
|
222
270
|
```bash
|
|
223
271
|
# From .csv (capacity in file)
|
|
224
272
|
batplot battery.csv --gc --i
|
|
225
273
|
|
|
274
|
+
# Cumulative capacity (charge/discharge connected end-to-end)
|
|
275
|
+
batplot battery.csv --gc --cum --i
|
|
276
|
+
batplot f1.csv f2.csv --gc --cum --i
|
|
277
|
+
|
|
226
278
|
# From .mpt (requires --mass in mg)
|
|
227
279
|
batplot battery.mpt --gc --mass 7.0 --i
|
|
228
280
|
|
|
@@ -306,6 +358,12 @@ batplot --operando --1d --i
|
|
|
306
358
|
batplot folder phase.cif:1.54 --operando --i
|
|
307
359
|
```
|
|
308
360
|
|
|
361
|
+
**XRD Options `u`:** In the operando interactive menu, press `u` to convert the contour x-axis among **2θ ↔ Q ↔ d** (XRD only; needs λ for 2θ). CIF ticks follow the new domain. Prefer an explicit `--xaxis` when combining with `--wl` (e.g. `--xaxis 2theta --wl 0.709` keeps degrees; `--wl` alone still defaults to Q).
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
batplot folder phase.cif --operando --xaxis 2theta --wl 0.709 --i
|
|
365
|
+
```
|
|
366
|
+
|
|
309
367
|
Operando column selection:
|
|
310
368
|
- `--readcolc <x> <y>`: columns for the contour plot (from .xy/.xye/.qye/.dat files)
|
|
311
369
|
- `--readcols <x> <y>`: columns for the side panel (from .mpt file)
|
|
@@ -10,12 +10,14 @@ With a single line of command to easily plot publication-ready plots with custom
|
|
|
10
10
|
- **Electrochemistry Plot**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
|
|
11
11
|
- **1D XY plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
|
|
12
12
|
- **Operando Contour plot**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
|
|
13
|
+
- **XRD axis units**: Interactive Options `u` converts 2θ ↔ Q ↔ d (XY and operando); CIF phase ticks follow the current domain
|
|
13
14
|
- **Histogram mode**: Column histograms from tabular `.csv`/`.txt` data (e.g. particle-size lists)
|
|
14
15
|
- **Interactive plotting**: Real-time editing customized for each type of plottings
|
|
15
16
|
- **Session Persistence**: Save and reload complete plot states with `.pkl` files
|
|
16
17
|
- **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files (histogram: `.bpsh`)
|
|
17
18
|
- **Batch Processing**: Export each file separately with `--all`
|
|
18
19
|
- **Column preview**: `--showcol` prints numbered columns, header names when found, and the first 10 values per column (CSV, Excel, text, .mpt, .brml, Bruker .raw, etc.)
|
|
20
|
+
- **Strip header lines**: `--strip-header N` removes the first N lines from a file or a folder of files (with `--ext`) and writes copies into a `stripped/` subfolder (originals untouched)
|
|
19
21
|
|
|
20
22
|
## Installation
|
|
21
23
|
|
|
@@ -28,7 +30,6 @@ pip install batplot
|
|
|
28
30
|
|
|
29
31
|
- Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
|
|
30
32
|
- Tutorial files: https://github.com/chem-plot/batplot/blob/main/batplot_tutorial.zip
|
|
31
|
-
- Manual: https://github.com/chem-plot/batplot/blob/main/batplot_user_manual.pdf
|
|
32
33
|
|
|
33
34
|
---
|
|
34
35
|
|
|
@@ -40,11 +41,12 @@ In batplot, --xaxis is frequently used to indicate the data type.
|
|
|
40
41
|
|
|
41
42
|
```bash
|
|
42
43
|
|
|
43
|
-
# Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
|
|
44
|
+
# Specify X-axis type (Q, 2theta, d, r, k, energy, time or any user defined names)
|
|
44
45
|
# By defauly, batplot will skip the header lines, plot the first and second columns as x and y
|
|
45
46
|
# Q and q are equivalent (case-insensitive)
|
|
46
47
|
batplot pattern.xye --xaxis 2theta --i
|
|
47
48
|
batplot data.qye --xaxis q --i
|
|
49
|
+
batplot data.xye --xaxis d --wl 1.54 --i
|
|
48
50
|
batplot data.txt --xaxis whatever --i
|
|
49
51
|
|
|
50
52
|
# Set X-axis range
|
|
@@ -55,20 +57,41 @@ batplot pattern.xye --xaxis 2theta --out figure
|
|
|
55
57
|
batplot pattern.txt --xaxis Energy --out figure.png
|
|
56
58
|
```
|
|
57
59
|
|
|
58
|
-
###
|
|
60
|
+
### Strip header lines (export copies)
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
|
-
#
|
|
62
|
-
batplot data.
|
|
63
|
+
# Single file: drop first 5 lines → ./stripped/data.txt
|
|
64
|
+
batplot data.txt --strip-header 5
|
|
65
|
+
|
|
66
|
+
# Folder: only .xy files → folder/stripped/*.xy
|
|
67
|
+
batplot /path/to/folder --strip-header 3 --ext .xy
|
|
68
|
+
|
|
69
|
+
# Multiple extensions (comma-separated)
|
|
70
|
+
batplot /path/to/folder --strip-header 2 --ext .xy,.dat,.txt
|
|
71
|
+
```
|
|
63
72
|
|
|
64
|
-
|
|
73
|
+
Originals are never modified. Binary formats (`.brml`, `.raw`, `.xlsx`, …) are skipped.
|
|
74
|
+
|
|
75
|
+
### Wavelength and XRD unit conversion (plot vs export)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Plot: convert 2θ→Q for display (λ in Å). --xaxis not needed when --wl / file:λ is given
|
|
79
|
+
batplot data.raw --wl 1.5406 --i
|
|
65
80
|
batplot scan1.brml:1.5406 scan2.xye:0.7093 --i
|
|
66
81
|
|
|
67
|
-
#
|
|
68
|
-
|
|
69
|
-
batplot data.
|
|
82
|
+
# Export: --convert writes into a converted/ subfolder next to each input
|
|
83
|
+
# Units: q|Q, d|D, 2theta|2th|tth — or a number = 2θ at that wavelength
|
|
84
|
+
batplot data.xye --convert 1.54 q # 2θ(λ=1.54) → Q → *.qye
|
|
85
|
+
batplot data.qye --convert q 1.54 # Q → 2θ(λ=1.54) → *.xy
|
|
86
|
+
batplot data.qye --convert q d # Q ↔ d (no λ)
|
|
87
|
+
batplot data.xy --convert d 2theta --wl 1.5406
|
|
88
|
+
batplot data.xye --convert 0.26 1.54 # 2θ(λ1) → 2θ(λ2)
|
|
89
|
+
|
|
90
|
+
# Folder of .xy → Q with typed extension filter / output extension
|
|
91
|
+
batplot /path/to/folder --ext .xy --convert 0.26 q
|
|
92
|
+
batplot /path/to/folder --ext xy --convert 2theta q --wl 0.26 --convert-ext .qye
|
|
70
93
|
|
|
71
|
-
#
|
|
94
|
+
# Custom columns when converting
|
|
72
95
|
batplot data.csv --readcol 3 4 --convert 1.54 q
|
|
73
96
|
batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q
|
|
74
97
|
```
|
|
@@ -137,6 +160,27 @@ batplot file1.xy file2.xy --stack --i
|
|
|
137
160
|
batplot allfiles --xaxis 2theta --xrange 15 75 --i
|
|
138
161
|
```
|
|
139
162
|
|
|
163
|
+
**XRD Options `u` (axis units):** On diffraction plots only, press `u` to convert the x-axis among **2θ ↔ Q ↔ d**. Conversions that involve 2θ need a wavelength (`--wl`, `file:wl`, or a prompt). Data, axis labels/limits, and CIF ticks stay in sync. Not available for PDF/XAS or other non-XRD axes.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Launch in 2θ, then use Options u → q (or d) inside the menu
|
|
167
|
+
batplot data.xye:0.709 --xaxis 2theta --i
|
|
168
|
+
batplot data.xye --xaxis 2theta --wl 1.5406 --i
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### CIF phase ticks
|
|
172
|
+
|
|
173
|
+
Add one or more `.cif` files to overlay Bragg reflection markers. Peaks are stored in Q and drawn in the current axis domain (2θ / Q / d). Use `cif` in the interactive menu to add, rename, or hide sets; after Options `u`, ticks redraw in the new units.
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Q plot + CIF ticks
|
|
177
|
+
batplot scan.xye:1.54 phase.cif --i
|
|
178
|
+
|
|
179
|
+
# 2θ plot: give λ for data and/or CIF (file.cif:wl)
|
|
180
|
+
batplot scan.xye phase.cif:0.709 --xaxis 2theta --wl 0.709 --i
|
|
181
|
+
batplot scan.xye:1.54 phase.cif --stack --i
|
|
182
|
+
```
|
|
183
|
+
|
|
140
184
|
### Session save without interactive menu (`--save`)
|
|
141
185
|
|
|
142
186
|
```bash
|
|
@@ -165,10 +209,16 @@ batplot file1.csv file2.csv --gc --save
|
|
|
165
209
|
|
|
166
210
|
GC mode plots potential vs. capacity for each charge/discharge cycle—the primary visualization for battery cycling data. Batplot automatically detects cycles from Neware `.csv` or Biologic `.mpt` files, assigns each cycle a distinct color, and supports both specific capacity (mAh/g) and raw capacity. For `.mpt` files, pass `--mass` (mg) to compute specific capacity. Discontinuous or paused experiments are handled by splitting data into contiguous charge/discharge segments. Use the interactive menu to customize colors, visibility, and export.
|
|
167
211
|
|
|
212
|
+
By default each half-cycle resets capacity near 0 (cycles overlaid). With `--gc --cum`, capacity is laid **end-to-end** (cumulative / throughput capacity) so charge and discharge connect from the start to the end of the experiment; cycle colors, multifile overlay, overview, display mode, style/session save, and `--ro` still apply.
|
|
213
|
+
|
|
168
214
|
```bash
|
|
169
215
|
# From .csv (capacity in file)
|
|
170
216
|
batplot battery.csv --gc --i
|
|
171
217
|
|
|
218
|
+
# Cumulative capacity (charge/discharge connected end-to-end)
|
|
219
|
+
batplot battery.csv --gc --cum --i
|
|
220
|
+
batplot f1.csv f2.csv --gc --cum --i
|
|
221
|
+
|
|
172
222
|
# From .mpt (requires --mass in mg)
|
|
173
223
|
batplot battery.mpt --gc --mass 7.0 --i
|
|
174
224
|
|
|
@@ -252,6 +302,12 @@ batplot --operando --1d --i
|
|
|
252
302
|
batplot folder phase.cif:1.54 --operando --i
|
|
253
303
|
```
|
|
254
304
|
|
|
305
|
+
**XRD Options `u`:** In the operando interactive menu, press `u` to convert the contour x-axis among **2θ ↔ Q ↔ d** (XRD only; needs λ for 2θ). CIF ticks follow the new domain. Prefer an explicit `--xaxis` when combining with `--wl` (e.g. `--xaxis 2theta --wl 0.709` keeps degrees; `--wl` alone still defaults to Q).
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
batplot folder phase.cif --operando --xaxis 2theta --wl 0.709 --i
|
|
309
|
+
```
|
|
310
|
+
|
|
255
311
|
Operando column selection:
|
|
256
312
|
- `--readcolc <x> <y>`: columns for the contour plot (from .xy/.xye/.qye/.dat files)
|
|
257
313
|
- `--readcols <x> <y>`: columns for the side panel (from .mpt file)
|
|
@@ -158,6 +158,7 @@ def _print_general_help() -> None:
|
|
|
158
158
|
" [Electrochemistry]\n"
|
|
159
159
|
" batplot --gc file.mpt --mass 7.0 --i # GC from .mpt\n"
|
|
160
160
|
" batplot --gc file.csv --i # GC from .csv\n"
|
|
161
|
+
" batplot --gc --cum file.csv --i # GC cumulative capacity (end-to-end)\n"
|
|
161
162
|
" batplot --dqdv file.csv --i # dQ/dV\n"
|
|
162
163
|
" batplot --cv file.mpt --i # Cyclic voltammetry\n"
|
|
163
164
|
" batplot --cpc file.csv --mass 3.52 --i # Capacity per cycle\n\n"
|
|
@@ -172,6 +173,8 @@ def _print_general_help() -> None:
|
|
|
172
173
|
"Features:\n"
|
|
173
174
|
" • Interactive (--i): styling, ranges, fonts, export, sessions\n"
|
|
174
175
|
" • XRD wavelength: --wl 1.54 or file.xye:1.5406 for Q conversion\n"
|
|
176
|
+
" • XRD axis units (interactive): Options u converts 2θ ↔ Q ↔ d (XY + operando; needs λ for 2θ)\n"
|
|
177
|
+
" • CIF phase ticks: add .cif (or file.cif:wl); ticks follow the current axis (2θ / Q / d)\n"
|
|
175
178
|
" • X-axis range: --xrange min max\n"
|
|
176
179
|
" • Save figure: --out filename (default .svg)\n"
|
|
177
180
|
" • Save session: --save (choose folder + name; default stem for single file / --all batch)\n"
|
|
@@ -181,6 +184,8 @@ def _print_general_help() -> None:
|
|
|
181
184
|
"More help:\n"
|
|
182
185
|
" batplot --v # Version and release info (with option to show full release notes)\n"
|
|
183
186
|
" batplot --showcol FILE [FILE...] # Preview column names + first 10 values per column\n"
|
|
187
|
+
" batplot FILE --strip-header N # Remove first N lines; write to stripped/ subfolder\n"
|
|
188
|
+
" batplot FOLDER --strip-header N --ext .xy # Same for a folder (comma-separated exts ok)\n"
|
|
184
189
|
" batplot --h # This help\n"
|
|
185
190
|
" batplot --h xy # XY file plotting guide\n"
|
|
186
191
|
" batplot --h ec # Electrochemistry (GC/dQdV/CV/CPC) guide\n"
|
|
@@ -204,10 +209,21 @@ def _print_xy_help() -> None:
|
|
|
204
209
|
msg = (
|
|
205
210
|
"XY plots (XRD/PDF/XAS and many more)\n\n"
|
|
206
211
|
"Supported files: .xye .xy .qye .dat .csv .gr .nor .chik .chir .txt .brml .raw .xrdml .rasx and other formats. CIF overlays supported.\n\n"
|
|
207
|
-
"Axis detection: .qye→Q, .gr→r, .nor→energy, .chik→k, .chir→r, else use --xaxis (Q, 2theta, r, k, energy, time or user defined).\n"
|
|
212
|
+
"Axis detection: .qye→Q, .gr→r, .nor→energy, .chik→k, .chir→r, else use --xaxis (Q, 2theta, d, r, k, energy, time or user defined).\n"
|
|
208
213
|
"If mixing 2θ data in Q, give wavelength per-file (file.xye:1.5406) or global flag --wl.\n"
|
|
209
214
|
"A wavelength can be converted into a different wave length by file.xye:1.54:0.709.\n"
|
|
210
215
|
"For electrochemistry CSV/MPT time-potential plots, use --xaxis time.\n\n"
|
|
216
|
+
"Interactive XRD axis units (Options u):\n"
|
|
217
|
+
" In --i, press u to convert the plotted XRD axis among 2θ ↔ Q ↔ d (XRD data only).\n"
|
|
218
|
+
" Conversions involving 2θ need λ (--wl, file:wl, or prompt). CIF ticks stay Bragg-aligned.\n"
|
|
219
|
+
" Not for PDF (.gr), XAS (.nor/.chik/.chir), or other non-diffraction axes.\n"
|
|
220
|
+
" Example: batplot data.xye:0.709 --xaxis 2theta --i then u → q (uses λ=0.709 Å).\n\n"
|
|
221
|
+
"CIF phase ticks:\n"
|
|
222
|
+
" Add .cif files on the command line (optional :wl for 2θ). Peaks are stored in Q and\n"
|
|
223
|
+
" drawn in the current domain (2θ / Q / d). In --i use cif to add/reorder/hide ticks;\n"
|
|
224
|
+
" after Options u, ticks redraw in the new units. Example:\n"
|
|
225
|
+
" batplot scan.xye:1.54 phase.cif --i\n"
|
|
226
|
+
" batplot scan.xye phase.cif:0.709 --xaxis 2theta --wl 0.709 --i\n\n"
|
|
211
227
|
"Examples:\n"
|
|
212
228
|
" batplot file.xy file2.xye --xaxis 2theta --i # Plot XRD data in 2theta space\n"
|
|
213
229
|
" batplot file1.xye:1.5406 file2.txt:0.709 --i # Plot XRD data in different wavelengths in q space\n"
|
|
@@ -225,6 +241,7 @@ def _print_xy_help() -> None:
|
|
|
225
241
|
"Tips and options:\n"
|
|
226
242
|
"[XY plot]\n"
|
|
227
243
|
" --i : open interactive menu for styling, ranges, fonts, export, sessions\n"
|
|
244
|
+
" (XRD: Options u = convert axis 2θ ↔ Q ↔ d; cif = phase tick overlay)\n"
|
|
228
245
|
" --delta <float> : spacing between curves, e.g. --delta 0.1\n"
|
|
229
246
|
" --norm : normalize intensity to 0-1 range. Stack mode (--stack) auto-normalizes\n"
|
|
230
247
|
" --chik : EXAFS χ(k) plot (sets labels to k (Å⁻¹) vs χ(k))\n"
|
|
@@ -236,26 +253,38 @@ def _print_xy_help() -> None:
|
|
|
236
253
|
" --xrange <min> <max> : set x-axis range, e.g. --xrange 0 10\n"
|
|
237
254
|
" --out <filename> : save figure to file, e.g. --out file.svg\n"
|
|
238
255
|
" --save : save .pkl session (prompt folder + name; no --i menu)\n"
|
|
239
|
-
" --xaxis <type> : set x-axis type (Q, 2theta, r, k, energy, rft, time, or user defined)\n"
|
|
240
|
-
" Q and q are equivalent (case-insensitive). e.g. --xaxis 2theta, --xaxis Q, --xaxis
|
|
256
|
+
" --xaxis <type> : set x-axis type (Q, 2theta, d, r, k, energy, rft, time, or user defined)\n"
|
|
257
|
+
" Q and q are equivalent (case-insensitive). e.g. --xaxis 2theta, --xaxis Q, --xaxis d\n"
|
|
241
258
|
" --ro : swap x and y axes (exchange x and y values before plotting)\n"
|
|
242
259
|
" e.g. --xaxis time --ro plots time as y-axis and potential as x-axis\n"
|
|
243
260
|
" --wl <float> : set wavelength for Q conversion for all files, e.g. --wl 1.5406\n"
|
|
244
|
-
" --
|
|
245
|
-
"
|
|
246
|
-
"
|
|
247
|
-
"
|
|
248
|
-
"
|
|
261
|
+
" --strip-header <N> : remove the first N lines from text file(s) and export copies\n"
|
|
262
|
+
" into a 'stripped/' subfolder next to each input (originals untouched).\n"
|
|
263
|
+
" Single file: batplot data.txt --strip-header 5\n"
|
|
264
|
+
" Folder: batplot /path/to/folder --strip-header 3 --ext .xy\n"
|
|
265
|
+
" Multiple exts: batplot folder --strip-header 2 --ext .xy,.dat,.txt\n"
|
|
266
|
+
" (--ext required for folders; optional filter when listing files)\n"
|
|
267
|
+
" --convert <from> <to> : convert XRD x-axis and export to a 'converted/' subfolder:\n"
|
|
268
|
+
" Units: q|Q, d|D, 2theta|2th|tth (or a numeric wavelength = 2θ at that λ)\n"
|
|
269
|
+
" - <wl1> <wl2> : 2θ(λ1) → 2θ(λ2)\n"
|
|
270
|
+
" - <wl> q : 2θ(λ) → Q\n"
|
|
271
|
+
" - q <wl> : Q → 2θ(λ)\n"
|
|
272
|
+
" - q d / d q : Q ↔ d (no λ needed)\n"
|
|
273
|
+
" - <wl> d / d <wl> : 2θ(λ) ↔ d\n"
|
|
274
|
+
" - 2theta q --wl λ : same as `<wl> q` (explicit unit names)\n"
|
|
275
|
+
" Folder of .xy → Q (writes folder/converted/*.qye):\n"
|
|
276
|
+
" batplot /path/to/folder --ext .xy --convert 0.26 q\n"
|
|
277
|
+
" Choose input / output extensions:\n"
|
|
278
|
+
" --ext .xy : only convert this extension in a folder\n"
|
|
279
|
+
" --convert-ext .qye : force output extension (default: .qye for Q, .xy otherwise)\n"
|
|
280
|
+
" With --readcol:\n"
|
|
249
281
|
" batplot data.csv --readcol 3 4 --convert 1.54 q\n"
|
|
250
|
-
" batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q\n"
|
|
251
|
-
" Directory: pass a folder to convert all .xy/.xye/.qye/.dat/.csv/.txt files:\n"
|
|
252
|
-
" batplot /path/to/folder --convert 0.25448 1.54\n"
|
|
253
|
-
" Batch in current folder: use allfiles token (non-convertible files are skipped):\n"
|
|
254
|
-
" batplot allfiles --convert q 1.54\n"
|
|
255
282
|
" Examples:\n"
|
|
256
283
|
" batplot file.xye --convert 1.54 0.25\n"
|
|
257
284
|
" batplot file.xye --convert 1.54 q\n"
|
|
285
|
+
" batplot file.qye --convert q d\n"
|
|
258
286
|
" batplot file.qye --convert Q 1.54\n"
|
|
287
|
+
" batplot allfiles --ext xy --convert 2theta q --wl 1.5406 --convert-ext qye\n"
|
|
259
288
|
" File wavelength syntax : specify wavelength(s) per file using colon syntax:\n"
|
|
260
289
|
" - file:wl : single wavelength (for Q conversion or CIF 2theta calculation)\n"
|
|
261
290
|
" - file:wl1:wl2 : dual wavelength (convert 2theta→Q using wl1, then Q→2theta using wl2)\n"
|
|
@@ -305,6 +334,7 @@ def _print_ec_help() -> None:
|
|
|
305
334
|
"GC from supported .csv: specific capacity read directly when available; use --mass for\n"
|
|
306
335
|
" Neware absolute-capacity files (Cycle Index / Step Index / DataPoint format).\n"
|
|
307
336
|
" batplot --gc file.csv\n"
|
|
337
|
+
" batplot --gc --cum file.csv --i # Cumulative capacity (charge/discharge end-to-end)\n"
|
|
308
338
|
" batplot --gc file.csv --mass 3.52 # Neware absolute-capacity CSV\n\n"
|
|
309
339
|
"Per-file mass: repeat --mass once per file that needs it, in file order.\n"
|
|
310
340
|
" batplot f1.mpt --mass 6.5 f2.csv f3.mpt --mass 7.0 --gc\n"
|
|
@@ -426,6 +456,9 @@ def _print_op_help() -> None:
|
|
|
426
456
|
"Interactive (--i): menu has (Styles), (Operando), (Side Panel), (Options) columns.\n"
|
|
427
457
|
"Resize axes/canvas, change colormap, set intensity range (oz), side-panel options,\n"
|
|
428
458
|
"geometry tweaks, toggle spines/ticks/labels, print/export/import style, save session.\n"
|
|
459
|
+
"XRD only — Options u: convert contour X among 2θ ↔ Q ↔ d (needs λ for 2θ; CIF ticks follow).\n"
|
|
460
|
+
"CIF: add .cif on the command line or via the CIF submenu; ticks stay Bragg-aligned after u.\n"
|
|
461
|
+
" Example: batplot folder phase.cif --operando --xaxis 2theta --wl 0.709 --i\n"
|
|
429
462
|
"Session save without menu: --save (combined operando plot — session name required).\n"
|
|
430
463
|
)
|
|
431
464
|
_print_help(msg)
|
|
@@ -442,6 +475,14 @@ def _add_help_and_entry_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
442
475
|
action="store_true",
|
|
443
476
|
help=argparse.SUPPRESS,
|
|
444
477
|
)
|
|
478
|
+
parser.add_argument(
|
|
479
|
+
"--strip-header",
|
|
480
|
+
type=int,
|
|
481
|
+
metavar="N",
|
|
482
|
+
dest="strip_header",
|
|
483
|
+
default=None,
|
|
484
|
+
help=argparse.SUPPRESS,
|
|
485
|
+
)
|
|
445
486
|
parser.add_argument("--manual", action="store_true", help=argparse.SUPPRESS)
|
|
446
487
|
parser.add_argument("files", nargs="*", help=argparse.SUPPRESS)
|
|
447
488
|
|
|
@@ -455,7 +496,26 @@ def _add_xy_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
455
496
|
parser.add_argument("--errors", action="store_true", help=argparse.SUPPRESS)
|
|
456
497
|
parser.add_argument("--xaxis", type=str, help=argparse.SUPPRESS)
|
|
457
498
|
parser.add_argument("--convert", nargs=2, metavar=("FROM", "TO"),
|
|
458
|
-
help="Convert XRD data
|
|
499
|
+
help="Convert XRD data among 2θ/Q/d (or λ1→λ2 for 2θ). Exports to 'converted' subfolder.")
|
|
500
|
+
parser.add_argument(
|
|
501
|
+
"--ext",
|
|
502
|
+
type=str,
|
|
503
|
+
default=None,
|
|
504
|
+
metavar="EXT",
|
|
505
|
+
help=(
|
|
506
|
+
"With --convert or --strip-header: only process files with this extension "
|
|
507
|
+
"(e.g. .xy or xy). For --strip-header, comma-separated lists are allowed "
|
|
508
|
+
"(e.g. .xy,.dat,.txt)."
|
|
509
|
+
),
|
|
510
|
+
)
|
|
511
|
+
parser.add_argument(
|
|
512
|
+
"--convert-ext",
|
|
513
|
+
type=str,
|
|
514
|
+
default=None,
|
|
515
|
+
metavar="EXT",
|
|
516
|
+
dest="convert_ext",
|
|
517
|
+
help="With --convert: output file extension (e.g. .qye or qye). Default: .qye for Q, .xy otherwise.",
|
|
518
|
+
)
|
|
459
519
|
parser.add_argument("--extract-brml-scans", nargs="?", const="", metavar="OUT_DIR",
|
|
460
520
|
help="Extract each XRD scan from .brml file to separate .xy files. Optional OUT_DIR (default: <brml_stem>_scans).")
|
|
461
521
|
parser.add_argument("--wl", type=float, help=argparse.SUPPRESS)
|
|
@@ -495,6 +555,11 @@ def _add_interactive_export_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
495
555
|
def _add_electrochem_arguments(parser: argparse.ArgumentParser) -> None:
|
|
496
556
|
"""Register electrochemistry mode arguments."""
|
|
497
557
|
parser.add_argument("--gc", action="store_true", help=argparse.SUPPRESS)
|
|
558
|
+
parser.add_argument(
|
|
559
|
+
"--cum",
|
|
560
|
+
action="store_true",
|
|
561
|
+
help="With --gc: plot cumulative (throughput) capacity — charge/discharge laid end-to-end.",
|
|
562
|
+
)
|
|
498
563
|
parser.add_argument("--mass", type=parse_mass_mg_from_cli, action='append', help=argparse.SUPPRESS)
|
|
499
564
|
parser.add_argument("--dqdv", action="store_true", help=argparse.SUPPRESS)
|
|
500
565
|
parser.add_argument("--cv", action="store_true", help=argparse.SUPPRESS)
|
|
@@ -40,6 +40,7 @@ def _is_mpt_like_ext(ext: str) -> bool:
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
from .ec_common import _resolve_mass
|
|
43
|
+
from .plot_modes.electrochem.capacity_cum import apply_gc_capacity_mode, stamp_gc_capacity_mode
|
|
43
44
|
from .utils import _confirm_overwrite, natural_sort_key, ensure_subdirectory
|
|
44
45
|
|
|
45
46
|
|
|
@@ -255,6 +256,7 @@ def batch_process(directory: str, args):
|
|
|
255
256
|
# We detect the format from the file extension and use the
|
|
256
257
|
# appropriate reader function.
|
|
257
258
|
# ============================================================
|
|
259
|
+
file_wl = getattr(args, "wl", None)
|
|
258
260
|
|
|
259
261
|
if ext == '.gr':
|
|
260
262
|
x, y = read_gr_file(fpath); e = None
|
|
@@ -281,8 +283,9 @@ def batch_process(directory: str, args):
|
|
|
281
283
|
elif ext in ('.brml', '.xrdml', '.rasx') or (ext == '.raw' and is_bruker_raw(fpath)):
|
|
282
284
|
x, y, e, wl_from_file = read_xrd_vendor_file(fpath)
|
|
283
285
|
axis_mode = '2theta'
|
|
284
|
-
if
|
|
285
|
-
args.wl
|
|
286
|
+
if file_wl is None and wl_from_file is not None:
|
|
287
|
+
# Per-file wavelength only — do not mutate shared args.wl
|
|
288
|
+
file_wl = wl_from_file
|
|
286
289
|
elif ext == '.raw':
|
|
287
290
|
# .raw from non-Bruker instrument: load as generic text
|
|
288
291
|
data = robust_loadtxt_skipheader(fpath)
|
|
@@ -374,12 +377,12 @@ def batch_process(directory: str, args):
|
|
|
374
377
|
|
|
375
378
|
# Convert to Q if needed
|
|
376
379
|
if axis_mode == 'Q' and ext not in ('.qye', '.gr', '.nor'):
|
|
377
|
-
if
|
|
380
|
+
if file_wl is None:
|
|
378
381
|
axis_mode = '2theta'
|
|
379
382
|
x_plot = x
|
|
380
383
|
else:
|
|
381
384
|
theta_rad = np.radians(x/2)
|
|
382
|
-
x_plot = 4*np.pi*np.sin(theta_rad)/
|
|
385
|
+
x_plot = 4*np.pi*np.sin(theta_rad)/file_wl
|
|
383
386
|
else:
|
|
384
387
|
x_plot = x
|
|
385
388
|
|
|
@@ -704,6 +707,10 @@ def batch_process_ec(directory: str, args):
|
|
|
704
707
|
x_label = r'Specific Capacity (mAh g$^{-1}$)'
|
|
705
708
|
else:
|
|
706
709
|
raise ValueError(f"Unsupported file type for GC: {ext}")
|
|
710
|
+
|
|
711
|
+
cap_x, x_label, _cum_gc = apply_gc_capacity_mode(
|
|
712
|
+
args, cap_x, charge_mask, discharge_mask, x_label
|
|
713
|
+
)
|
|
707
714
|
|
|
708
715
|
# Plot cycles
|
|
709
716
|
if cycle_numbers is not None:
|
|
@@ -756,6 +763,7 @@ def batch_process_ec(directory: str, args):
|
|
|
756
763
|
ax_b.set_title(f"{fname}")
|
|
757
764
|
legend = ax_b.legend(loc='best', fontsize='small', framealpha=0.8, title='Cycle')
|
|
758
765
|
sync_legend_title_fontsize(legend)
|
|
766
|
+
stamp_gc_capacity_mode(fig_b, cumulative=_cum_gc)
|
|
759
767
|
|
|
760
768
|
# ---- CV Mode ----
|
|
761
769
|
elif mode == 'cv':
|