Skip to content

Commit

Permalink
Merging from master
Browse files Browse the repository at this point in the history
  • Loading branch information
vallis committed May 17, 2023
2 parents 994382f + 5ef5ff4 commit 3ad5205
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 21 deletions.
12 changes: 8 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ max-line-length = 120
max-complexity = 45
ignore =
E203
W503 # line break before binary operator; conflicts with black
E722 # bare except ok
E731 # lambda expressions ok
# line break before binary operator; conflicts with black
W503
# bare except ok
E722
# lambda expressions ok
E731
exclude =
.git
.tox
Expand All @@ -14,4 +17,5 @@ exclude =
dist
docs
.enterprise
enterprise/src
enterprise/src
.venv
14 changes: 7 additions & 7 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install non-python dependencies on mac
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Test with pytest
run: make test
- name: Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
#with:
# fail_ci_if_error: true

Expand All @@ -65,9 +65,9 @@ jobs:
if: github.event_name == 'release'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install non-python dependencies on linux
Expand Down Expand Up @@ -111,9 +111,9 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install dependencies
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ target/

# virtual environment
.enterprise
# standard-ish virtual environment for VSCode
.venv

# vscode
.vscode
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: black
args: ["--config=pyproject.toml", "--check"]
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: "3.7.7"
hooks:
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
line-length = 120
target_version = ['py38']
include = '\.pyi?$'
exclude = '''
extend-exclude = '''
(
/(
Expand Down
16 changes: 8 additions & 8 deletions tests/test_gp_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ def test_conditional_gp(self):

# build index for the global coefficient vector
idx, ntot = {}, 0
for l, v in cmean.items():
idx[l] = slice(ntot, ntot + len(v))
for c_name, v in cmean.items():
idx[c_name] = slice(ntot, ntot + len(v))
ntot = ntot + len(v)

# repeat the computation using the common-signal formalism
Expand All @@ -318,8 +318,8 @@ def test_conditional_gp(self):

# check mean values
msg = "Conditional GP coefficient value does not match"
for l, v in cmean.items():
assert np.allclose(mn[idx[l]], v, atol=1e-4, rtol=1e-4), msg
for c_name, v in cmean.items():
assert np.allclose(mn[idx[c_name]], v, atol=1e-4, rtol=1e-4), msg

# check variances
par = "B1937+21_linear_timing_model_coefficients"
Expand Down Expand Up @@ -360,8 +360,8 @@ def test_conditional_gp(self):
cmean = c.get_mean_coefficients(p0)

idx, ntot = {}, 0
for l, v in cmean.items():
idx[l] = slice(ntot, ntot + len(v))
for c_name, v in cmean.items():
idx[c_name] = slice(ntot, ntot + len(v))
ntot = ntot + len(v)

TNrs = pta.get_TNr(p0)
Expand All @@ -375,8 +375,8 @@ def test_conditional_gp(self):
mn = ch(TNr)

msg = "Conditional GP coefficient value does not match for common GP"
for l, v in cmean.items():
assert np.allclose(mn[idx[l]], v)
for c_name, v in cmean.items():
assert np.allclose(mn[idx[c_name]], v)


class TestGPCoefficientsPint(TestGPCoefficients):
Expand Down

0 comments on commit 3ad5205

Please sign in to comment.