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

MAINT: Update testing (use Black, Ruff, precommit hook) #140

Merged
merged 18 commits into from
Sep 15, 2023
Merged

MAINT: Update testing (use Black, Ruff, precommit hook) #140

merged 18 commits into from
Sep 15, 2023

Conversation

scott-huberty
Copy link
Member

@scott-huberty scott-huberty commented Sep 1, 2023

Time to tighten up the screws. Let's see what breaks.

  • Reconfigure style job to make sure we are testing our whole codebase.
  • Tests should fail on warnings so that we can catch and resolve them before they become errors.
  • Use black to autoformat code (88 characters allowed, yay!)
  • Swap out Flake8 for Ruff (built on Rust so a bit faster, allows 88 chars, and integrated with black)
  • add a precommit hook (catch style issues before pushing to open PR's).
  • Big picture: This should relieve us from having to manually manage all those pesky flake errors.

scott-huberty and others added 15 commits April 30, 2023 21:46
- Use black to autoformat code
- swap out flake8 for Ruff for linting
- add precommit hook to test for style errors before commiting or pushing
- add a pyproject toml file to configure black, ruff, codespell, etc
- update github workflows style test
- Black has now autoformatted all files
- and remaining flakes have been fixed
- use mne.util. warn to accurately raise warnings
cleaned up, and dropped low correlation assertion for now. commented the github issue number for reference
there is deprecation warning stemming from dash-testing that they need to handle.
trying to ignore the dash testing deprecation warning for now
right now we only test on one OS. In principle we should test with ubuntu, macos, and windows.

But lets start with mac so that the testing runner matches the OS that the local devs use
in test_simulated really only EEG 001 and EEG 002 should be flagged because we make them noisy
- there is some error in test_topoViz that needs to be looked into in separate PR
the test_simulated file is very short, approx 20 seconds. So a few epochs with blinks will be outliers and accont for more
than 20 percent of total epochs, causing the channel to be flagged. Raise the flag_crit to 30 percent to be more liberal so that blinks in a channel to cause it to be flagged
@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #140 (c257c0e) into main (4db5348) will increase coverage by 54.97%.
Report is 4 commits behind head on main.
The diff coverage is 77.68%.

@@             Coverage Diff             @@
##             main     #140       +/-   ##
===========================================
+ Coverage   22.65%   77.63%   +54.97%     
===========================================
  Files           7       12        +5     
  Lines         565      921      +356     
===========================================
+ Hits          128      715      +587     
+ Misses        437      206      -231     
Files Changed Coverage Δ
pylossless/bids.py 18.75% <40.00%> (ø)
pylossless/flagging.py 64.28% <40.00%> (+33.73%) ⬆️
pylossless/config.py 90.90% <66.66%> (+45.45%) ⬆️
pylossless/pipeline.py 72.70% <70.93%> (+54.11%) ⬆️
pylossless/dash/topo_viz.py 83.69% <84.21%> (ø)
pylossless/_logging.py 97.50% <100.00%> (+65.00%) ⬆️
pylossless/_utils.py 100.00% <100.00%> (+73.33%) ⬆️
pylossless/dash/__init__.py 100.00% <100.00%> (ø)
pylossless/dash/css_defaults.py 100.00% <100.00%> (ø)
pylossless/dash/tests/conftest.py 100.00% <100.00%> (ø)
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@scott-huberty scott-huberty merged commit b665f8a into lina-usc:main Sep 15, 2023
5 checks passed
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.

1 participant