python-dts-calibration icon indicating copy to clipboard operation
python-dts-calibration copied to clipboard

CLI access to dtscalibration

Open BSchilperoort opened this issue 2 years ago • 2 comments

It could be nice to be able to run the calibration routines using a command line interface.

The calibration configuration could be specified in a yaml configuration file, for example:

name: "test_setup"
calibration-configuration:
    mode: "double-ended"
    align_channels: true
    sections:
        warm_bath:
            sensor: "Pt100_1"
            start: 10.50
            end: 21.15
        cold_bath:
            sensor: "Pt100_2"
            start: 25.60
            end: 35.45

BSchilperoort avatar Aug 11 '23 14:08 BSchilperoort

Could we use hatch for this, such that we don't have to worry about the environment?

bdestombe avatar Oct 20 '23 08:10 bdestombe

This is more of a suggestion of a way to make a dtscalibration CLI, not on how to run it.

A CLI tool is quite easily configured in pyproject.toml, and can then be started by using any of the following commands (where site1-recipe.yml is the name of the yaml recipe file):

dtscalibration site1-recipe.yml
python -m dtscalibration site1-recipe.yml
hatch run dtscalibration site1-recipe.yml

But the goal of a calibration "recipe" and command line access it to allow for a clearly defined calibration routine that is easier to share/reuse and understand than python code.

This could be quite useful in a more permanent measurement setup, or some other professional monitoring environment. The routine could then also generate, for example, calibration validation plots and other statistics along with the calibrated temperatures.

BSchilperoort avatar Oct 23 '23 07:10 BSchilperoort