dtscalibration / python-dts-calibration

A Python package to load raw Distributed Temperature Sensing (DTS) files, perform a calibration, and plot the result.
https://python-dts-calibration.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
31 stars 18 forks source link

CLI access to dtscalibration #195

Open BSchilperoort opened 1 year ago

BSchilperoort commented 1 year ago

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
bdestombe commented 11 months ago

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

BSchilperoort commented 11 months ago

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.