Skip to content

Commit

Permalink
Remove deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Feb 2, 2024
1 parent 83b2327 commit 784ea7e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions aiidalab_widgets_base/elns.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def _observe_node(self, _=None):
if self.node is None or self.eln is None:
return

if "eln" in self.node.extras:
info = self.node.extras["eln"]
if "eln" in self.node.base.extras.all:
info = self.node.base.extras.all["eln"]
else:
try:
q = orm.QueryBuilder().append(
Expand Down
6 changes: 3 additions & 3 deletions aiidalab_widgets_base/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ExportButtonWidget(ipw.Button):
def __init__(self, process, **kwargs):
self.process = process
if "description" not in kwargs:
kwargs["description"] = f"Export workflow ({self.process.id})"
kwargs["description"] = f"Export workflow ({self.process.pk})"
if "layout" not in kwargs:
kwargs["layout"] = {}
kwargs["layout"]["width"] = "initial"
Expand All @@ -27,7 +27,7 @@ def export_aiida_subgraph(self, change=None): # pylint: disable=unused-argument

fname = os.path.join(tempfile.mkdtemp(), "export.aiida")
subprocess.call(
["verdi", "archive", "create", fname, "-N", str(self.process.id)]
["verdi", "archive", "create", fname, "-N", str(self.process.pk)]
)
with open(fname, "rb") as fobj:
b64 = base64.b64encode(fobj.read())
Expand All @@ -41,7 +41,7 @@ def export_aiida_subgraph(self, change=None): # pylint: disable=unused-argument
link.click();
document.body.removeChild(link);
""".format(
payload=payload, filename=f"export_{self.process.id}.aiida"
payload=payload, filename=f"export_{self.process.pk}.aiida"
)
)
display(javas)
2 changes: 1 addition & 1 deletion aiidalab_widgets_base/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def show_selected_output(self, change=None):
clear_output()
if change["new"]:
selected_output = self.process.outputs[change["new"]]
self.info.value = f"PK: {selected_output.id}"
self.info.value = f"PK: {selected_output.pk}"
display(viewer(selected_output))


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ filterwarnings = [
'ignore::DeprecationWarning:jupyter_client',
'ignore::DeprecationWarning:selenium',
'ignore::DeprecationWarning:pytest_selenium',
# DeprecationWaring internally from aiida-core
# see https://github.com/aiidateam/aiida-core/pull/6272/files#top
'ignore:Object of type .* not in session, .* operation along .* will not proceed:sqlalchemy.exc.SAWarning',
'ignore:The `Code` class is deprecated.*:aiida.common.warnings.AiidaDeprecationWarning',
]
2 changes: 1 addition & 1 deletion tests/test_computational_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def test_aiida_code_setup(aiida_localhost):
assert code.label == "bash"
assert code.description == "Bash interpreter"
assert str(code.filepath_executable) == "/bin/bash"
assert code.get_input_plugin_name() == "core.arithmetic.add"
assert code.default_calc_job_plugin == "core.arithmetic.add"

# Reset the widget and check that a few attributes are reset.
widget.code_setup = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_export_button_widget(multiply_add_completed_workchain, monkeypatch, tmp

process = multiply_add_completed_workchain
button = export.ExportButtonWidget(process)
assert button.description == f"Export workflow ({process.id})"
assert button.description == f"Export workflow ({process.pk})"

# Test the export button. monkeypatch the `mkdtemp` function to return a
# temporary directory in the `tmp_path` fixture to store the export file.
Expand Down

0 comments on commit 784ea7e

Please sign in to comment.