add save/load for impedance, add save/load tests for scope and impedance#20
add save/load for impedance, add save/load tests for scope and impedance#20gituser789 merged 18 commits intomainfrom
Conversation
SevenOfNinePE
left a comment
There was a problem hiding this comment.
Beside this an empty list is also used as valid input (minimum for scope-module, maybe also for impedance module.)
Change of unit test can be done later. In this case an issue shall be generated.
tests/test_impedance.py
Outdated
| def test_save_load(): | ||
| """Unit test for save and load.""" | ||
| # assumption: the given scope object is valid | ||
| example = pss.Impedance.generate_impedance_object([1, 2, 3], [4, 5, 6], |
There was a problem hiding this comment.
Better is to use a scope object with mixed data to check, if the different types of data and numbers (Positiv and negative integer and float values) are stored and reload correctly.
E.g. [0.1,1,1.2,2.1,3], [0,5.1,1.2,2.1,3], phase: [-4,-5.9,0,6,1.2]
Assumption: Frequency and impedance values shall be only positive, phase values are float or int?
| ch_1 = pss.Impedance.generate_impedance_object([1, 2, 3], [4, 5, 6], [7, 8, 9], | ||
| channel_unit="A", channel_label="label", channel_color="red", | ||
| channel_source="source", channel_linestyle='--') | ||
| ch_2 = pss.Impedance.copy(ch_1) |
There was a problem hiding this comment.
Similar approach also here. Use different types of data and numbers (Positiv and negative integer and float values) are stored and reload correctly.
E.g. [0.1,1,1.2,2.1,3], [0,5.1,1.2,2.1,3], phase: [-4,-5.9,0,6,1.2]
Assumption: Frequency and impedance values shall be only positive, phase values are float or int?
|
Done: Check for empty time/data (scope) and frequency/impedance/phase (Impedance) |
Scope added:
generate_scope_object()copy(): added type check and unit testadd/subtract/abs/absmean/rms/save()/load()__, as discussed.Impedance added:
save()/load()/generate_impedance_object()copy(): added type check and unit testBugfix as mentioned above
