-
Notifications
You must be signed in to change notification settings - Fork 0
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
add save/load for impedance, add save/load tests for scope and impedance #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
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
