Skip to content

Commit

Permalink
Merge branch 'master' into fix/540/use_process_label_for_viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas authored Jan 22, 2024
2 parents e5c883a + cfb01eb commit e335734
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
Expand All @@ -18,7 +18,7 @@ repos:
- id: yamlfmt

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.12.1
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
Expand All @@ -39,18 +39,18 @@ repos:
- tryceratops==1.1.0

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black, --filter-files]

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

- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down
2 changes: 1 addition & 1 deletion aiidalab_widgets_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ def is_running_in_jupyter():
"viewer",
]

__version__ = "2.1.0rc0"
__version__ = "2.1.0"
10 changes: 7 additions & 3 deletions aiidalab_widgets_base/computational_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(

self._setup_new_code_output = ipw.Output(layout={"width": self._output_width})

self._default_user_email = orm.User.collection.get_default().email

children = [
ipw.HBox([self.code_select_dropdown, self.btn_setup_new_code]),
self._setup_new_code_output,
Expand All @@ -123,8 +125,8 @@ def __init__(

def _get_codes(self):
"""Query the list of available codes."""
user = orm.User.collection.get(email=self._default_user_email)

user = orm.User.collection.get_default()
filters = (
{"attributes.input_plugin": self.default_calc_job_plugin}
if self.default_calc_job_plugin
Expand Down Expand Up @@ -660,6 +662,7 @@ class AiidaComputerSetup(ipw.VBox):

def __init__(self, **kwargs):
self._on_setup_computer_success = []
self._default_user_email = orm.User.collection.get_default().email

# List of widgets to be displayed.
self.label = ipw.Text(
Expand Down Expand Up @@ -828,7 +831,7 @@ def observe_memory_per_machine(change):

def _configure_computer(self, computer: orm.Computer, transport: str):
# Use default AiiDA user
user = orm.User.collection.get_default()
user = orm.User.collection.get(email=self._default_user_email)
if transport == "core.ssh":
self._configure_computer_ssh(computer, user)
elif transport == "core.local":
Expand Down Expand Up @@ -1313,6 +1316,7 @@ def __init__(self, description="Select computer:", **kwargs):
description (str): Text to display before dropdown.
"""
self._default_user_email = orm.User.collection.get_default().email

self.output = ipw.HTML()
self._dropdown = ipw.Dropdown(
Expand Down Expand Up @@ -1351,7 +1355,7 @@ def _get_computers(self) -> list:
"""Get the list of available computers."""

# Getting the current user.
user = orm.User.collection.get_default()
user = orm.User.collection.get(email=self._default_user_email)

return [
(c[0].label, c[0].uuid)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ exclude =
docs/source/conf.py

[bumpver]
current_version = "v2.1.0rc0"
current_version = "v2.1.0"
version_pattern = "vMAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "Bump version {old_version} -> {new_version}"
commit = True
Expand Down

0 comments on commit e335734

Please sign in to comment.