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

Add pre-commit config to repo to automatically clean notebook outputs on commit. #248

Merged
merged 4 commits into from
Jan 9, 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
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/srstevenson/nb-clean.git
rev: 3.2.0
hooks:
- id: nb-clean
name: nb-clean
entry: nb-clean clean
language: python
types_or: [jupyter]
minimum_pre_commit_version: 2.9.2
# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v4.5.0 # Use the ref you want to point at
# hooks:
# - id: trailing-whitespace
# - repo: https://github.com/nbQA-dev/nbQA
# rev: 1.7.1
# hooks:
# - id: nbqa-ruff
# name: nbqa-ruff
# entry: nbqa ruff
# language: python
# types_or: [jupyter]
# minimum_pre_commit_version: 2.9.2
592 changes: 245 additions & 347 deletions examples/at_array_as_sensor/at_array_as_sensor.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/at_array_as_sensor/at_array_as_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def main():
ax.set_yticks([])

# Plot recorded sensor data
fig, (ax1, ax2)= plt.subplots(ncols=1, nrows=2)
fig, [ax1, ax2] = plt.subplots(ncols=1, nrows=2)
ax1.imshow(sensor_data_point, aspect='auto')
ax1.set_xlabel(r'Time [$\mu$s]')
ax1.set_ylabel('Detector Number')
Expand Down
Loading
Loading