Skip to content

Conversation

@bkeryan
Copy link
Collaborator

@bkeryan bkeryan commented May 8, 2025

What does this Pull Request accomplish?

Create the ComplexWaveform class to support complex-number waveforms:

  • Extract most of AnalogWaveform into an abstract base class, NumericWaveform (as opposed to DigitalWaveform)
  • Rename existing type variable to _TRaw_co
  • Add a second type variable to NumericWaveform, _TScaled_co. For AnalogWaveform, _TScaled_co=np.float64 and for ComplexWaveform, _TScaled_co=np.complex128.
  • Add an abstract helper method to handle ComplexInt32DType conversion.

Why should this Pull Request be merged?

Closes AB#3066698 - Define Python complex waveform data types

What testing has been done?

Ran poetry run nps lint, mypy, pytest -v

@bkeryan bkeryan requested a review from csjall as a code owner May 8, 2025 01:04
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2025

Test Results

   10 files  ±  0     10 suites  ±0   30s ⏱️ +3s
  573 tests + 41    573 ✅ + 41  0 💤 ±0  0 ❌ ±0 
5 730 runs  +410  5 730 ✅ +410  0 💤 ±0  0 ❌ ±0 

Results for commit eaa1342. ± Comparison against base commit b20757f.

This pull request removes 1 and adds 42 tests. Note that renamed tests count towards both.
tests.unit.waveform.test_analog_waveform ‑ test___sample_count_and_unsupported_dtype___create___raises_type_error
tests.unit.complex.test_dtypes ‑ test___duplicate_structured_dtype___equality___equal
tests.unit.complex.test_dtypes ‑ test___structured_dtype_str___equality___not_equal
tests.unit.complex.test_dtypes ‑ test___unknown_structured_dtype___equality___not_equal
tests.unit.waveform._scaling.test_linear ‑ test___complex128_ndarray___transform_data___returns_complex128_scaled_data
tests.unit.waveform._scaling.test_linear ‑ test___complex64_ndarray___transform_data___returns_complex64_scaled_data
tests.unit.waveform._scaling.test_none ‑ test___complex128_ndarray___transform_data___returns_complex128_scaled_data
tests.unit.waveform._scaling.test_none ‑ test___complex64_ndarray___transform_data___returns_complex64_scaled_data
tests.unit.waveform.test_analog_waveform ‑ test___dtype_str_with_traw_hint___create___narrows_traw
tests.unit.waveform.test_analog_waveform ‑ test___dtype_str_with_unsupported_traw_hint___create___mypy_type_var_warning
tests.unit.waveform.test_analog_waveform ‑ test___sample_count_and_unsupported_dtype___create___raises_type_error[complex128]
…

♻️ This comment has been updated with latest results.

@bkeryan bkeryan force-pushed the users/bkeryan/complex-waveform branch from f0c5d13 to 8cf6863 Compare May 8, 2025 22:25
@bkeryan bkeryan requested a review from csjall May 9, 2025 17:32
@bkeryan bkeryan merged commit 13cbe86 into main May 9, 2025
14 checks passed
@bkeryan bkeryan deleted the users/bkeryan/complex-waveform branch May 9, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants