ism330dl: Rename temperature_c() to temperature() for convention.#211
ism330dl: Rename temperature_c() to temperature() for convention.#211
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Renames the ISM330DL driver temperature method to align with the repository-wide driver API convention (no unit suffix for SI-based temperature readings).
Changes:
- Renamed
ISM330DL.temperature_c()toISM330DL.temperature(). - Updated examples and documentation to call
temperature(). - Updated YAML scenario tests that referenced the old method name.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/ism330dl/ism330dl/device.py | Renames the public temperature API to match conventions. |
| lib/ism330dl/examples/basic_read.py | Updates example usage to the renamed method. |
| lib/ism330dl/README.md | Updates driver README examples/API references to temperature(). |
| tests/scenarios/ism330dl.yaml | Updates scenario calls/scripts to use temperature(). |
| tests/scenarios/board_temperature_comparison.yaml | Updates temperature comparison scenario to use temperature(). |
| lib/steami_config/examples/calibrate_temperature.py | Updates ISM330DL method entry used by calibration example. |
| README.md | Updates top-level quick-start snippet to use temperature(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def temperature(self): | ||
| factory = TEMP_OFFSET + self.temperature_raw() / TEMP_SENSITIVITY | ||
| return self._temp_gain * factory + self._temp_offset | ||
|
|
There was a problem hiding this comment.
Renaming temperature_c() to temperature() is a breaking API change for downstream users. Consider keeping a temperature_c() wrapper (deprecated) that forwards to temperature() for at least one release cycle, or document the breaking change prominently in the driver README/root README changelog section if you intentionally want a hard break.
| def temperature_c(self): | |
| """Deprecated: use `temperature()` instead.""" | |
| return self.temperature() |
|
Re: Copilot suggestion (deprecated wrapper) No backward-compatibility alias needed — the project has no published release yet. This was decided during issue #82 (snake_case migration): deprecated wrappers are not kept since no external code depends on the old names. The rename is documented in the PR description and the driver README. |
|
🎉 This PR is included in version 0.0.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #210
Summary
Rename
temperature_c()totemperature()in the ISM330DL driver to follow the project convention: no unit suffix for SI units (°C for temperature, %RH for humidity).Changes
lib/ism330dl/ism330dl/device.pylib/ism330dl/examples/basic_read.pylib/ism330dl/README.mdtests/scenarios/ism330dl.yamltests/scenarios/board_temperature_comparison.yamllib/steami_config/examples/calibrate_temperature.pyREADME.mdVerification
ruff checkpassestemperature_cmethod calls (only local variable names in other drivers, which are unrelated)