Skip to content

Commit

Permalink
Merge remote-tracking branch 'echemdb/main' into find_extrema
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxrider committed Sep 28, 2022
2 parents ab43092 + b8b3873 commit c23bcbc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Lint
on:
push: { branches: [ "master" ] }
pull_request: { branches: [ "master" ] }
push: { branches: [ "main" ] }
pull_request: { branches: [ "main" ] }

concurrency:
group: lint-${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test
on:
push: { branches: [ "master" ] }
pull_request: { branches: [ "master" ] }
push: { branches: [ "main" ] }
pull_request: { branches: [ "main" ] }

concurrency:
group: test-${{ github.ref }}
Expand Down
8 changes: 4 additions & 4 deletions ec_tools/semi_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def semi_integration(y, q=-0.5, delta_x=1, c1=8, c2=2):
TEST:
>>> from scipy.integrate import cumulative_trapezoid
>>> x = np.linspace(0,1000, 1001)
>>> Δx = x[1] - x[0]
>>> delta_x = x[1] - x[0]
>>> y = np.array([1]*1001)
>>> np.allclose(semi_integration(semi_integration(y, delta_x=Δx), Δx=Δx), cumulative_trapezoid(y,x,initial=0), rtol=2.5e-03)
>>> np.allclose(semi_integration(semi_integration(y, delta_x=delta_x), delta_x=delta_x), cumulative_trapezoid(y,x,initial=0), rtol=2.5e-03)
True
>>> x = np.linspace(0,1000, 10001)
>>> Δx = x[1] - x[0]
>>> delta_x = x[1] - x[0]
>>> y = np.array([1]*10001)
>>> np.allclose(semi_integration(semi_integration(y, delta_x=Δx), Δx=Δx), cumulative_trapezoid(y,x,initial=0), rtol=5e-03)
>>> np.allclose(semi_integration(semi_integration(y, delta_x=delta_x), delta_x=delta_x), cumulative_trapezoid(y,x,initial=0), rtol=5e-03)
True
"""
N = y.size
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dependencies:
- pylint
- pytest
- pytest-doctestplus
- scipy

0 comments on commit c23bcbc

Please sign in to comment.