Skip to content

Commit

Permalink
some
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 20, 2022
1 parent 586d04f commit 58edb4e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions aiidalab_widgets_base/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
get_process_function_report,
get_workchain_report,
)
from aiida.cmdline.utils.query.calculation import CalculationQueryBuilder
from aiida.tools.query.calculation import CalculationQueryBuilder
from aiida.common.exceptions import NotExistentAttributeError
from aiida.engine import Process, ProcessBuilder, submit
from aiida.orm import (
Expand Down Expand Up @@ -463,7 +463,7 @@ def update(self):
try:
output_file_path = os.path.join(
self.calculation.outputs.remote_folder.get_remote_path(),
self.calculation.attributes["output_filename"],
self.calculation.base.attributes.get("output_filename"),
)
except KeyError:
self.placeholder = (
Expand Down
6 changes: 3 additions & 3 deletions aiidalab_widgets_base/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class StructureManagerWidget(ipw.VBox):
structure_node = Instance(Data, allow_none=True, read_only=True)
node_class = Unicode()

SUPPORTED_DATA_FORMATS = {"CifData": "cif", "StructureData": "structure"}
SUPPORTED_DATA_FORMATS = {"CifData": "core.cif", "StructureData": "core.structure"}

def __init__(
self,
Expand Down Expand Up @@ -273,7 +273,7 @@ def _convert_to_structure_node(self, structure):
# attach its SMILES code as an extra.
structure_node = structure_node_type(ase=structure)
if "smiles" in structure.info:
structure_node.set_extra("smiles", structure.info["smiles"])
structure_node.base.extras.set("smiles", structure.info["smiles"])
return structure_node

# If the input_structure trait is set to AiiDA node, check what type
Expand Down Expand Up @@ -584,7 +584,7 @@ def preprocess(self):
queryb.append(
self.query_structure_type, filters={"extras": {"!has_key": "formula"}}
)
for item in queryb.all(): # iterall() would interfere with set_extra()
for item in queryb.all(): # iterall() would interfere with base.extras.set()
try:
formula = get_formula(item[0])
item[0].base.extras.set("formula", formula)
Expand Down
2 changes: 1 addition & 1 deletion aiidalab_widgets_base/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import spglib
import traitlets
from aiida.cmdline.utils.common import get_workchain_report
from aiida.cmdline.utils.query import formatting
from aiida.tools.query import formatting
from aiida.orm import Node
from ase import Atoms, neighborlist
from ase.cell import Cell
Expand Down
10 changes: 5 additions & 5 deletions notebooks/aiida_datatypes_viewers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"metadata": {},
"outputs": [],
"source": [
"Dict = DataFactory('dict')\n",
"Dict = DataFactory('core.dict')\n",
"p = Dict(dict={\n",
" 'Parameter' :'super long string '*4,\n",
" 'parameter 2' :'value 2',\n",
Expand Down Expand Up @@ -68,7 +68,7 @@
"metadata": {},
"outputs": [],
"source": [
"CifData = DataFactory('cif')\n",
"CifData = DataFactory('core.cif')\n",
"s = CifData(ase=m)\n",
"vwr = viewer(s.store(), configuration_tabs=['Selection', 'Appearance', 'Cell', 'Download'])\n",
"display(vwr)"
Expand All @@ -87,7 +87,7 @@
"metadata": {},
"outputs": [],
"source": [
"StructureData = DataFactory('structure')\n",
"StructureData = DataFactory('core.structure')\n",
"s = StructureData(ase=m)\n",
"vwr = viewer(s.store())\n",
"display(vwr)"
Expand All @@ -107,7 +107,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"BandsData = DataFactory('array.bands')\n",
"BandsData = DataFactory('core.array.bands')\n",
"bs = BandsData()\n",
"kpoints = np.array([[0. , 0. , 0. ], # array shape is 12 * 3\n",
" [0.1 , 0. , 0.1 ],\n",
Expand Down Expand Up @@ -159,7 +159,7 @@
"metadata": {},
"outputs": [],
"source": [
"FolderData = DataFactory('folder')\n",
"FolderData = DataFactory('core.folder')\n",
"fd = FolderData()\n",
"with io.StringIO('content of test1 filelike') as fobj:\n",
" fd.put_object_from_filelike(fobj, path='test1.txt')\n",
Expand Down

0 comments on commit 58edb4e

Please sign in to comment.