fossasia / fossasia/pslab-python

Clarify and document CTMU temperature calibration logic

Open
#272 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.6k
Forks
242
PR merge metrics
No merged PRs in 30d

Description

### Background
`ScienceLab.temperature` (in `pslab/sciencelab.py`) currently contains several hardware-specific numeric
constants related to CTMU current selection, ADC channels, and unit conversions.

While refactoring to remove inline "magic numbers", it became clear that some
constants require clearer naming or documentation to avoid ambiguity.

### Problem
- Calibration logic relies on numeric values whose meaning and units are not explicit
- Naming ambiguity between "current source" and CTMU current range/index values
- Lack of documentation makes calibration behavior harder to audit, verify, or modify safely

This ambiguity makes the calibration logic harder to validate and reason about.

### Expected Outcome
- Calibration parameters centralized and clearly named
- Remaining constants documented with purpose and units
- Behavior remains identical to the current implementation

### Scope
- No behavioral change
- Refactor and documentation only

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.