Skip to content

Commit

Permalink
Various dependency fixes (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas authored Jul 8, 2024
1 parent 495a24b commit c97a25f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions aiidalab_widgets_base/elns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from pathlib import Path

import ipywidgets as ipw
import requests_cache
import traitlets as tl
from aiida import orm
from IPython.display import clear_output, display
Expand Down Expand Up @@ -68,6 +67,8 @@ class ElnImportWidget(ipw.VBox):
node = tl.Instance(orm.Node, allow_none=True)

def __init__(self, path_to_root="../", **kwargs):
import requests_cache

# Used to output additional settings.
self._output = ipw.Output()

Expand All @@ -83,8 +84,9 @@ def __init__(self, path_to_root="../", **kwargs):
return

tl.dlink((eln, "node"), (self, "node"))
# Since the requests cache is enabled globally in aiidalab package, we disable it here to get correct results.
# This can be removed once https://github.com/aiidalab/aiidalab/issues/196 is fixed.
with requests_cache.disabled():
# Since the cache is enabled in AiiDAlab, we disable it here to get correct results.
eln.import_data()


Expand Down Expand Up @@ -151,10 +153,13 @@ def _observe_node(self, _=None):
self.eln.set_sample_config(**info)

def send_to_eln(self, _=None):
import requests_cache

if self.eln and self.eln.is_connected:
self.message.value = f"\u29d7 Sending data to {self.eln.eln_instance}..."
# Since the requests cache is enabled globally in aiidalab package, we disable it here to get correct results.
# This can be removed once https://github.com/aiidalab/aiidalab/issues/196 is fixed.
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}."
Expand Down
3 changes: 2 additions & 1 deletion aiidalab_widgets_base/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import traitlets as tl
from aiida import common, engine, orm
from aiida.cmdline.utils.ascii_vis import calc_info
from aiidalab.app import _AiidaLabApp
from IPython.display import clear_output, display

CALCULATION_TYPES = [
Expand Down Expand Up @@ -319,6 +318,8 @@ def find_node(self, pk, namespaces=None):

class _AppIcon:
def __init__(self, app, path_to_root, node):
from aiidalab.app import _AiidaLabApp

name = app["name"]
app_object = _AiidaLabApp.from_id(name)
self.logo = app_object.metadata["logo"]
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install_requires =
bokeh~=2.0
humanfriendly~=10.0
ipytree~=0.2
traitlets~=5.9.0
traitlets~=5.9
ipywidgets~=7.7
widgetsnbextension<3.6.3
pymysql~=0.9
Expand All @@ -54,6 +54,7 @@ optimade =
ipyoptimade~=0.1
eln =
aiidalab-eln>=0.1.2,~=0.1
requests-cache~=1.0
smiles =
rdkit>=2021.09.2
scikit-learn~=1.1
Expand Down

0 comments on commit c97a25f

Please sign in to comment.