Skip to content
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

TSP environment cleanup #328

Merged
merged 16 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading