Skip to content

add save/load for impedance, add save/load tests for scope and impedance#20

Merged
gituser789 merged 18 commits intomainfrom
save_load
Dec 6, 2024
Merged

add save/load for impedance, add save/load tests for scope and impedance#20
gituser789 merged 18 commits intomainfrom
save_load

Conversation

@gituser789
Copy link
Contributor

@gituser789 gituser789 commented Dec 5, 2024

Scope added:

  • bug fixed when generating new scope object: Must use generate_scope_object()
  • copy(): added type check and unit test
  • Add unit test: add / subtract / abs / absmean / rms / save() / load()
  • Code refactoring regarding all names of the module
  • bug fixed for empty legend (see figure)
  • eq() method including unit tests
  • internal functions starting with __, as discussed.

Impedance added:

  • Add save/load method
  • Add unit tests: save() / load() / generate_impedance_object()
  • copy(): added type check and unit test
  • Code refactoring regarding all names of the module
  • eq() method including unit tests

Bugfix as mentioned above
image

@gituser789 gituser789 self-assigned this Dec 5, 2024
@gituser789 gituser789 added the enhancement New feature or request label Dec 5, 2024
@gituser789 gituser789 added this to the 0.2.0 milestone Dec 5, 2024
Copy link
Collaborator

@SevenOfNinePE SevenOfNinePE left a 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.

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],
Copy link
Collaborator

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?

Copy link
Contributor Author

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)
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@gituser789
Copy link
Contributor Author

Done: Check for empty time/data (scope) and frequency/impedance/phase (Impedance)

@gituser789 gituser789 linked an issue Dec 6, 2024 that may be closed by this pull request
@gituser789 gituser789 merged commit 5d987a1 into main Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests, update docu, ...

2 participants