Skip to content
Snippets Groups Projects

Guifilesignal

Merged Olle Hansson requested to merge guifilesignal into master
2 unresolved threads

Closes #168 (closed). Also fixed sizing of simulate window, though cannot be resized.

Merge request reports

Pipeline #90354 passed

Pipeline passed for ba545be2 on guifilesignal

Test coverage 76.00% (1.00%) from 7 jobs
Approval is optional

Merged by Oscar GustafssonOscar Gustafsson 2 years ago (Feb 24, 2023 4:03pm UTC)

Merge details

  • Changes merged into master with a8b79691 (commits were squashed).
  • Deleted the source branch.

Pipeline #90360 passed

Pipeline passed for a8b79691 on master

Test coverage 76.00% (1.00%) from 7 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
173
174 def __init__(self, path) -> None:
175 try:
176 data = np.loadtxt(path, dtype=complex).tolist()
177 self._data = data
178 self._len = len(data)
179 except FileNotFoundError:
180 self._window.logger.error(f"Selected input file not found.")
181
182 def __call__(self, time: int) -> complex:
183 if 0 <= time < self._len:
184 return self._data[time]
185 return 0.0
186
187 def __repr__(self) -> str:
188 return f"ZeroPad({self._data})"
  • Oscar Gustafsson
  • 165 """
    166 Signal generator that reads from file and pads a sequence with zeros.
    167
    168 Parameters
    169 ----------
    170 path : string
    171 Path to input file.
    172 """
    173
    174 def __init__(self, path) -> None:
    175 try:
    176 data = np.loadtxt(path, dtype=complex).tolist()
    177 self._data = data
    178 self._len = len(data)
    179 except FileNotFoundError:
    180 self._window.logger.error(f"Selected input file not found.")
  • Can you please add a test as well? I'll get back to where to add the file...

  • Olle Hansson added 1 commit

    added 1 commit

    • 61be4841 - Added doc and test for signalgenerator FromFile

    Compare with previous version

  • Olle Hansson added 1 commit

    added 1 commit

    • d7563eab - Forgot to add example input file

    Compare with previous version

  • Olle Hansson added 1 commit

    added 1 commit

    • 94459b19 - Added two tests and tidied the FromFile code

    Compare with previous version

  • Olle Hansson added 1 commit

    added 1 commit

    Compare with previous version

  • Olle Hansson added 17 commits

    added 17 commits

    Compare with previous version

  • Olle Hansson added 3 commits

    added 3 commits

    Compare with previous version

  • Olle Hansson added 1 commit

    added 1 commit

    Compare with previous version

  • Oscar Gustafsson approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading