Skip to content

Commit

Permalink
modified pre-commit hooks and ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienWehrle committed Dec 2, 2024
1 parent 28efb63 commit 9677f99
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
'--ignore-regex', '\bnin\b',
'--'
]
types_or: [python, markdown] # rst,
types_or: [python, markdown] # rst,
files: ^(snowlaps|tests)/ # docs

# Replace relative imports
Expand All @@ -32,11 +32,11 @@ repos:
# Run the linter.
- id: ruff
types_or: [ python, pyi ]
args: ["check", "--fix" ]
args: ["--fix" ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi ]

# Format the code aggressively using black
- repo: https://github.com/psf/black
rev: 24.10.0
Expand Down
13 changes: 9 additions & 4 deletions app/pages/2_Snowlaps_inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ def change_input():
st.session_state.spectrum = spectrum


if st.button("Run inversion") and "inv" not in st.session_state and uploaded_data is not None and uploaded_metadata is not None:
with st.spinner("Please wait..."):
best_optimization_results = run_model()
st.session_state.inv = True
if (
st.button("Run inversion")
and "inv" not in st.session_state
and uploaded_data is not None
and uploaded_metadata is not None
):
with st.spinner("Please wait..."):
best_optimization_results = run_model()
st.session_state.inv = True


st.markdown(
Expand Down
1 change: 0 additions & 1 deletion examples/snowlaps_ex03_compare_with_biosnicar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"""


import matplotlib.pyplot as plt
import numpy as np
from biosnicar.adding_doubling_solver import adding_doubling_solver
Expand Down
18 changes: 18 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is auto-generated from dev-environment.yml, do not modify.
# See that file for comments about the need/usage of each dependency.

numpy
pandas
tensorflow
pysolar
pytz
timezonefinder
scikit-learn
streamlit
plotly
pip
flake8
pytest
pytest-lazy-fixture
pylint
pre-commit
6 changes: 3 additions & 3 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# let Black deal with line length, Ruff currently doesn't autofix E501
ignore = ["E501", "B006"]

[lint]

select = [
# pycodestyle
"E",
Expand All @@ -17,3 +15,5 @@ select = [
"I",
]

# let Black deal with line length, Ruff currently doesn't autofix E501
ignore = ["E501", "B006"]

0 comments on commit 9677f99

Please sign in to comment.