Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#580)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.4](astral-sh/ruff-pre-commit@v0.2.2...v0.3.4)
- [github.com/sirosen/check-jsonschema: 0.27.3 → 0.28.1](python-jsonschema/check-jsonschema@0.27.3...0.28.1)
- [github.com/kynan/nbstripout: 0.6.1 → 0.7.1](kynan/nbstripout@0.6.1...0.7.1)

* Run `apt-get update` to resolve povray install flakiness?
* Don't specify python version in matrix for test-notebooks
* Bump uv to 0.1.27

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Hollas <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and danielhollas authored Apr 2, 2024
1 parent 8d88f97 commit 8668188
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 42 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
strategy:
matrix:
browser: [Chrome, Firefox]
python-version: ['3.10']
aiida-core-version: [2.1.2, 2.4.3] # test on the latest and the oldest supported version
fail-fast: false

Expand All @@ -38,10 +37,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'

- name: Install uv
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.1.24/uv-installer.sh | sh
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.1.27/uv-installer.sh | sh

- name: Install package test dependencies
# Notebook tests happen in the container, here we only need to install
Expand Down Expand Up @@ -101,15 +100,15 @@ jobs:
uses: actions/checkout@v4

- name: Install povray
run: sudo apt-get install povray
run: sudo apt-get update && sudo apt-get install povray

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.1.24/uv-installer.sh | sh
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.1.27/uv-installer.sh | sh

- name: Install package
# NOTE: uv (unlike pip) does not compile python to bytecode after install.
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
exclude: miscellaneous/structures

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
rev: v0.3.4
hooks:
- id: ruff-format
exclude: ^docs/.*
Expand All @@ -26,11 +26,11 @@ repos:
- id: yamlfmt

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.27.3
rev: 0.28.1
hooks:
- id: check-github-workflows

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
1 change: 1 addition & 0 deletions aiidalab_widgets_base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reusable widgets for AiiDAlab applications."""

from aiida.manage import get_profile

_WARNING_TEMPLATE = """
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/bug_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Carl Simon Adorf <[email protected]>
"""

from __future__ import annotations

import base64
Expand Down
3 changes: 2 additions & 1 deletion aiidalab_widgets_base/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Useful functions that provide access to some data. """
"""Useful functions that provide access to some data."""

import ipywidgets as ipw
import numpy as np
from ase import Atom, Atoms
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/databases.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Widgets that allow to query online databases."""

import re

import ase
Expand Down
6 changes: 3 additions & 3 deletions aiidalab_widgets_base/elns.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ def _observe_node(self, _=None):

def send_to_eln(self, _=None):
if self.eln and self.eln.is_connected:
self.message.value = f"\u29D7 Sending data to {self.eln.eln_instance}..."
self.message.value = f"\u29d7 Sending data to {self.eln.eln_instance}..."
with requests_cache.disabled():
# Since the cache is enabled in AiiDAlab, we disable it here to get correct results.
self.eln.export_data()
self.message.value = (
f"\u2705 The data were successfully sent to {self.eln.eln_instance}."
)
else:
self.message.value = f"""\u274C Something isn't right! We were not able to send the data to the "<strong>{self.eln.eln_instance}</strong>" ELN instance. Please follow <a href="{self.path_to_root}/aiidalab-widgets-base/notebooks/eln_configure.ipynb" target="_blank">the link</a> to update the ELN's configuration."""
self.message.value = f"""\u274c Something isn't right! We were not able to send the data to the "<strong>{self.eln.eln_instance}</strong>" ELN instance. Please follow <a href="{self.path_to_root}/aiidalab-widgets-base/notebooks/eln_configure.ipynb" target="_blank">the link</a> to update the ELN's configuration."""

def handle_output(self, _=None):
with self._output:
Expand Down Expand Up @@ -273,7 +273,7 @@ def check_connection(self, _=None):
if self.eln.is_connected:
self.my_output.value = "\u2705 Connected."
return
self.my_output.value = f"\u274C Not connected. {err_message}"
self.my_output.value = f"\u274c Not connected. {err_message}"

def display_eln_config(self, value=None):
"""Display ELN configuration specific to the selected type of ELN."""
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Widgets to manage AiiDA export."""

