Skip to content

Commit

Permalink
Merge pull request #3192 from arjxn-py/add-more-precommits
Browse files Browse the repository at this point in the history
Add more precommits
  • Loading branch information
Saransh-cpp authored Aug 4, 2023
2 parents 35fd252 + a974eda commit 8662763
Show file tree
Hide file tree
Showing 117 changed files with 219 additions and 250 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
0054efe388d2d17301f7e0554449eac9a7d3b7fc
# activated pre-commit for notebooks - https://github.com/pybamm-team/PyBaMM/pull/3110
a63e49ece0f9336d1f5c2562f7459e555c6e6693
# activated standard pre-commits - https://github.com/pybamm-team/PyBaMM/pull/3192
5273214b585c5a4286609aed40e0b092d0e05f42
4 changes: 2 additions & 2 deletions .github/workflows/lychee_url_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:

# cache Lychee results to avoid hitting rate limits
# cache Lychee results to avoid hitting rate limits
- name: Restore lychee cache
uses: actions/cache@v3
with:
Expand All @@ -42,7 +42,7 @@ jobs:
--exclude https://twitter.com/pybamm_
--exclude "https://doi\.org|www.sciencedirect\.com/*"
--accept 200,429
--exclude-path ./CHANGELOG.md
--exclude-path ./CHANGELOG.md
--exclude-path ./scripts/update_version.py
'./**/*.rst'
'./**/*.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/need_reply_remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
issue: ${{ github.event.issue.number }}
label: needs-reply
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/needs_reply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: needs-reply
issue-label: needs-reply
8 changes: 4 additions & 4 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Run all unit tests and integration tests for all Python versions
# Run all unit tests and integration tests for all Python versions
# and platforms at 3am UTC every day and on PRs to the main branch
name: Scheduled

on:
workflow_dispatch:
pull_request:
branches:
branches:
- main

# Run everyday at 3 am UTC
Expand Down Expand Up @@ -119,13 +119,13 @@ jobs:
build-apple-mseries:
needs: style
runs-on: [self-hosted, macOS, ARM64]
env:
env:
GITHUB_PATH: ${PYENV_ROOT/bin:$PATH}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Install python & create virtualenv
Expand Down
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ repos:
hooks:
- id: blacken-docs
additional_dependencies: [black==22.12.0]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-type-ignore
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(NOT PYBIND11_DIR)
endif()

add_subdirectory(${PYBIND11_DIR})
pybind11_add_module(idaklu
pybind11_add_module(idaklu
pybamm/solvers/c_solvers/idaklu/casadi_functions.cpp
pybamm/solvers/c_solvers/idaklu/casadi_functions.hpp
pybamm/solvers/c_solvers/idaklu/casadi_solver.cpp
Expand All @@ -56,7 +56,7 @@ if (NOT DEFINED USE_PYTHON_CASADI)
endif()

execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
COMMAND "${PYTHON_EXECUTABLE}" -c
"import casadi as _; print(_.__path__[0])"
OUTPUT_VARIABLE CASADI_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -67,7 +67,7 @@ endif()
message("Found python casadi path: ${CASADI_DIR}")

if(${USE_PYTHON_CASADI})
message("Trying to link against python casadi package")
message("Trying to link against python casadi package")
find_package(casadi CONFIG PATHS ${CASADI_DIR} REQUIRED)
else()
message("Trying to link against any casadi package apart from the python one")
Expand All @@ -78,7 +78,7 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
# Sundials
find_package(SUNDIALS REQUIRED)
message("sundials ${SUNDIALS_INCLUDE_DIR} ${SUNDIALS_LIBRARIES}")
message("sundials ${SUNDIALS_INCLUDE_DIR} ${SUNDIALS_LIBRARIES}")
target_include_directories(idaklu PRIVATE ${SUNDIALS_INCLUDE_DIR})
target_link_libraries(idaklu PRIVATE ${SUNDIALS_LIBRARIES} casadi)

Expand Down
3 changes: 1 addition & 2 deletions FindSuiteSparse.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This CMakeFile is adapted from that in dune-common:
# This CMakeFile is adapted from that in dune-common:

# .. cmake_module::
#
Expand Down Expand Up @@ -239,4 +239,3 @@ endif()
#set HAVE_SUITESPARSE for config.h
set(HAVE_SUITESPARSE ${SuiteSparse_FOUND})
set(HAVE_UMFPACK ${SuiteSparse_UMFPACK_FOUND})

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pay for developer time, professional services, travel, workshops, and a variety

<div align="center">
<a href="https://numfocus.org/project/pybamm">
<img height="60px"
src="https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png"
<img height="60px"
src="https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png"
align="center">
</a>
</div>
Expand Down
1 change: 0 additions & 1 deletion benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion build_manylinux_wheels/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ RUN chmod +x /entrypoint.sh

RUN ./install_sundials.sh

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
1 change: 0 additions & 1 deletion build_manylinux_wheels/install_sundials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ cmake -DENABLE_LAPACK=ON\
-DCMAKE_INSTALL_PREFIX=/usr\
../$SUNDIALS_DIR
make install

1 change: 0 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

42 changes: 21 additions & 21 deletions docs/_static/index-images/api.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8662763

Please sign in to comment.