materialscloud-org / discover-curated-cofs

Materials Cloud DISCOVER section for CURATED COFs database
https://www.materialscloud.org/discover/curated-cofs
1 stars 0 forks source link

Preparing update Feb20 #25

Closed danieleongari closed 4 years ago

danieleongari commented 4 years ago

In this update we are including more COFs, but I'm also making this discover section more similar to nanoporous_screening.

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

danieleongari commented 4 years ago

Hi @ltalirz, I made some nice improvements, but I got some problems in the detail page. See my last commit:

not working:
1) aiida logo 
2) jsmol structure
3) graph not working with panel-v0.8

The first is probably working online but not locally with bokeh serve.

Can you please give them a look? The aiida export you have should work for testing purpose.

ps: I removed the prospector from the pre-commits because I don't see the need for such a simple repository.

danieleongari commented 4 years ago

Also, let's consider moving this repo to lsmo-epfl: for small projects it make more sense to have just one repository, without forks, so that both of us can more agilely edit PRs and issues.

ltalirz commented 4 years ago

The aiida export you have should work for testing purpose.

You mean the one from the nanoporous pipeline? That doesn't seem to be working for me...

  File "/Users/leopold/Personal/Postdoc-MARVEL/repos/openstack/discover-sections/curated-cofs/detail/query.py", line 12, in get_group_as_dict
    group_node = qb.all()[0][0]
IndexError: list index out of range

Also, let's consider moving this repo to lsmo-epfl

Fine with me - I'll do this after we've deployed it to materials cloud (since we need to update the ansible scripts in this case as well).

ltalirz commented 4 years ago

In the meanwhile, you can try with this diff

diff --git a/detail/main.py b/detail/main.py
index f9d5188..1640716 100644
--- a/detail/main.py
+++ b/detail/main.py
@@ -50,21 +50,6 @@ def get_title(text, uuid=None):
     return title

-class PlainSVG(pn.pane.SVG):
-    """Drop-in replacement for pn.pane.SVG that outputs plain SVG (not base64-encoded).
-
-    Note: links encoded with xlink:href are not displayed in base64-encoded SVGs.
-    """
-
-    def _get_properties(self):
-        p = super(PlainSVG, self)._get_properties()
-        data = self._img()
-
-        if self.object is None:
-            return dict(p, text='<img></img>')
-        return dict(p, text=data)
-
-
 pn.extension()

@@ -108,7 +93,7 @@ class DetailView():

     def graph(self):
         from detail.graph import get_graph
-        column = pn.Column(PlainSVG(get_graph(self.group_dict['group'], self.group_dict)))
+        column = pn.Column(pn.pane.SVG(get_graph(self.group_dict['group'], self.group_dict)))
         column.append("CURATED-COF {}, version: {}".format(self.group_dict['cof_label'], self.group_dict['version']))
         return column
danieleongari commented 4 years ago

All problems fixed!