import os

import ipywidgets as ipw
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some useful classes used acrross the repository."""

import io
import tokenize

Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/nodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Widgets to work with AiiDA nodes."""

import functools

import ipytree
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Widgets to work with processes."""

# pylint: disable=no-self-use
# Built-in imports
from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/structures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to provide functionality to import structures."""

import datetime
import functools
import io
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some utility functions used acrross the repository."""

import threading
from enum import Enum
from typing import Any
Expand Down
12 changes: 6 additions & 6 deletions aiidalab_widgets_base/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,14 +672,14 @@ def _observe_cell(self, _=None):
*self.cell.array[2]
)

self.cell_a_length.value = "|<i><b>a</b></i>|: {:.4f}".format(
self.cell.lengths()[0]
self.cell_a_length.value = (
f"|<i><b>a</b></i>|: {self.cell.lengths()[0]:.4f}"
)
self.cell_b_length.value = "|<i><b>b</b></i>|: {:.4f}".format(
self.cell.lengths()[1]
self.cell_b_length.value = (
f"|<i><b>b</b></i>|: {self.cell.lengths()[1]:.4f}"
)
self.cell_c_length.value = "|<i><b>c</b></i>|: {:.4f}".format(
self.cell.lengths()[2]
self.cell_c_length.value = (
f"|<i><b>c</b></i>|: {self.cell.lengths()[2]:.4f}"
)

self.cell_alpha.value = f"&alpha;: {self.cell.angles()[0]:.4f}"
Expand Down
1 change: 1 addition & 0 deletions aiidalab_widgets_base/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Carl Simon Adorf <[email protected]>
"""

import enum

import ipywidgets as ipw
Expand Down
12 changes: 6 additions & 6 deletions notebooks/computational_resources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "cbdc6f33",
"id": "0",
"metadata": {},
"source": [
"# Computational resources setup widget"
Expand All @@ -11,7 +11,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4013ce60",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -24,7 +24,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "864bd498",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,7 +36,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "53f49d32",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -46,7 +46,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "56116f88",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -58,7 +58,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b75b6687",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand Down
10 changes: 5 additions & 5 deletions notebooks/eln_configure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "understanding-authority",
"id": "0",
"metadata": {},
"source": [
"# Configure connection to ELN\n",
Expand All @@ -13,7 +13,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "realistic-plant",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,7 +26,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "cc68ce6f",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -38,7 +38,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "celtic-norwegian",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -48,7 +48,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "humanitarian-editing",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand Down
20 changes: 10 additions & 10 deletions notebooks/eln_import.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "af4d4a45",
"id": "0",
"metadata": {},
"source": [
"# Import from ELN\n",
Expand All @@ -13,7 +13,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "annual-documentary",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,7 +26,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ea069627",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -38,7 +38,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "celtic-norwegian",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,7 +51,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "through-delay",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -64,7 +64,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "worse-elevation",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -77,7 +77,7 @@
},
{
"cell_type": "markdown",
"id": "understanding-authority",
"id": "6",
"metadata": {},
"source": [
"## Selected object:"
Expand All @@ -86,7 +86,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "humanitarian-editing",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -96,7 +96,7 @@
},
{
"cell_type": "markdown",
"id": "center-pound",
"id": "8",
"metadata": {},
"source": [
"## What's next?"
Expand All @@ -105,7 +105,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "portable-cyprus",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand Down
6 changes: 3 additions & 3 deletions notebooks/wizard_apps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "8d95a980",
"id": "0",
"metadata": {},
"source": [
"# Pizza order example\n",
Expand All @@ -13,7 +13,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b5256919",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -25,7 +25,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "thirty-catholic",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit 8668188

Please sign in to comment.