Skip to content

Commit

Permalink
TSP environment cleanup (#328)
Browse files Browse the repository at this point in the history
* fix: perform garbage collection of TSP environment on cleanup.

* Update CHANGELOG.md

Co-authored-by: Nicholas Felt <nicholas.felt@tektronix.com>
Signed-off-by: Luke <111022789+ldantek@users.noreply.github.com>

---------

Signed-off-by: Luke <111022789+ldantek@users.noreply.github.com>
Co-authored-by: Nicholas Felt <nicholas.felt@tektronix.com>
  • Loading branch information
ldantek and nfelt14 authored Oct 22, 2024
1 parent fb29ac3 commit a1477c3
Show file tree
Hide file tree
Showing 37 changed files with 49 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Valid subsections within a version are:

Things to be included in the next release go here.

### Added

- `collectgarbage()` is now called during cleanup of `TSPDevice` children.

---

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ def load_script(
################################################################################################
# Private Methods
################################################################################################

def _cleanup(self) -> None:
"""Perform the cleanup defined for the device."""
PIDevice._cleanup(self) # noqa: SLF001
11 changes: 7 additions & 4 deletions src/tm_devices/drivers/pi/tsp_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ def write_buffers(self, filepath: str, *args: str, sep: str = ",") -> None:
)
self.export_buffers(filepath, *args, sep=sep)


################################################################################################
# Private Methods
################################################################################################
################################################################################################
# Private Methods
################################################################################################
def _cleanup(self) -> None:
"""Perform the cleanup defined for the device."""
super()._cleanup()
self.write("collectgarbage()")
1 change: 1 addition & 0 deletions tests/sim_devices/daq/daq6510.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/dmm/dmm6500.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/dmm/dmm7510.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/dmm/dmm7512.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2450.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2460.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ devices:
- q: status.clear()
- q: reset()
- q: smu.source.sweeplinear("SolarCell", 0, 0.53, 56, 0.1)
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2461.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2470.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ devices:
- q: eventlog.clear()
- q: status.clear()
- q: reset()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2601a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2601b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
- q: status.node_enable = 1
- q: print(status.node_enable)
r: 1
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2601b_pulse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2602a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2602b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2604a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2604b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2606b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2611a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2611b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2612a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2612b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2614a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2614b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2634a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2634b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2635a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2635b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2636a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2636b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2651a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu2657a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu6430.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ devices:
r: '1'
- q: '*RST'
- q: '*CLS'
- q: collectgarbage()
error:
status_register:
- q: '*ESR?'
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu6514.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ devices:
r: '1'
- q: '*RST'
- q: '*CLS'
- q: collectgarbage()
error:
status_register:
- q: '*ESR?'
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/smu/smu6517b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ devices:
r: '1'
- q: '*RST'
- q: '*CLS'
- q: collectgarbage()
error:
status_register:
- q: '*ESR?'
Expand Down
1 change: 1 addition & 0 deletions tests/sim_devices/ss/ss3706a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ devices:
- q: print([[0]])
r: 0
- q: waitcomplete()
- q: collectgarbage()
error:
status_register:
- q: print(status.standard.event)
Expand Down

0 comments on commit a1477c3

Please sign in to comment.