Skip to content

Commit

Permalink
bump black ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipVinc committed Nov 8, 2023
1 parent d9aa54b commit dc73f10
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/formatting_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Pip install python dependencies
run: |
python -m pip install --upgrade pip
pip install -v black==23.7.0
pip install -v black==23.10.1
- name: Black Code Formatter
run: black --check --diff --color .
Expand All @@ -44,6 +44,6 @@ jobs:
- name: Set up Python 3.10
uses: chartboost/ruff-action@v1
with:
version: 0.0.287
version: 0.1.4
args: --config pyproject.toml
src: netket test Examples
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

@partial(jax.vmap, in_axes=(0, None, None, None), out_axes=(0))
def spwf(sigma, orbital_up, orbital_down, N):

return 0.5 * (1 + sigma) * orbital_up + 0.5 * (1 - sigma) * orbital_down


Expand Down
8 changes: 3 additions & 5 deletions examples/state_learning/state_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@

# or just use the Infidelity optimisation driver
optimizer = nk.optimizer.Adam()
driver = nkf.driver.InfidelityOptimizer(
vs_target, optimizer, variational_state=vs
)
driver = nkf.driver.InfidelityOptimizer(vs_target, optimizer, variational_state=vs)

log = nk.logging.RuntimeLog()
driver.run(300, out=log)

plt.ion()
plt.semilogy(log.data['Infidelity'].iters, log.data['Infidelity'])
plt.show()
plt.semilogy(log.data["Infidelity"].iters, log.data["Infidelity"])
plt.show()
4 changes: 2 additions & 2 deletions netket_fidelity/driver/infidelity_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
U_dagger=None,
preconditioner: PreconditionerT = identity_preconditioner,
is_unitary=False,
sample_Upsi=False,
sample_Upsi=False,
cv_coeff=-0.5,
):
r"""
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(
U_dagger=U_dagger,
is_unitary=is_unitary,
cv_coeff=cv_coeff,
sample_Upsi=sample_Upsi,
sample_Upsi=sample_Upsi,
)

def _forward_and_backward(self):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ dev = [
"pytest-json-report>=1.3",
"coverage>=5",
"pre-commit>=2.7",
"black==23.7.0",
"ruff==0.0.287",
"black==23.10.1",
"ruff==0.1.4",
"wheel",
"build",
"qutip",
Expand Down

0 comments on commit dc73f10

Please sign in to comment.