Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure datatype handling is stable when converting back and forth #114

Open
kbabioch opened this issue Jul 11, 2023 · 1 comment
Open

Ensure datatype handling is stable when converting back and forth #114

kbabioch opened this issue Jul 11, 2023 · 1 comment
Labels
datatype Internal handling of data received from and sent to the Luxtronik controller. good first issue Good for newcomers unit-testing Issues related to unit testing.

Comments

@kbabioch
Copy link
Collaborator

kbabioch commented Jul 11, 2023

Currently there seem to be some instabilities when converting data back and forth:

luxtronik.datatypes.Celsius.from_heatpump(luxtronik.datatypes.Celsius.to_heatpump(0.11))
0.1

This should be double-checked for all datatypes. Ideally there should be some automated unit tests for these cases. Also this should be fixed, potentially by using round() or similar approaches.

@kbabioch kbabioch added datatype Internal handling of data received from and sent to the Luxtronik controller. good first issue Good for newcomers unit-testing Issues related to unit testing. labels Jul 11, 2023
@gerw
Copy link
Collaborator

gerw commented Jul 12, 2023

In my opinion, only to_heatpump(from_heatpump(...)) should be stable (for reasonable inputs). If we know, what "reasonable" inputs are (by adding, e.g., something like max, min and step variables to the datatype classes, see also #35), such a unit test could be implemented easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datatype Internal handling of data received from and sent to the Luxtronik controller. good first issue Good for newcomers unit-testing Issues related to unit testing.
Projects
None yet
Development

No branches or pull requests

2 participants