From 781bec3858d200c65e97d7b8ef1ca12c45a341a1 Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 30 Apr 2024 15:46:00 +0200 Subject: [PATCH 01/12] ensure sample ids are urirefs --- atomrdf/workflow/workflow.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atomrdf/workflow/workflow.py b/atomrdf/workflow/workflow.py index 4229bf8..4de3521 100644 --- a/atomrdf/workflow/workflow.py +++ b/atomrdf/workflow/workflow.py @@ -56,6 +56,13 @@ def _prepare_job(self, workflow_object): parent_structure, parent_sample, structure, sample = self.wenv._add_structures( workflow_object ) + + #ensure these are not strings + if isinstance(parent_sample, str): + parent_sample = URIRef(parent_sample) + if isinstance(sample, str): + sample = URIRef(sample) + method_dict = self.wenv._identify_method(workflow_object) if (structure is None) and (sample is None): @@ -187,6 +194,7 @@ def add_structural_relation( None """ self.kg.add((self.sample, RDF.type, PROV.Entity)) + if self.parent_sample is not None: self.kg.add((self.parent_sample, RDF.type, PROV.Entity)) self.kg.add((self.sample, PROV.wasDerivedFrom, self.parent_sample)) From 53b36c41d99111dcd28e12ea57897b887c524247 Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 30 Apr 2024 15:55:42 +0200 Subject: [PATCH 02/12] add ensemble only if given --- atomrdf/workflow/workflow.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/atomrdf/workflow/workflow.py b/atomrdf/workflow/workflow.py index 4de3521..e4ce5f0 100644 --- a/atomrdf/workflow/workflow.py +++ b/atomrdf/workflow/workflow.py @@ -237,7 +237,8 @@ def add_method( # ---------------------------------------------------------- method = URIRef(f"method_{self.main_id}") if self.mdict["method"] == "MolecularStatics": - self.kg.add((method, RDF.type, ASMO.MolecularStatics)) + #TODO: Replace with ASMO.MolecularStatics + self.kg.add((method, RDF.type, ASMO.MolecularDynamics)) elif self.mdict["method"] == "MolecularDynamics": self.kg.add((method, RDF.type, ASMO.MolecularDynamics)) elif self.mdict["method"] == "DensityFunctionalTheory": @@ -349,9 +350,11 @@ def _add_software(self, method): self.kg.add((method, PROV.wasAssociatedWith, agent)) def _add_md(self, method, activity): - self.kg.add( - (method, ASMO.hasStatisticalEnsemble, getattr(ASMO, self.mdict["ensemble"])) - ) + + if self.mdict["ensemble"] is not None: + self.kg.add( + (method, ASMO.hasStatisticalEnsemble, getattr(ASMO, self.mdict["ensemble"])) + ) # add temperature if needed if self.mdict["temperature"] is not None: From e9bf054dc9f5bda142d6a41e03b831b0b1afd6fe Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 30 Apr 2024 17:22:31 +0200 Subject: [PATCH 03/12] add sample view --- atomrdf/graph.py | 4 ++++ atomrdf/visualize.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/atomrdf/graph.py b/atomrdf/graph.py index 3f82e14..81b2095 100644 --- a/atomrdf/graph.py +++ b/atomrdf/graph.py @@ -697,6 +697,7 @@ def visualise( rankdir="BT", hide_types=False, workflow_view=False, + sample_view=False, size=None, layout="neato", ): @@ -713,6 +714,8 @@ def visualise( Whether to hide the types in the visualization. Default is False. workflow_view : bool, optional Whether to enable the workflow view. Default is False. + sample_view : bool, optional + Whether to enable the sample view. Default is False. size : tuple, optional The size of the visualization. Default is None. layout : str, optional @@ -765,6 +768,7 @@ def visualise( rankdir=rankdir, hide_types=hide_types, workflow_view=workflow_view, + sample_view=sample_view, size=size, layout=layout, ) diff --git a/atomrdf/visualize.py b/atomrdf/visualize.py index cd95cbb..1e72240 100644 --- a/atomrdf/visualize.py +++ b/atomrdf/visualize.py @@ -102,6 +102,7 @@ def visualize_graph( rankdir="TB", hide_types=False, workflow_view=False, + sample_view=False, size=None, layout="dot", ): @@ -120,6 +121,8 @@ def visualize_graph( Whether to hide nodes with the "type" attribute. Default is False. workflow_view : bool, optional Whether to enable the workflow view. Default is False. + sample_view : bool, optional + Whether to enable the sample view. Default is False. size : str, optional The size of the graph. Default is None. layout : str, optional @@ -173,6 +176,12 @@ def visualize_graph( fontname=styledict[istype1]["fontname"], ) plot = False + + elif sample_view: + green_list = ['wasDerivedFrom', 'wasGeneratedBy'] + if string3 not in green_list: + plot = False + if hide_types and (string3 == "type"): plot = False From 90f20b1a07910b54f5b208e41e919b23034341fe Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 13:28:10 +0200 Subject: [PATCH 04/12] modify gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 00ffd67..fb27c23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ #custom rdf_structure_store/ *.json +*.ttl # Byte-compiled / optimized / DLL files __pycache__/ From 2a3dfa78772b0b88b3058cff176ed99f1b73bf8b Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 13:28:23 +0200 Subject: [PATCH 05/12] remove pyiron store --- atomrdf/stores.py | 42 ------------------------------------ atomrdf/workflow/__init__.py | 2 +- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/atomrdf/stores.py b/atomrdf/stores.py index 4066e95..79d4edd 100644 --- a/atomrdf/stores.py +++ b/atomrdf/stores.py @@ -4,9 +4,6 @@ import os -# special methods; for supporting workflow envs -from atomrdf.workflow import inform_graph - def create_store(kg, store, identifier, store_file=None, structure_store=None): """ @@ -48,14 +45,6 @@ def create_store(kg, store, identifier, store_file=None, structure_store=None): store_file=store_file, structure_store=structure_store, ) - elif type(store).__name__ == "Project": - store_pyiron( - kg, - store, - identifier, - store_file=store_file, - structure_store=structure_store, - ) else: raise ValueError("Unknown store found!") @@ -121,37 +110,6 @@ def store_alchemy(kg, store, identifier, store_file=None, structure_store=None): kg.graph.open(uri, create=True) kg.structure_store = _setup_structure_store(structure_store=structure_store) - -def store_pyiron(kg, store, identifier, store_file=None, structure_store=None): - """ - Store the pyiron knowledge graph in a database. - - Parameters - ---------- - kg : pyiron.atomistics.structure.pyiron_atomistics.structure.AtomisticStructure - The pyiron knowledge graph to be stored. - store : pyiron.atomistics.structure.pyiron_atomistics.structure.AtomisticStructure - The store object where the knowledge graph will be stored. - identifier : str - The identifier for the knowledge graph. - store_file : str, optional - The path to the store file. If not provided, a default path will be used. - structure_store : str, optional - The path to the structure store. If not provided, a default path will be used. - - Returns - ------- - None - - """ - structure_store = os.path.join(store.path, "rdf_structure_store") - kg.structure_store = _setup_structure_store(structure_store=structure_store) - store_file = os.path.join(store.path, f"{store.name}.db") - store_alchemy(kg, store, identifier, store_file, structure_store=structure_store) - # finally update project object - inform_graph(store, kg) - - def _check_if_sqlalchemy_is_available(): try: import sqlalchemy as sa diff --git a/atomrdf/workflow/__init__.py b/atomrdf/workflow/__init__.py index 83c8c9d..d3f5a12 100644 --- a/atomrdf/workflow/__init__.py +++ b/atomrdf/workflow/__init__.py @@ -1 +1 @@ -from atomrdf.workflow.pyiron import inform_graph + From a179e1ae13c820a8d5b2cfdee752194f9ae223a5 Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 14:24:08 +0200 Subject: [PATCH 06/12] restructure pyiron module --- atomrdf/workflow/pyiron.py | 269 +++++++++++++++++++++---------------- 1 file changed, 153 insertions(+), 116 deletions(-) diff --git a/atomrdf/workflow/pyiron.py b/atomrdf/workflow/pyiron.py index a5ad871..f85cfeb 100644 --- a/atomrdf/workflow/pyiron.py +++ b/atomrdf/workflow/pyiron.py @@ -12,17 +12,151 @@ from atomrdf.structure import _make_crystal from atomrdf.structure import System - -def _check_if_job_is_valid(job): - valid_jobs = [ - "Lammps", - ] - - if not type(job).__name__ in valid_jobs: - raise TypeError("These type of pyiron Job is not currently supported") - - -def _add_structures(job): +class WorkflowExtractor: + """ + A class to wrap pyiron jobs, which provide data in the format that can be stored in the knowledge graph. + """ + def process_job(self, job): + """ + Checkes if the job is valid and creates the necessary output dict + for the job. + + Parameters + ---------- + job : pyiron.Job + The pyiron job object to check. + + Raises + ------ + TypeError + If the job is not a valid pyiron job. + """ + valid_jobs = [ + "Lammps", + ] + + if not type(job).__name__ == 'Lammps': + self.process_job = process_lammps_job + else: + raise TypeError("These type of pyiron Job is not currently supported") + + + + def inform_graph(self, pr, kg): + """ + this function in general can be used to do extra methods to set up things as needed + for the workflow environment. + + For example, for pyiron, this updates the project object to have the graph and creator objects + """ + + try: + from pyiron_base import Creator, PyironFactory + from pyiron_atomistics.atomistics.structure.atoms import ( + ase_to_pyiron, + pyiron_to_ase, + ) + import pyiron_atomistics.atomistics.structure.factory as sf + except ImportError: + raise ImportError("Please install pyiron_base and pyiron_atomistics") + + class AnnotatedStructureFactory: + def __init__(self, graph): + self._graph = graph + + def bulk( + self, + element, + repetitions=None, + crystalstructure=None, + a=None, + covera=None, + cubic=True, + graph=None, + ): + + if crystalstructure is None: + crystalstructure = element_dict[element]["structure"] + if a is None: + a = element_dict[element]["lattice_constant"] + + struct = _make_crystal( + crystalstructure, + repetitions=repetitions, + lattice_constant=a, + ca_ratio=covera, + element=element, + primitive=not cubic, + graph=self._graph, + ) + + ase_structure = struct.write.ase() + pyiron_structure = ase_to_pyiron(ase_structure) + pyiron_structure.info["sample_id"] = struct.sample + return pyiron_structure + + def grain_boundary( + self, + element, + axis, + sigma, + gb_plane, + repetitions=(1, 1, 1), + crystalstructure=None, + a=1, + overlap=0.0, + graph=None, + ): + + struct = self._graph._annotated_make_grain_boundary( + axis, + sigma, + gb_plane, + structure=crystalstructure, + element=element, + lattice_constant=a, + repetitions=repetitions, + overlap=overlap, + graph=self._graph, + ) + + ase_structure = struct.write.ase() + pyiron_structure = ase_to_pyiron(ase_structure) + pyiron_structure.info["sample_id"] = struct.sample + return pyiron_structure + + class StructureFactory(sf.StructureFactory): + def __init__(self, graph): + super().__init__() + self._annotated_structure = AnnotatedStructureFactory(graph) + + @property + def annotated_structure(self): + return self._annotated_structure + + class StructureCreator(Creator): + def __init__(self, project): + super().__init__(project) + self._structure = StructureFactory(project.graph) + + @property + def structure(self): + return self._structure + + pr.graph = kg + pr._creator = StructureCreator(pr) + +def process_lammps_job(job): + structure_dict = get_structures(job) + method_dict = lammps_identify_method(job) + output_dict = lammps_extract_calculated_quantities(job) + + method_dict['structure'] = structure_dict['structure'] + method_dict['sample'] = structure_dict['sample'] + method_dict['outputs'] = output_dict + return method_dict + +def get_structures(job): initial_pyiron_structure = job.structure final_pyiron_structure = job.get_structure(frame=-1) initial_pyscal_structure = System.read.ase(initial_pyiron_structure) @@ -34,10 +168,15 @@ def _add_structures(job): final_pyscal_structure = System.read.ase(final_pyiron_structure) # now we do rthe transfer - return initial_pyscal_structure, initial_sample_id, final_pyscal_structure, None + return {'structure': + {'initial': initial_pyscal_structure, + 'final': final_pyscal_structure,}, + 'sample': + {'initial':initial_sample_id, + 'final': None}} -def _identify_method(job): +def lammps_identify_method(job): job_dict = job.input.to_dict() input_dict = { job_dict["control_inp/data_dict"]["Parameter"][x]: job_dict[ @@ -127,12 +266,9 @@ def _identify_method(job): } mdict["software"] = [software] - # finally add calculated quantities - quantdict = extract_calculated_quantities(job) - mdict["outputs"] = quantdict return mdict -def extract_calculated_quantities(job): +def lammps_extract_calculated_quantities(job): """ Extracts calculated quantities from a job. @@ -169,103 +305,4 @@ def extract_calculated_quantities(job): return outputs -def inform_graph(pr, kg): - """ - Update project to add extra creator functions - """ - - try: - from pyiron_base import Creator, PyironFactory - from pyiron_atomistics.atomistics.structure.atoms import ( - ase_to_pyiron, - pyiron_to_ase, - ) - import pyiron_atomistics.atomistics.structure.factory as sf - except ImportError: - raise ImportError("Please install pyiron_base and pyiron_atomistics") - - class AnnotatedStructureFactory: - def __init__(self, graph): - self._graph = graph - - def bulk( - self, - element, - repetitions=None, - crystalstructure=None, - a=None, - covera=None, - cubic=True, - graph=None, - ): - - if crystalstructure is None: - crystalstructure = element_dict[element]["structure"] - if a is None: - a = element_dict[element]["lattice_constant"] - - struct = _make_crystal( - crystalstructure, - repetitions=repetitions, - lattice_constant=a, - ca_ratio=covera, - element=element, - primitive=not cubic, - graph=self._graph, - ) - - ase_structure = struct.write.ase() - pyiron_structure = ase_to_pyiron(ase_structure) - pyiron_structure.info["sample_id"] = struct.sample - return pyiron_structure - - def grain_boundary( - self, - element, - axis, - sigma, - gb_plane, - repetitions=(1, 1, 1), - crystalstructure=None, - a=1, - overlap=0.0, - graph=None, - ): - - struct = self._graph._annotated_make_grain_boundary( - axis, - sigma, - gb_plane, - structure=crystalstructure, - element=element, - lattice_constant=a, - repetitions=repetitions, - overlap=overlap, - graph=self._graph, - ) - - ase_structure = struct.write.ase() - pyiron_structure = ase_to_pyiron(ase_structure) - pyiron_structure.info["sample_id"] = struct.sample - return pyiron_structure - - class StructureFactory(sf.StructureFactory): - def __init__(self, graph): - super().__init__() - self._annotated_structure = AnnotatedStructureFactory(graph) - - @property - def annotated_structure(self): - return self._annotated_structure - - class StructureCreator(Creator): - def __init__(self, project): - super().__init__(project) - self._structure = StructureFactory(project.graph) - - @property - def structure(self): - return self._structure - pr.graph = kg - pr._creator = StructureCreator(pr) From cb161b986c10fe9b3544d3b7ae68d4aca833e950 Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 17:44:13 +0200 Subject: [PATCH 07/12] restructure workflow module --- atomrdf/workflow/pyiron.py | 207 +++++++++++++------------ atomrdf/workflow/workflow.py | 282 ++++++++++++++++++----------------- 2 files changed, 247 insertions(+), 242 deletions(-) diff --git a/atomrdf/workflow/pyiron.py b/atomrdf/workflow/pyiron.py index f85cfeb..9f0a15f 100644 --- a/atomrdf/workflow/pyiron.py +++ b/atomrdf/workflow/pyiron.py @@ -12,118 +12,115 @@ from atomrdf.structure import _make_crystal from atomrdf.structure import System -class WorkflowExtractor: + +def process_job(job): """ - A class to wrap pyiron jobs, which provide data in the format that can be stored in the knowledge graph. + Checkes if the job is valid and creates the necessary output dict + for the job. + + Parameters + ---------- + job : pyiron.Job + The pyiron job object to check. + + Raises + ------ + TypeError + If the job is not a valid pyiron job. """ - def process_job(self, job): - """ - Checkes if the job is valid and creates the necessary output dict - for the job. - - Parameters - ---------- - job : pyiron.Job - The pyiron job object to check. - - Raises - ------ - TypeError - If the job is not a valid pyiron job. - """ - valid_jobs = [ - "Lammps", - ] - - if not type(job).__name__ == 'Lammps': - self.process_job = process_lammps_job - else: - raise TypeError("These type of pyiron Job is not currently supported") - - - - def inform_graph(self, pr, kg): - """ - this function in general can be used to do extra methods to set up things as needed - for the workflow environment. - - For example, for pyiron, this updates the project object to have the graph and creator objects - """ - - try: - from pyiron_base import Creator, PyironFactory - from pyiron_atomistics.atomistics.structure.atoms import ( - ase_to_pyiron, - pyiron_to_ase, + valid_jobs = [ + "Lammps", + ] + + if type(job).__name__ == 'Lammps': + return process_lammps_job + else: + raise TypeError("These type of pyiron Job is not currently supported") + + + +def inform_graph(pr, kg): + """ + this function in general can be used to do extra methods to set up things as needed + for the workflow environment. + + For example, for pyiron, this updates the project object to have the graph and creator objects + """ + + try: + from pyiron_base import Creator, PyironFactory + from pyiron_atomistics.atomistics.structure.atoms import ( + ase_to_pyiron, + pyiron_to_ase, + ) + import pyiron_atomistics.atomistics.structure.factory as sf + except ImportError: + raise ImportError("Please install pyiron_base and pyiron_atomistics") + + class AnnotatedStructureFactory: + def __init__(self, graph): + self._graph = graph + + def bulk( + self, + element, + repetitions=None, + crystalstructure=None, + a=None, + covera=None, + cubic=True, + graph=None, + ): + + if crystalstructure is None: + crystalstructure = element_dict[element]["structure"] + if a is None: + a = element_dict[element]["lattice_constant"] + + struct = _make_crystal( + crystalstructure, + repetitions=repetitions, + lattice_constant=a, + ca_ratio=covera, + element=element, + primitive=not cubic, + graph=self._graph, ) - import pyiron_atomistics.atomistics.structure.factory as sf - except ImportError: - raise ImportError("Please install pyiron_base and pyiron_atomistics") - class AnnotatedStructureFactory: - def __init__(self, graph): - self._graph = graph - - def bulk( - self, - element, - repetitions=None, - crystalstructure=None, - a=None, - covera=None, - cubic=True, - graph=None, - ): - - if crystalstructure is None: - crystalstructure = element_dict[element]["structure"] - if a is None: - a = element_dict[element]["lattice_constant"] - - struct = _make_crystal( - crystalstructure, - repetitions=repetitions, - lattice_constant=a, - ca_ratio=covera, - element=element, - primitive=not cubic, - graph=self._graph, - ) - - ase_structure = struct.write.ase() - pyiron_structure = ase_to_pyiron(ase_structure) - pyiron_structure.info["sample_id"] = struct.sample - return pyiron_structure - - def grain_boundary( - self, - element, + ase_structure = struct.write.ase() + pyiron_structure = ase_to_pyiron(ase_structure) + pyiron_structure.info["sample_id"] = struct.sample + return pyiron_structure + + def grain_boundary( + self, + element, + axis, + sigma, + gb_plane, + repetitions=(1, 1, 1), + crystalstructure=None, + a=1, + overlap=0.0, + graph=None, + ): + + struct = self._graph._annotated_make_grain_boundary( axis, sigma, gb_plane, - repetitions=(1, 1, 1), - crystalstructure=None, - a=1, - overlap=0.0, - graph=None, - ): - - struct = self._graph._annotated_make_grain_boundary( - axis, - sigma, - gb_plane, - structure=crystalstructure, - element=element, - lattice_constant=a, - repetitions=repetitions, - overlap=overlap, - graph=self._graph, - ) - - ase_structure = struct.write.ase() - pyiron_structure = ase_to_pyiron(ase_structure) - pyiron_structure.info["sample_id"] = struct.sample - return pyiron_structure + structure=crystalstructure, + element=element, + lattice_constant=a, + repetitions=repetitions, + overlap=overlap, + graph=self._graph, + ) + + ase_structure = struct.write.ase() + pyiron_structure = ase_to_pyiron(ase_structure) + pyiron_structure.info["sample_id"] = struct.sample + return pyiron_structure class StructureFactory(sf.StructureFactory): def __init__(self, graph): diff --git a/atomrdf/workflow/workflow.py b/atomrdf/workflow/workflow.py index e4ce5f0..5079652 100644 --- a/atomrdf/workflow/workflow.py +++ b/atomrdf/workflow/workflow.py @@ -22,6 +22,7 @@ import copy import ast import uuid +import importlib from atomrdf.structure import System @@ -33,7 +34,7 @@ class Workflow: - def __init__(self, kg, environment="pyiron"): + def __init__(self, kg): """ Initialize the workflow environment @@ -45,58 +46,97 @@ def __init__(self, kg, environment="pyiron"): """ self.kg = kg - if environment == "pyiron": - self.wenv = pi - else: - raise ValueError("unknown workflow environment") - def _prepare_job(self, workflow_object): + def inform_graph(self, pr, job_type=None, job_module=None): + if job_type is not None: + job_module = importlib.import_module(f"atomrdf.workflow.{job_type}") + elif job_module is not None: + job_module.inform_graph(pr, self.kg) + - self.wenv._check_if_job_is_valid(workflow_object) - parent_structure, parent_sample, structure, sample = self.wenv._add_structures( - workflow_object - ) + def to_graph(self, job, job_type=None, job_module=None, job_dict=None): - #ensure these are not strings - if isinstance(parent_sample, str): - parent_sample = URIRef(parent_sample) - if isinstance(sample, str): - sample = URIRef(sample) + if job_type is not None: + job_module = importlib.import_module(f"atomrdf.workflow.{job_type}") + job_dict = job_module.process_job(job) + elif job_module is not None: + job_dict = job_module.process_job(job) + + if job_dict is None: + raise ValueError("Job dict could not be calculated!") + + #now we call the functions in order + job_dict = self._add_structure(job_dict) + self._add_structural_relation(job_dict) + self._add_method(job_dict) + - method_dict = self.wenv._identify_method(workflow_object) + def _add_structure(self, job_dict): + #ensure these are not strings + if isinstance(job_dict['sample']['initial'], str): + job_dict['sample']['initial'] = URIRef(job_dict['sample']['initial']) + if isinstance(job_dict['sample']['final'], str): + job_dict['sample']['final'] = URIRef(job_dict['sample']['final']) - if (structure is None) and (sample is None): + if (job_dict['structure']['final'] is None) and (job_dict['sample']['final'] is None): raise ValueError("Either structure or sample should be specified") - if sample is None: + if job_dict['sample']['final'] is None: # its not added to graph yet + structure = job_dict['structure']['final'] structure.graph = self.kg structure.to_graph() - sample = structure.sample + job_dict['sample']['final'] = structure.sample - if parent_sample is None: + if job_dict['sample']['initial'] is None: # its not added to graph yet + parent_sample = job_dict['structure']['initial'] if parent_structure is not None: parent_structure.graph = self.kg parent_structure.to_graph() - parent_sample = parent_structure.sample + job_dict['sample']['initial'] = parent_structure.sample + return job_dict - self.structure = structure - self.sample = sample - self.mdict = method_dict - self.main_id = method_dict["id"] - self.parent_sample = parent_sample + def _add_structural_relation( + self, job_dict, + ): + """ + Add structural relation between samples. + + This method adds the structural relation between the current sample and its parent sample. + It also retrieves lattice properties and adds inherited properties, such as defect information. + + Parameters + ---------- + None + + Returns + ------- + None + """ + parent_sample = job_dict['sample']['initial'] + sample = job_dict['sample']['final'] + + self.kg.add((sample, RDF.type, PROV.Entity)) + + if parent_sample is not None: + self.kg.add((parent_sample, RDF.type, PROV.Entity)) + self.kg.add((sample, PROV.wasDerivedFrom, parent_sample)) + self._get_lattice_properties(job_dict) + self._add_inherited_properties(job_dict) def _get_lattice_properties( - self, + self, job_dict, ): - if self.parent_sample is None: + if job_dict['sample']['final'] is None: return + parent_sample = job_dict['sample']['initial'] + material = list( [ k[2] - for k in self.kg.triples((self.parent_sample, CMSO.hasMaterial, None)) + for k in self.kg.triples((parent_sample, CMSO.hasMaterial, None)) ] )[0] crystal_structure = self.kg.value(material, CMSO.hasStructure) @@ -132,20 +172,24 @@ def _get_lattice_properties( [lattice_angle_x, lattice_angle_y, lattice_angle_z], ] - self.structure._add_crystal_structure(targets=targets) - + job_dict['structure']['final']._add_crystal_structure(targets=targets) + + def _add_inherited_properties( - self, + self, job_dict, ): # Here we need to add inherited info: CalculatedProperties will be lost # Defects will be inherited - if self.parent_sample is None: + if job_dict['sample']['final'] is None: return + parent_sample = job_dict['sample']['initial'] + sample = job_dict['sample']['final'] + parent_material = list( [ k[2] - for k in self.kg.triples((self.parent_sample, CMSO.hasMaterial, None)) + for k in self.kg.triples((parent_sample, CMSO.hasMaterial, None)) ] )[0] parent_defects = list( @@ -153,7 +197,7 @@ def _add_inherited_properties( ) # now for each defect we copy add this to the final sample material = list( - [k[2] for k in self.kg.triples((self.sample, CMSO.hasMaterial, None))] + [k[2] for k in self.kg.triples((sample, CMSO.hasMaterial, None))] )[0] for defect in parent_defects: @@ -164,8 +208,8 @@ def _add_inherited_properties( self.kg.add((new_defect, triple[1], triple[2])) # now add the special props for vacancy - parent_simcell = self.kg.value(self.sample, CMSO.hasSimulationCell) - simcell = self.kg.value(self.parent_sample, CMSO.hasSimulationCell) + parent_simcell = self.kg.value(sample, CMSO.hasSimulationCell) + simcell = self.kg.value(parent_sample, CMSO.hasSimulationCell) for triple in self.kg.triples( (parent_simcell, PODO.hasVacancyConcentration, None) @@ -176,33 +220,10 @@ def _add_inherited_properties( ): self.kg.add((simcell, triple[1], triple[2])) - def add_structural_relation( - self, - ): - """ - Add structural relation between samples. - This method adds the structural relation between the current sample and its parent sample. - It also retrieves lattice properties and adds inherited properties, such as defect information. - Parameters - ---------- - None - - Returns - ------- - None - """ - self.kg.add((self.sample, RDF.type, PROV.Entity)) - - if self.parent_sample is not None: - self.kg.add((self.parent_sample, RDF.type, PROV.Entity)) - self.kg.add((self.sample, PROV.wasDerivedFrom, self.parent_sample)) - self._get_lattice_properties() - self._add_inherited_properties() - - def add_method( - self, + def _add_method( + self, job_dict, ): """ Add the computational method and related information to the knowledge graph. @@ -225,29 +246,28 @@ def add_method( The structure generation information is also added to the graph. """ - if self.mdict is None: - return # add activity # ---------------------------------------------------------- - activity = URIRef(f"activity_{self.main_id}") + main_id = job_dict['id'] + activity = URIRef(f"activity_{main_id}") self.kg.add((activity, RDF.type, PROV.Activity)) # add method # ---------------------------------------------------------- - method = URIRef(f"method_{self.main_id}") - if self.mdict["method"] == "MolecularStatics": + method = URIRef(f"method_{main_id}") + if job_dict["method"] == "MolecularStatics": #TODO: Replace with ASMO.MolecularStatics self.kg.add((method, RDF.type, ASMO.MolecularDynamics)) - elif self.mdict["method"] == "MolecularDynamics": + elif job_dict["method"] == "MolecularDynamics": self.kg.add((method, RDF.type, ASMO.MolecularDynamics)) - elif self.mdict["method"] == "DensityFunctionalTheory": + elif job_dict["method"] == "DensityFunctionalTheory": self.kg.add((method, RDF.type, ASMO.DensityFunctionalTheory)) self.kg.add((activity, ASMO.hasComputationalMethod, method)) # choose if its rigid energy or structure optimisation # ---------------------------------------------------------- - if len(self.mdict["dof"]) == 0: + if len(job_dict["dof"]) == 0: self.kg.add( ( activity, @@ -260,45 +280,32 @@ def add_method( else: self.kg.add((activity, RDF.type, ASMO.StructureOptimization)) # add DOFs - for dof in self.mdict["dof"]: + for dof in job_dict["dof"]: self.kg.add((activity, ASMO.hasRelaxationDOF, getattr(ASMO, dof))) # add method specific items - if self.mdict["method"] in ["MolecularStatics", "MolecularDynamics"]: - self._add_md(method, activity) - elif self.mdict["method"] in ["DensityFunctionalTheory"]: - self._add_dft(method, activity) + if job_dict["method"] in ["MolecularStatics", "MolecularDynamics"]: + self._add_md(job_dict, method, activity) + elif job_dict["method"] in ["DensityFunctionalTheory"]: + self._add_dft(job_dict, method, activity) # add that structure was generated - self.kg.add((self.sample, PROV.wasGeneratedBy, activity)) - self._add_inputs(activity) - self._add_outputs(activity) - self._add_software(method) - - def to_graph(self, workflow_object): - """ - Converts a workflow object to a graph representation. - - Parameters: - - workflow_object: The workflow object to convert. - - Returns: - - None - """ - self._prepare_job(workflow_object) - self.add_structural_relation() - self.add_method() - - def _add_outputs(self, activity): - if "outputs" in self.mdict.keys(): - for out in self.mdict["outputs"]: + self.kg.add((job_dict['sample']['final'], PROV.wasGeneratedBy, activity)) + self._add_inputs(job_dict, activity) + self._add_outputs(job_dict, activity) + self._add_software(job_dict, method) + + def _add_inputs(self, job_dict, activity): + main_id = job_dict['id'] + if "inputs" in job_dict.keys(): + for inp in job_dict["inputs"]: prop = self.kg.create_node( - f'{self.main_id}_{out["label"]}', CMSO.CalculatedProperty + f'{main_id}_{inp["label"]}', ASMO.InputParameter ) - self.kg.add((prop, RDFS.label, Literal(out["label"]))) - self.kg.add((prop, ASMO.hasValue, Literal(out["value"]))) - if "unit" in out.keys(): - unit = out["unit"] + self.kg.add((prop, RDFS.label, Literal(inp["label"]))) + self.kg.add((prop, ASMO.hasValue, Literal(inp["value"]))) + if "unit" in inp.keys(): + unit = inp["unit"] self.kg.add( ( prop, @@ -306,20 +313,19 @@ def _add_outputs(self, activity): URIRef(f"http://qudt.org/vocab/unit/{unit}"), ) ) - self.kg.add((prop, ASMO.wasCalculatedBy, activity)) - if out["associate_to_sample"]: - self.kg.add((self.sample, CMSO.hasCalculatedProperty, prop)) + self.kg.add((activity, ASMO.hasInputParameter, prop)) - def _add_inputs(self, activity): - if "inputs" in self.mdict.keys(): - for inp in self.mdict["inputs"]: + def _add_outputs(self, job_dict, activity): + main_id = job_dict['id'] + if "outputs" in job_dict.keys(): + for out in job_dict["outputs"]: prop = self.kg.create_node( - f'{self.main_id}_{inp["label"]}', ASMO.InputParameter + f'{main_id}_{out["label"]}', CMSO.CalculatedProperty ) - self.kg.add((prop, RDFS.label, Literal(inp["label"]))) - self.kg.add((prop, ASMO.hasValue, Literal(inp["value"]))) - if "unit" in inp.keys(): - unit = inp["unit"] + self.kg.add((prop, RDFS.label, Literal(out["label"]))) + self.kg.add((prop, ASMO.hasValue, Literal(out["value"]))) + if "unit" in out.keys(): + unit = out["unit"] self.kg.add( ( prop, @@ -327,21 +333,23 @@ def _add_inputs(self, activity): URIRef(f"http://qudt.org/vocab/unit/{unit}"), ) ) - self.kg.add((activity, ASMO.hasInputParameter, prop)) + self.kg.add((prop, ASMO.wasCalculatedBy, activity)) + if out["associate_to_sample"]: + self.kg.add((job_dict['sample']['final'], CMSO.hasCalculatedProperty, prop)) - def _add_software(self, method): + def _add_software(self, job_dict, method): # finally add software wfagent = None if "workflow_manager" in self.mdict.keys(): wfagent = self.kg.create_node( - self.mdict["workflow_manager"]["uri"], PROV.SoftwareAgent + job_dict["workflow_manager"]["uri"], PROV.SoftwareAgent ) self.kg.add( - (wfagent, RDFS.label, Literal(self.mdict["workflow_manager"]["label"])) + (wfagent, RDFS.label, Literal(job_dict["workflow_manager"]["label"])) ) self.kg.add((method, PROV.wasAssociatedWith, wfagent)) - for software in self.mdict["software"]: + for software in job_dict["software"]: agent = self.kg.create_node(software["uri"], PROV.SoftwareAgent) self.kg.add((agent, RDFS.label, Literal(software["label"]))) if wfagent is not None: @@ -349,17 +357,17 @@ def _add_software(self, method): else: self.kg.add((method, PROV.wasAssociatedWith, agent)) - def _add_md(self, method, activity): - - if self.mdict["ensemble"] is not None: + def _add_md(self, job_dict, method, activity): + main_id = job_dict['id'] + if job_dict["ensemble"] is not None: self.kg.add( - (method, ASMO.hasStatisticalEnsemble, getattr(ASMO, self.mdict["ensemble"])) + (method, ASMO.hasStatisticalEnsemble, getattr(ASMO, job_dict["ensemble"])) ) # add temperature if needed - if self.mdict["temperature"] is not None: + if job_dict["temperature"] is not None: temperature = self.kg.create_node( - f"temperature_{self.main_id}", ASMO.InputParameter + f"temperature_{main_id}", ASMO.InputParameter ) self.kg.add( (temperature, RDFS.label, Literal("temperature", datatype=XSD.string)) @@ -369,16 +377,16 @@ def _add_md(self, method, activity): ( temperature, ASMO.hasValue, - Literal(self.mdict["temperature"], datatype=XSD.float), + Literal(job_dict["temperature"], datatype=XSD.float), ) ) self.kg.add( (temperature, ASMO.hasUnit, URIRef("http://qudt.org/vocab/unit/K")) ) - if self.mdict["pressure"] is not None: + if job_dict["pressure"] is not None: pressure = self.kg.create_node( - f"pressure_{self.main_id}", ASMO.InputParameter + f"pressure_{main_id}", ASMO.InputParameter ) self.kg.add( (pressure, RDFS.label, Literal("pressure", datatype=XSD.string)) @@ -388,7 +396,7 @@ def _add_md(self, method, activity): ( pressure, ASMO.hasValue, - Literal(self.mdict["pressure"], datatype=XSD.float), + Literal(job_dict["pressure"], datatype=XSD.float), ) ) self.kg.add( @@ -396,29 +404,29 @@ def _add_md(self, method, activity): ) # potentials need to be mapped - potential = URIRef(f"potential_{self.main_id}") - if "meam" in self.mdict["potential"]["type"]: + potential = URIRef(f"potential_{main_id}") + if "meam" in job_dict["potential"]["type"]: self.kg.add((potential, RDF.type, ASMO.ModifiedEmbeddedAtomModel)) - elif "eam" in self.mdict["potential"]["type"]: + elif "eam" in job_dict["potential"]["type"]: self.kg.add((potential, RDF.type, ASMO.EmbeddedAtomModel)) - elif "lj" in self.mdict["potential"]["type"]: + elif "lj" in job_dict["potential"]["type"]: self.kg.add((potential, RDF.type, ASMO.LennardJonesPotential)) - elif "ace" in self.mdict["potential"]["type"]: + elif "ace" in job_dict["potential"]["type"]: self.kg.add((potential, RDF.type, ASMO.MachineLearningPotential)) else: self.kg.add((potential, RDF.type, ASMO.InteratomicPotential)) - if "uri" in self.mdict["potential"].keys(): + if "uri" in job_dict["potential"].keys(): self.kg.add( ( potential, CMSO.hasReference, - Literal(self.mdict["potential"]["uri"], datatype=XSD.string), + Literal(job_dict["potential"]["uri"], datatype=XSD.string), ) ) - if "label" in self.mdict["potential"].keys(): + if "label" in job_dict["potential"].keys(): self.kg.add( - (potential, RDFS.label, Literal(self.mdict["potential"]["label"])) + (potential, RDFS.label, Literal(job_dict["potential"]["label"])) ) self.kg.add((method, ASMO.hasInteratomicPotential, potential)) From 353d3e88109ee335b8b361c99fa2871491841105 Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 19:00:26 +0200 Subject: [PATCH 08/12] remove imports --- atomrdf/workflow/workflow.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/atomrdf/workflow/workflow.py b/atomrdf/workflow/workflow.py index 5079652..afe3b15 100644 --- a/atomrdf/workflow/workflow.py +++ b/atomrdf/workflow/workflow.py @@ -29,10 +29,6 @@ # Move imports to another file from atomrdf.namespace import PROV, CMSO, PODO, ASMO -# custom imports as needed -import atomrdf.workflow.pyiron as pi - - class Workflow: def __init__(self, kg): """ From 5f614b6693c68a6d43399aa4d7dd78ec6bcdbc2e Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 19:38:50 +0200 Subject: [PATCH 09/12] transfer workflow to main graph --- atomrdf/graph.py | 10 ++++++++++ atomrdf/workflow/workflow.py | 11 ++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/atomrdf/graph.py b/atomrdf/graph.py index 81b2095..3113a35 100644 --- a/atomrdf/graph.py +++ b/atomrdf/graph.py @@ -44,6 +44,7 @@ import atomrdf.properties as prp from atomrdf.stores import create_store import atomrdf.json_io as json_io +from atomrdf.workflow import Workflow from atomrdf.namespace import Namespace, CMSO, PLDO, PODO, ASMO @@ -212,6 +213,7 @@ def __init__( self.store = store self._n_triples = 0 self._initialize_graph() + self.workflow = Workflow(self) def add_structure(self, structure): """ @@ -1182,3 +1184,11 @@ def to_file(self, sample, filename=None, format="poscar"): else: asesys = sys.write.ase() write(filename, asesys, format=format) + + def enable_workflow(self, workflow_object, workflow_environment=None, workflow_module=None): + self.inform_graph(workflow_object, + workflow_environment=workflow_environment, + workflow_module=workflow_module) + + def add_workflow(self, job, job_type=None, job_module=None, job_dict=None): + self.workflow.to_graph(job, job_type=job_type, job_module=job_module, job_dict=job_dict) diff --git a/atomrdf/workflow/workflow.py b/atomrdf/workflow/workflow.py index afe3b15..13957b6 100644 --- a/atomrdf/workflow/workflow.py +++ b/atomrdf/workflow/workflow.py @@ -43,11 +43,12 @@ def __init__(self, kg): """ self.kg = kg - def inform_graph(self, pr, job_type=None, job_module=None): - if job_type is not None: - job_module = importlib.import_module(f"atomrdf.workflow.{job_type}") - elif job_module is not None: - job_module.inform_graph(pr, self.kg) + def inform_graph(self, pr, workflow_environment=None, workflow_module=None): + if workflow_environment is not None: + workflow_module = importlib.import_module(f"atomrdf.workflow.{workflow_environment}") + + if workflow_module is not None: + workflow_module.inform_graph(pr, self.kg) def to_graph(self, job, job_type=None, job_module=None, job_dict=None): From 2fe8eff925f42b507a1a50c912017a7e28ae59f7 Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 20:06:21 +0200 Subject: [PATCH 10/12] fixes for workflow --- atomrdf/graph.py | 10 +- atomrdf/stores.py | 4 +- atomrdf/workflow/pyiron.py | 36 +- atomrdf/workflow/workflow.py | 15 +- examples/06_workflow_pyiron.ipynb | 1162 +++++++++++++++++++++-------- 5 files changed, 882 insertions(+), 345 deletions(-) diff --git a/atomrdf/graph.py b/atomrdf/graph.py index 3113a35..0d4f617 100644 --- a/atomrdf/graph.py +++ b/atomrdf/graph.py @@ -44,7 +44,7 @@ import atomrdf.properties as prp from atomrdf.stores import create_store import atomrdf.json_io as json_io -from atomrdf.workflow import Workflow +from atomrdf.workflow.workflow import Workflow from atomrdf.namespace import Namespace, CMSO, PLDO, PODO, ASMO @@ -1186,9 +1186,11 @@ def to_file(self, sample, filename=None, format="poscar"): write(filename, asesys, format=format) def enable_workflow(self, workflow_object, workflow_environment=None, workflow_module=None): - self.inform_graph(workflow_object, + self.workflow.inform_graph(workflow_object, workflow_environment=workflow_environment, workflow_module=workflow_module) - def add_workflow(self, job, job_type=None, job_module=None, job_dict=None): - self.workflow.to_graph(job, job_type=job_type, job_module=job_module, job_dict=job_dict) + def add_workflow(self, job, workflow_environment=None, workflow_module=None, job_dict=None): + self.workflow.to_graph(job, workflow_environment=workflow_environment, + workflow_module=workflow_module, + job_dict=job_dict) diff --git a/atomrdf/stores.py b/atomrdf/stores.py index 79d4edd..96b1732 100644 --- a/atomrdf/stores.py +++ b/atomrdf/stores.py @@ -29,7 +29,7 @@ def create_store(kg, store, identifier, store_file=None, structure_store=None): """ kg.store_file = store_file - if store == "Memory": + if store in ["Memory", "memory"]: store_memory( kg, store, @@ -37,7 +37,7 @@ def create_store(kg, store, identifier, store_file=None, structure_store=None): store_file=store_file, structure_store=structure_store, ) - elif store == "SQLAlchemy": + elif store in ["SQLAlchemy", "db", "database", "sqlalchemy"]: store_alchemy( kg, store, diff --git a/atomrdf/workflow/pyiron.py b/atomrdf/workflow/pyiron.py index 9f0a15f..2e66f63 100644 --- a/atomrdf/workflow/pyiron.py +++ b/atomrdf/workflow/pyiron.py @@ -33,7 +33,7 @@ def process_job(job): ] if type(job).__name__ == 'Lammps': - return process_lammps_job + return process_lammps_job(job) else: raise TypeError("These type of pyiron Job is not currently supported") @@ -121,27 +121,27 @@ def grain_boundary( pyiron_structure = ase_to_pyiron(ase_structure) pyiron_structure.info["sample_id"] = struct.sample return pyiron_structure + + class StructureFactory(sf.StructureFactory): + def __init__(self, graph): + super().__init__() + self._annotated_structure = AnnotatedStructureFactory(graph) - class StructureFactory(sf.StructureFactory): - def __init__(self, graph): - super().__init__() - self._annotated_structure = AnnotatedStructureFactory(graph) - - @property - def annotated_structure(self): - return self._annotated_structure + @property + def annotated_structure(self): + return self._annotated_structure - class StructureCreator(Creator): - def __init__(self, project): - super().__init__(project) - self._structure = StructureFactory(project.graph) + class StructureCreator(Creator): + def __init__(self, project): + super().__init__(project) + self._structure = StructureFactory(project.graph) - @property - def structure(self): - return self._structure + @property + def structure(self): + return self._structure - pr.graph = kg - pr._creator = StructureCreator(pr) + pr.graph = kg + pr._creator = StructureCreator(pr) def process_lammps_job(job): structure_dict = get_structures(job) diff --git a/atomrdf/workflow/workflow.py b/atomrdf/workflow/workflow.py index 13957b6..88934a2 100644 --- a/atomrdf/workflow/workflow.py +++ b/atomrdf/workflow/workflow.py @@ -51,17 +51,18 @@ def inform_graph(self, pr, workflow_environment=None, workflow_module=None): workflow_module.inform_graph(pr, self.kg) - def to_graph(self, job, job_type=None, job_module=None, job_dict=None): + def to_graph(self, job, workflow_environment=None, workflow_module=None, job_dict=None): - if job_type is not None: - job_module = importlib.import_module(f"atomrdf.workflow.{job_type}") - job_dict = job_module.process_job(job) - elif job_module is not None: - job_dict = job_module.process_job(job) + if workflow_environment is not None: + workflow_module = importlib.import_module(f"atomrdf.workflow.{workflow_environment}") + job_dict = workflow_module.process_job(job) + elif workflow_module is not None: + job_dict = workflow_module.process_job(job) if job_dict is None: raise ValueError("Job dict could not be calculated!") + #print(job_dict) #now we call the functions in order job_dict = self._add_structure(job_dict) self._add_structural_relation(job_dict) @@ -337,7 +338,7 @@ def _add_outputs(self, job_dict, activity): def _add_software(self, job_dict, method): # finally add software wfagent = None - if "workflow_manager" in self.mdict.keys(): + if "workflow_manager" in job_dict.keys(): wfagent = self.kg.create_node( job_dict["workflow_manager"]["uri"], PROV.SoftwareAgent ) diff --git a/examples/06_workflow_pyiron.ipynb b/examples/06_workflow_pyiron.ipynb index e774ba4..4f2b2f1 100644 --- a/examples/06_workflow_pyiron.ipynb +++ b/examples/06_workflow_pyiron.ipynb @@ -34,20 +34,10 @@ "scrolled": true }, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/menon/miniconda3/envs/workflow-rdf-v0.2/lib/python3.11/site-packages/numpy/core/getlimits.py:542: UserWarning: Signature b'\\x00\\xd0\\xcc\\xcc\\xcc\\xcc\\xcc\\xcc\\xfb\\xbf\\x00\\x00\\x00\\x00\\x00\\x00' for does not match any known type: falling back to type probe function.\n", - "This warnings indicates broken support for the dtype!\n", - " machar = _get_machar(dtype)\n", - "2024-04-18 12:54:21,059 - pyiron_log - WARNING - pyiron found a 'templates' folder in the /home/menon/pyiron/resources resource directory. These are no longer supported in pyiron_base >=0.7.0. They are replaced by Project.create_job_class() and Project.wrap_python_function().\n" - ] - }, { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "b3e1540e94144972bc50c9b3fdce538f", + "model_id": "1e84700f34e64a27a22aff12c55eb460", "version_major": 2, "version_minor": 0 }, @@ -80,7 +70,7 @@ "metadata": {}, "outputs": [], "source": [ - "kg = KnowledgeGraph(store=pr)" + "kg = KnowledgeGraph(store='db', store_file='kg.db')" ] }, { @@ -90,7 +80,7 @@ "metadata": {}, "outputs": [], "source": [ - "wf = Workflow(kg, environment='pyiron')" + "kg.enable_workflow(pr, workflow_environment='pyiron')" ] }, { @@ -120,21 +110,495 @@ "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "sample_d6ce3789-c330-4dc9-be4c-ad2aa3fee411\n", - "\n", - "sample_d6ce3789-c330-4dc9-be4c-ad2aa3fee411\n", + "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", + "\n", + "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", + "\n", + "\n", + "\n", + "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", + "\n", + "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", + "\n", + "\n", + "\n", + "sample_31171300-d463-4273-91ea-e4e096142b96\n", + "\n", + "sample_31171300-d463-4273-91ea-e4e096142b96\n", + "\n", + "\n", + "\n", + "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", + "\n", + "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", + "\n", + "\n", + "\n", + "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", + "\n", + "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", + "\n", + "\n", + "\n", + "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", + "\n", + "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", + "\n", + "\n", + "\n", + "Entity\n", + "\n", + "Entity\n", + "\n", + "\n", + "\n", + "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392->Entity\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", + "\n", + "\n", + "wasDerivedFrom\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->Entity\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "activity_50\n", + "\n", + "activity_50\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->activity_50\n", + "\n", + "\n", + "wasGeneratedBy\n", + "\n", + "\n", + "\n", + "50_TotalEnergy\n", + "\n", + "50_TotalEnergy\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalEnergy\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", + "\n", + "\n", + "\n", + "50_TotalVolume\n", + "\n", + "50_TotalVolume\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalVolume\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", + "\n", + "\n", + "\n", + "Activity\n", + "\n", + "Activity\n", + "\n", + "\n", + "\n", + "activity_50->Activity\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "method_50\n", + "\n", + "method_50\n", + "\n", + "\n", + "\n", + "activity_50->method_50\n", + "\n", + "\n", + "asmo.hasComputationalMethod\n", + "\n", + "\n", + "\n", + "asmo.StructureOptimization\n", + "\n", + "asmo.StructureOptimization\n", + "\n", + "\n", + "\n", + "activity_50->asmo.StructureOptimization\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "temperature_50\n", + "\n", + "temperature_50\n", + "\n", + "\n", + "\n", + "activity_50->temperature_50\n", + "\n", + "\n", + "asmo.hasInputParameter\n", + "\n", + "\n", + "\n", + "pressure_50\n", + "\n", + "pressure_50\n", + "\n", + "\n", + "\n", + "activity_50->pressure_50\n", + "\n", + "\n", + "asmo.hasInputParameter\n", + "\n", + "\n", + "\n", + "asmo.AtomicPosition\n", + "\n", + "asmo.AtomicPosition\n", + "\n", + "\n", + "\n", + "activity_50->asmo.AtomicPosition\n", + "\n", + "\n", + "asmo.hasRelaxationDOF\n", + "\n", + "\n", + "\n", + "asmo.CellVolume\n", + "\n", + "asmo.CellVolume\n", + "\n", + "\n", + "\n", + "activity_50->asmo.CellVolume\n", + "\n", + "\n", + "asmo.hasRelaxationDOF\n", + "\n", + "\n", + "\n", + "asmo.MolecularDynamics\n", + "\n", + "asmo.MolecularDynamics\n", + "\n", + "\n", + "\n", + "method_50->asmo.MolecularDynamics\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "potential_50\n", + "\n", + "potential_50\n", + "\n", + "\n", + "\n", + "method_50->potential_50\n", + "\n", + "\n", + "asmo.hasInteratomicPotential\n", + "\n", + "\n", + "\n", + "asmo.Isothermal–isobaricEnsemble\n", + "\n", + "asmo.Isothermal–isobaricEnsemble\n", + "\n", + "\n", + "\n", + "method_50->asmo.Isothermal–isobaricEnsemble\n", + "\n", + "\n", + "asmo.hasStatisticalEnsemble\n", + "\n", + "\n", + "\n", + "asmo.InputParameter\n", + "\n", + "asmo.InputParameter\n", + "\n", + "\n", + "\n", + "temperature_50->asmo.InputParameter\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "unit.K\n", + "\n", + "unit.K\n", + "\n", + "\n", + "\n", + "temperature_50->unit.K\n", + "\n", + "\n", + "asmo.hasUnit\n", + "\n", + "\n", + "\n", + "170a7949-38cd-4e87-96d3-00fe815cdd09\n", + "\n", + "Temperature\n", + "\n", + "\n", + "\n", + "temperature_50->170a7949-38cd-4e87-96d3-00fe815cdd09\n", + "\n", + "\n", + "label\n", + "\n", + "\n", + "\n", + "0b554831-737a-45d3-9f39-dc15c8608724\n", + "\n", + "500.0\n", + "\n", + "\n", + "\n", + "temperature_50->0b554831-737a-45d3-9f39-dc15c8608724\n", + "\n", + "\n", + "asmo.hasValue\n", + "\n", + "\n", + "\n", + "pressure_50->asmo.InputParameter\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "unit.GigaPA\n", + "\n", + "unit.GigaPA\n", + "\n", + "\n", + "\n", + "pressure_50->unit.GigaPA\n", + "\n", + "\n", + "asmo.hasUnit\n", + "\n", + "\n", + "\n", + "2b44569c-5c74-43c4-b460-f3fbed97f198\n", + "\n", + "Pressure\n", + "\n", + "\n", + "\n", + "pressure_50->2b44569c-5c74-43c4-b460-f3fbed97f198\n", + "\n", + "\n", + "label\n", + "\n", + "\n", + "\n", + "1d445962-a957-4fe5-92de-04bbee0b59ce\n", + "\n", + "0.0\n", + "\n", + "\n", + "\n", + "pressure_50->1d445962-a957-4fe5-92de-04bbee0b59ce\n", + "\n", + "\n", + "asmo.hasValue\n", + "\n", + "\n", + "\n", + "asmo.EmbeddedAtomModel\n", + "\n", + "asmo.EmbeddedAtomModel\n", + "\n", + "\n", + "\n", + "potential_50->asmo.EmbeddedAtomModel\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "514a675b-92e9-445e-a516-fee0a41a445a\n", + "\n", + "2001--Mishin-Y--Cu-1--Lammps--Ipr1\n", + "\n", + "\n", + "\n", + "potential_50->514a675b-92e9-445e-a516-fee0a41a445a\n", + "\n", + "\n", + "label\n", + "\n", + "\n", + "\n", + "50_TotalEnergy->activity_50\n", + "\n", + "\n", + "asmo.wasCalculatedBy\n", + "\n", + "\n", + "\n", + "cmso.CalculatedProperty\n", + "\n", + "cmso.CalculatedProperty\n", + "\n", + "\n", + "\n", + "50_TotalEnergy->cmso.CalculatedProperty\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "unit.EV\n", + "\n", + "unit.EV\n", + "\n", + "\n", + "\n", + "50_TotalEnergy->unit.EV\n", + "\n", + "\n", + "asmo.hasUnit\n", + "\n", + "\n", + "\n", + "747b10c4-d037-4943-ad78-c53534dfebba\n", + "\n", + "Totalenergy\n", + "\n", + "\n", + "\n", + "50_TotalEnergy->747b10c4-d037-4943-ad78-c53534dfebba\n", + "\n", + "\n", + "label\n", + "\n", + "\n", + "\n", + "5b9b56f7-107f-4b5d-8b0c-51bd6d8389c6\n", + "\n", + "-13.7346\n", + "\n", + "\n", + "\n", + "50_TotalEnergy->5b9b56f7-107f-4b5d-8b0c-51bd6d8389c6\n", + "\n", + "\n", + "asmo.hasValue\n", + "\n", + "\n", + "\n", + "50_TotalVolume->activity_50\n", + "\n", + "\n", + "asmo.wasCalculatedBy\n", + "\n", + "\n", + "\n", + "50_TotalVolume->cmso.CalculatedProperty\n", + "\n", + "\n", + "type\n", + "\n", + "\n", + "\n", + "unit.ANGSTROM3\n", + "\n", + "unit.ANGSTROM3\n", + "\n", + "\n", + "\n", + "50_TotalVolume->unit.ANGSTROM3\n", + "\n", + "\n", + "asmo.hasUnit\n", + "\n", + "\n", + "\n", + "edeb1402-2214-4526-901f-588bcfbf5c52\n", + "\n", + "Totalvolume\n", + "\n", + "\n", + "\n", + "50_TotalVolume->edeb1402-2214-4526-901f-588bcfbf5c52\n", + "\n", + "\n", + "label\n", + "\n", + "\n", + "\n", + "c09cfc39-f239-4fe1-be76-ad2164b800c1\n", + "\n", + "48.2558\n", + "\n", + "\n", + "\n", + "50_TotalVolume->c09cfc39-f239-4fe1-be76-ad2164b800c1\n", + "\n", + "\n", + "asmo.hasValue\n", + "\n", + "\n", + "\n", + "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", + "\n", + "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -196,7 +660,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "The job j1 was saved and received the ID: 8176\n" + "The job j1 was saved and received the ID: 50\n" ] } ], @@ -211,7 +675,7 @@ "metadata": {}, "outputs": [], "source": [ - "wf.to_graph(job)" + "kg.add_workflow(job, workflow_environment='pyiron')" ] }, { @@ -231,399 +695,469 @@ "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "sample_d6ce3789-c330-4dc9-be4c-ad2aa3fee411\n", - "\n", - "sample_d6ce3789-c330-4dc9-be4c-ad2aa3fee411\n", + "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", + "\n", + "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", "\n", - "\n", + "\n", "\n", - "sample_7c113ec5-bf1f-4c2c-b863-b7bb5b9091b7\n", - "\n", - "sample_7c113ec5-bf1f-4c2c-b863-b7bb5b9091b7\n", + "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", + "\n", + "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", "\n", - "\n", + "\n", + "\n", + "sample_31171300-d463-4273-91ea-e4e096142b96\n", + "\n", + "sample_31171300-d463-4273-91ea-e4e096142b96\n", + "\n", + "\n", + "\n", + "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", + "\n", + "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", + "\n", + "\n", + "\n", + "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", + "\n", + "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", + "\n", + "\n", + "\n", + "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", + "\n", + "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", + "\n", + "\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", + "\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", + "\n", + "\n", "\n", - "sample_7c113ec5-bf1f-4c2c-b863-b7bb5b9091b7->sample_d6ce3789-c330-4dc9-be4c-ad2aa3fee411\n", - "\n", - "\n", - "wasDerivedFrom\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", + "\n", + "\n", + "wasDerivedFrom\n", "\n", - "\n", - "\n", - "activity_8176\n", - "\n", - "activity_8176\n", + "\n", + "\n", + "activity_50\n", + "\n", + "activity_50\n", "\n", - "\n", + "\n", "\n", - "sample_7c113ec5-bf1f-4c2c-b863-b7bb5b9091b7->activity_8176\n", - "\n", - "\n", - "wasGeneratedBy\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->activity_50\n", + "\n", + "\n", + "wasGeneratedBy\n", "\n", - "\n", - "\n", - "8176_TotalEnergy\n", - "\n", - "8176_TotalEnergy\n", + "\n", + "\n", + "50_TotalEnergy\n", + "\n", + "50_TotalEnergy\n", "\n", - "\n", + "\n", "\n", - "sample_7c113ec5-bf1f-4c2c-b863-b7bb5b9091b7->8176_TotalEnergy\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalEnergy\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", "\n", - "\n", - "\n", - "8176_TotalVolume\n", - "\n", - "8176_TotalVolume\n", + "\n", + "\n", + "50_TotalVolume\n", + "\n", + "50_TotalVolume\n", "\n", - "\n", + "\n", "\n", - "sample_7c113ec5-bf1f-4c2c-b863-b7bb5b9091b7->8176_TotalVolume\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", + "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalVolume\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", "\n", - "\n", - "\n", - "method_8176\n", - "\n", - "method_8176\n", + "\n", + "\n", + "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", + "\n", + "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", + "\n", + "\n", + "\n", + "method_50\n", + "\n", + "method_50\n", "\n", - "\n", + "\n", "\n", - "activity_8176->method_8176\n", - "\n", - "\n", - "asmo.hasComputationalMethod\n", + "activity_50->method_50\n", + "\n", + "\n", + "asmo.hasComputationalMethod\n", "\n", "\n", - "\n", + "\n", "asmo.AtomicPosition\n", - "\n", - "asmo.AtomicPosition\n", + "\n", + "asmo.AtomicPosition\n", "\n", - "\n", + "\n", "\n", - "activity_8176->asmo.AtomicPosition\n", - "\n", - "\n", - "asmo.hasRelaxationDOF\n", + "activity_50->asmo.AtomicPosition\n", + "\n", + "\n", + "asmo.hasRelaxationDOF\n", "\n", "\n", - "\n", + "\n", "asmo.CellVolume\n", - "\n", - "asmo.CellVolume\n", + "\n", + "asmo.CellVolume\n", "\n", - "\n", + "\n", "\n", - "activity_8176->asmo.CellVolume\n", - "\n", - "\n", - "asmo.hasRelaxationDOF\n", + "activity_50->asmo.CellVolume\n", + "\n", + "\n", + "asmo.hasRelaxationDOF\n", "\n", - "\n", - "\n", - "temperature_8176\n", - "\n", - "temperature_8176\n", + "\n", + "\n", + "temperature_50\n", + "\n", + "temperature_50\n", "\n", - "\n", + "\n", "\n", - "activity_8176->temperature_8176\n", - "\n", - "\n", - "asmo.hasInputParameter\n", + "activity_50->temperature_50\n", + "\n", + "\n", + "asmo.hasInputParameter\n", "\n", - "\n", - "\n", - "pressure_8176\n", - "\n", - "pressure_8176\n", + "\n", + "\n", + "pressure_50\n", + "\n", + "pressure_50\n", "\n", - "\n", + "\n", "\n", - "activity_8176->pressure_8176\n", - "\n", - "\n", - "asmo.hasInputParameter\n", + "activity_50->pressure_50\n", + "\n", + "\n", + "asmo.hasInputParameter\n", "\n", "\n", - "\n", + "\n", "asmo.Isothermal–isobaricEnsemble\n", - "\n", - "asmo.Isothermal–isobaricEnsemble\n", + "\n", + "asmo.Isothermal–isobaricEnsemble\n", "\n", - "\n", + "\n", "\n", - "method_8176->asmo.Isothermal–isobaricEnsemble\n", - "\n", - "\n", - "asmo.hasStatisticalEnsemble\n", + "method_50->asmo.Isothermal–isobaricEnsemble\n", + "\n", + "\n", + "asmo.hasStatisticalEnsemble\n", "\n", - "\n", - "\n", - "potential_8176\n", - "\n", - "potential_8176\n", + "\n", + "\n", + "potential_50\n", + "\n", + "potential_50\n", "\n", - "\n", + "\n", "\n", - "method_8176->potential_8176\n", - "\n", - "\n", - "asmo.hasInteratomicPotential\n", + "method_50->potential_50\n", + "\n", + "\n", + "asmo.hasInteratomicPotential\n", "\n", "\n", - "\n", + "\n", "matwerk.E457491\n", - "\n", - "matwerk.E457491\n", + "\n", + "matwerk.E457491\n", + "\n", + "\n", + "\n", + "method_50->matwerk.E457491\n", + "\n", + "\n", + "wasAssociatedWith\n", + "\n", + "\n", + "\n", + "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0\n", + "\n", + "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0\n", "\n", - "\n", + "\n", "\n", - "method_8176->matwerk.E457491\n", - "\n", - "\n", - "wasAssociatedWith\n", + "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", + "\n", + "\n", + "wasDerivedFrom\n", + "\n", + "\n", + "\n", + "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->activity_50\n", + "\n", + "\n", + "wasGeneratedBy\n", + "\n", + "\n", + "\n", + "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->50_TotalEnergy\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", + "\n", + "\n", + "\n", + "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->50_TotalVolume\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", "\n", "\n", - "\n", + "\n", "unit.K\n", - "\n", - "unit.K\n", + "\n", + "unit.K\n", "\n", - "\n", + "\n", "\n", - "temperature_8176->unit.K\n", - "\n", - "\n", - "asmo.hasUnit\n", + "temperature_50->unit.K\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "c28634b6-575e-4a85-a1a5-6d75bc798da8\n", - "\n", - "Temperature\n", + "\n", + "\n", + "3e24a6fa-26bf-4ddc-af88-99271ac841b7\n", + "\n", + "Temperature\n", "\n", - "\n", - "\n", - "temperature_8176->c28634b6-575e-4a85-a1a5-6d75bc798da8\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "temperature_50->3e24a6fa-26bf-4ddc-af88-99271ac841b7\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "28fd3ec9-1c42-4914-a782-37b30dab9227\n", - "\n", - "500.0\n", + "\n", + "\n", + "c5a19830-28c1-4d87-b914-89766a3dc67a\n", + "\n", + "500.0\n", "\n", - "\n", - "\n", - "temperature_8176->28fd3ec9-1c42-4914-a782-37b30dab9227\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "temperature_50->c5a19830-28c1-4d87-b914-89766a3dc67a\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", "\n", - "\n", + "\n", "unit.GigaPA\n", - "\n", - "unit.GigaPA\n", + "\n", + "unit.GigaPA\n", "\n", - "\n", + "\n", "\n", - "pressure_8176->unit.GigaPA\n", - "\n", - "\n", - "asmo.hasUnit\n", + "pressure_50->unit.GigaPA\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "20658bc9-06a9-4003-9c13-509e346d5f41\n", - "\n", - "Pressure\n", + "\n", + "\n", + "7bb6f5b8-ff70-4056-a3cc-4d3c9fd510ff\n", + "\n", + "Pressure\n", "\n", - "\n", - "\n", - "pressure_8176->20658bc9-06a9-4003-9c13-509e346d5f41\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "pressure_50->7bb6f5b8-ff70-4056-a3cc-4d3c9fd510ff\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "0042105c-fd16-4778-aeeb-6408b322a1b6\n", - "\n", - "0.0\n", + "\n", + "\n", + "c402ee74-ffc2-487e-9521-d4599a16514e\n", + "\n", + "0.0\n", "\n", - "\n", - "\n", - "pressure_8176->0042105c-fd16-4778-aeeb-6408b322a1b6\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "pressure_50->c402ee74-ffc2-487e-9521-d4599a16514e\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", - "\n", - "\n", - "5a0e55bc-afeb-4d22-b5e1-72b8692a6e6c\n", - "\n", - "2001--Mishin-Y--Cu-1--Lammps--Ipr1\n", + "\n", + "\n", + "9c6ada05-b00e-4af5-8089-a082b188303b\n", + "\n", + "2001--Mishin-Y--Cu-1--Lammps--Ipr1\n", "\n", - "\n", - "\n", - "potential_8176->5a0e55bc-afeb-4d22-b5e1-72b8692a6e6c\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "potential_50->9c6ada05-b00e-4af5-8089-a082b188303b\n", + "\n", + "\n", + "label\n", "\n", - "\n", + "\n", "\n", - "8176_TotalEnergy->activity_8176\n", - "\n", - "\n", - "asmo.wasCalculatedBy\n", + "50_TotalEnergy->activity_50\n", + "\n", + "\n", + "asmo.wasCalculatedBy\n", "\n", "\n", - "\n", + "\n", "unit.EV\n", - "\n", - "unit.EV\n", + "\n", + "unit.EV\n", "\n", - "\n", + "\n", "\n", - "8176_TotalEnergy->unit.EV\n", - "\n", - "\n", - "asmo.hasUnit\n", + "50_TotalEnergy->unit.EV\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "a919bb29-412b-4b7a-8a9e-67c280ab5cbe\n", - "\n", - "Totalenergy\n", + "\n", + "\n", + "530b7c73-cec0-4d7e-9a0c-c507c45a02e5\n", + "\n", + "Totalenergy\n", "\n", - "\n", - "\n", - "8176_TotalEnergy->a919bb29-412b-4b7a-8a9e-67c280ab5cbe\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "50_TotalEnergy->530b7c73-cec0-4d7e-9a0c-c507c45a02e5\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "30de06a7-9ca9-4b53-b42a-65230b0aa37d\n", - "\n", - "-13.7346\n", + "\n", + "\n", + "a844a6dc-93a2-49a2-b50e-25822be9e8c8\n", + "\n", + "-13.7346\n", "\n", - "\n", - "\n", - "8176_TotalEnergy->30de06a7-9ca9-4b53-b42a-65230b0aa37d\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "50_TotalEnergy->a844a6dc-93a2-49a2-b50e-25822be9e8c8\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", - "\n", + "\n", "\n", - "8176_TotalVolume->activity_8176\n", - "\n", - "\n", - "asmo.wasCalculatedBy\n", + "50_TotalVolume->activity_50\n", + "\n", + "\n", + "asmo.wasCalculatedBy\n", "\n", "\n", - "\n", + "\n", "unit.ANGSTROM3\n", - "\n", - "unit.ANGSTROM3\n", + "\n", + "unit.ANGSTROM3\n", "\n", - "\n", + "\n", "\n", - "8176_TotalVolume->unit.ANGSTROM3\n", - "\n", - "\n", - "asmo.hasUnit\n", + "50_TotalVolume->unit.ANGSTROM3\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "64a38d93-403d-471a-91a1-c52bfb00ef77\n", - "\n", - "Totalvolume\n", + "\n", + "\n", + "0ac3490e-672b-467b-b75e-843f37aed5d1\n", + "\n", + "Totalvolume\n", "\n", - "\n", - "\n", - "8176_TotalVolume->64a38d93-403d-471a-91a1-c52bfb00ef77\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "50_TotalVolume->0ac3490e-672b-467b-b75e-843f37aed5d1\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "0358a436-7878-4e47-86de-053abfece585\n", - "\n", - "48.2558\n", + "\n", + "\n", + "805d3d26-a251-433e-ab1d-9299f9e2978d\n", + "\n", + "48.2558\n", "\n", - "\n", - "\n", - "8176_TotalVolume->0358a436-7878-4e47-86de-053abfece585\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "50_TotalVolume->805d3d26-a251-433e-ab1d-9299f9e2978d\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", "\n", - "\n", + "\n", "matwerk.E447986\n", - "\n", - "matwerk.E447986\n", + "\n", + "matwerk.E447986\n", "\n", "\n", - "\n", + "\n", "matwerk.E457491->matwerk.E447986\n", - "\n", - "\n", - "actedOnBehalfOf\n", + "\n", + "\n", + "actedOnBehalfOf\n", "\n", - "\n", - "\n", - "2785804e-e4e8-415d-860b-62fa830b5dfa\n", - "\n", - "Pyiron\n", + "\n", + "\n", + "fba00ae5-f3d0-49ed-bfef-e7c4fc60665a\n", + "\n", + "Pyiron\n", "\n", - "\n", - "\n", - "matwerk.E457491->2785804e-e4e8-415d-860b-62fa830b5dfa\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "matwerk.E457491->fba00ae5-f3d0-49ed-bfef-e7c4fc60665a\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "3b64e836-85ed-4e47-b3dd-8bea5e000434\n", - "\n", - "Lammps\n", + "\n", + "\n", + "9b2379c3-87b2-416b-beca-de848d2468b4\n", + "\n", + "Lammps\n", "\n", - "\n", - "\n", - "matwerk.E447986->3b64e836-85ed-4e47-b3dd-8bea5e000434\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "matwerk.E447986->9b2379c3-87b2-416b-beca-de848d2468b4\n", + "\n", + "\n", + "label\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 14, From 938958943bbb1d8be848df1adac053f6662fd4ac Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 20:07:56 +0200 Subject: [PATCH 11/12] update example --- examples/06_workflow_pyiron.ipynb | 1150 ++++++++--------------------- 1 file changed, 303 insertions(+), 847 deletions(-) diff --git a/examples/06_workflow_pyiron.ipynb b/examples/06_workflow_pyiron.ipynb index 4f2b2f1..e029bd6 100644 --- a/examples/06_workflow_pyiron.ipynb +++ b/examples/06_workflow_pyiron.ipynb @@ -37,7 +37,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "1e84700f34e64a27a22aff12c55eb460", + "model_id": "1bc7f7716890468ab750205a2cf67a45", "version_major": 2, "version_minor": 0 }, @@ -60,7 +60,7 @@ "metadata": {}, "outputs": [], "source": [ - "pr = Project('wf1a')" + "pr = Project('wf1c')" ] }, { @@ -70,7 +70,7 @@ "metadata": {}, "outputs": [], "source": [ - "kg = KnowledgeGraph(store='db', store_file='kg.db')" + "kg = KnowledgeGraph(store='db', store_file='kg_db.db')" ] }, { @@ -110,495 +110,21 @@ "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", - "\n", - "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", - "\n", - "\n", - "\n", - "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", - "\n", - "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", - "\n", - "\n", - "\n", - "sample_31171300-d463-4273-91ea-e4e096142b96\n", - "\n", - "sample_31171300-d463-4273-91ea-e4e096142b96\n", - "\n", - "\n", - "\n", - "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", - "\n", - "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", - "\n", - "\n", - "\n", - "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", - "\n", - "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", - "\n", - "\n", - "\n", - "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", - "\n", - "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", - "\n", - "\n", - "\n", - "Entity\n", - "\n", - "Entity\n", - "\n", - "\n", - "\n", - "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392->Entity\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", - "\n", - "\n", - "wasDerivedFrom\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->Entity\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "activity_50\n", - "\n", - "activity_50\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->activity_50\n", - "\n", - "\n", - "wasGeneratedBy\n", - "\n", - "\n", - "\n", - "50_TotalEnergy\n", - "\n", - "50_TotalEnergy\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalEnergy\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", - "\n", - "\n", - "\n", - "50_TotalVolume\n", - "\n", - "50_TotalVolume\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalVolume\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", - "\n", - "\n", - "\n", - "Activity\n", - "\n", - "Activity\n", - "\n", - "\n", - "\n", - "activity_50->Activity\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "method_50\n", - "\n", - "method_50\n", - "\n", - "\n", - "\n", - "activity_50->method_50\n", - "\n", - "\n", - "asmo.hasComputationalMethod\n", - "\n", - "\n", - "\n", - "asmo.StructureOptimization\n", - "\n", - "asmo.StructureOptimization\n", - "\n", - "\n", - "\n", - "activity_50->asmo.StructureOptimization\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "temperature_50\n", - "\n", - "temperature_50\n", - "\n", - "\n", - "\n", - "activity_50->temperature_50\n", - "\n", - "\n", - "asmo.hasInputParameter\n", - "\n", - "\n", - "\n", - "pressure_50\n", - "\n", - "pressure_50\n", - "\n", - "\n", - "\n", - "activity_50->pressure_50\n", - "\n", - "\n", - "asmo.hasInputParameter\n", - "\n", - "\n", - "\n", - "asmo.AtomicPosition\n", - "\n", - "asmo.AtomicPosition\n", - "\n", - "\n", - "\n", - "activity_50->asmo.AtomicPosition\n", - "\n", - "\n", - "asmo.hasRelaxationDOF\n", - "\n", - "\n", - "\n", - "asmo.CellVolume\n", - "\n", - "asmo.CellVolume\n", - "\n", - "\n", - "\n", - "activity_50->asmo.CellVolume\n", - "\n", - "\n", - "asmo.hasRelaxationDOF\n", - "\n", - "\n", - "\n", - "asmo.MolecularDynamics\n", - "\n", - "asmo.MolecularDynamics\n", - "\n", - "\n", - "\n", - "method_50->asmo.MolecularDynamics\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "potential_50\n", - "\n", - "potential_50\n", - "\n", - "\n", - "\n", - "method_50->potential_50\n", - "\n", - "\n", - "asmo.hasInteratomicPotential\n", - "\n", - "\n", - "\n", - "asmo.Isothermal–isobaricEnsemble\n", - "\n", - "asmo.Isothermal–isobaricEnsemble\n", - "\n", - "\n", - "\n", - "method_50->asmo.Isothermal–isobaricEnsemble\n", - "\n", - "\n", - "asmo.hasStatisticalEnsemble\n", - "\n", - "\n", - "\n", - "asmo.InputParameter\n", - "\n", - "asmo.InputParameter\n", - "\n", - "\n", - "\n", - "temperature_50->asmo.InputParameter\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "unit.K\n", - "\n", - "unit.K\n", - "\n", - "\n", - "\n", - "temperature_50->unit.K\n", - "\n", - "\n", - "asmo.hasUnit\n", - "\n", - "\n", - "\n", - "170a7949-38cd-4e87-96d3-00fe815cdd09\n", - "\n", - "Temperature\n", - "\n", - "\n", - "\n", - "temperature_50->170a7949-38cd-4e87-96d3-00fe815cdd09\n", - "\n", - "\n", - "label\n", - "\n", - "\n", - "\n", - "0b554831-737a-45d3-9f39-dc15c8608724\n", - "\n", - "500.0\n", - "\n", - "\n", - "\n", - "temperature_50->0b554831-737a-45d3-9f39-dc15c8608724\n", - "\n", - "\n", - "asmo.hasValue\n", - "\n", - "\n", - "\n", - "pressure_50->asmo.InputParameter\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "unit.GigaPA\n", - "\n", - "unit.GigaPA\n", - "\n", - "\n", - "\n", - "pressure_50->unit.GigaPA\n", - "\n", - "\n", - "asmo.hasUnit\n", - "\n", - "\n", - "\n", - "2b44569c-5c74-43c4-b460-f3fbed97f198\n", - "\n", - "Pressure\n", - "\n", - "\n", - "\n", - "pressure_50->2b44569c-5c74-43c4-b460-f3fbed97f198\n", - "\n", - "\n", - "label\n", - "\n", - "\n", - "\n", - "1d445962-a957-4fe5-92de-04bbee0b59ce\n", - "\n", - "0.0\n", - "\n", - "\n", - "\n", - "pressure_50->1d445962-a957-4fe5-92de-04bbee0b59ce\n", - "\n", - "\n", - "asmo.hasValue\n", - "\n", - "\n", - "\n", - "asmo.EmbeddedAtomModel\n", - "\n", - "asmo.EmbeddedAtomModel\n", - "\n", - "\n", - "\n", - "potential_50->asmo.EmbeddedAtomModel\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "514a675b-92e9-445e-a516-fee0a41a445a\n", - "\n", - "2001--Mishin-Y--Cu-1--Lammps--Ipr1\n", - "\n", - "\n", - "\n", - "potential_50->514a675b-92e9-445e-a516-fee0a41a445a\n", - "\n", - "\n", - "label\n", - "\n", - "\n", - "\n", - "50_TotalEnergy->activity_50\n", - "\n", - "\n", - "asmo.wasCalculatedBy\n", - "\n", - "\n", - "\n", - "cmso.CalculatedProperty\n", - "\n", - "cmso.CalculatedProperty\n", - "\n", - "\n", - "\n", - "50_TotalEnergy->cmso.CalculatedProperty\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "unit.EV\n", - "\n", - "unit.EV\n", - "\n", - "\n", - "\n", - "50_TotalEnergy->unit.EV\n", - "\n", - "\n", - "asmo.hasUnit\n", - "\n", - "\n", - "\n", - "747b10c4-d037-4943-ad78-c53534dfebba\n", - "\n", - "Totalenergy\n", - "\n", - "\n", - "\n", - "50_TotalEnergy->747b10c4-d037-4943-ad78-c53534dfebba\n", - "\n", - "\n", - "label\n", - "\n", - "\n", - "\n", - "5b9b56f7-107f-4b5d-8b0c-51bd6d8389c6\n", - "\n", - "-13.7346\n", - "\n", - "\n", - "\n", - "50_TotalEnergy->5b9b56f7-107f-4b5d-8b0c-51bd6d8389c6\n", - "\n", - "\n", - "asmo.hasValue\n", - "\n", - "\n", - "\n", - "50_TotalVolume->activity_50\n", - "\n", - "\n", - "asmo.wasCalculatedBy\n", - "\n", - "\n", - "\n", - "50_TotalVolume->cmso.CalculatedProperty\n", - "\n", - "\n", - "type\n", - "\n", - "\n", - "\n", - "unit.ANGSTROM3\n", - "\n", - "unit.ANGSTROM3\n", - "\n", - "\n", - "\n", - "50_TotalVolume->unit.ANGSTROM3\n", - "\n", - "\n", - "asmo.hasUnit\n", - "\n", - "\n", - "\n", - "edeb1402-2214-4526-901f-588bcfbf5c52\n", - "\n", - "Totalvolume\n", - "\n", - "\n", - "\n", - "50_TotalVolume->edeb1402-2214-4526-901f-588bcfbf5c52\n", - "\n", - "\n", - "label\n", - "\n", - "\n", - "\n", - "c09cfc39-f239-4fe1-be76-ad2164b800c1\n", - "\n", - "48.2558\n", - "\n", - "\n", - "\n", - "50_TotalVolume->c09cfc39-f239-4fe1-be76-ad2164b800c1\n", - "\n", - "\n", - "asmo.hasValue\n", - "\n", - "\n", - "\n", - "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", - "\n", - "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", + "sample_d8e7688b-117c-4851-bbf9-00f2d0373a69\n", + "\n", + "sample_d8e7688b-117c-4851-bbf9-00f2d0373a69\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -660,7 +186,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "The job j1 was saved and received the ID: 50\n" + "The job j1 was saved and received the ID: 52\n" ] } ], @@ -695,469 +221,399 @@ "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", - "\n", - "sample_7255e130-c644-4e92-8c0d-d50450623f29\n", + "sample_d8e7688b-117c-4851-bbf9-00f2d0373a69\n", + "\n", + "sample_d8e7688b-117c-4851-bbf9-00f2d0373a69\n", "\n", - "\n", + "\n", "\n", - "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", - "\n", - "sample_a00e8982-3973-4820-8e5b-0334b898d449\n", - "\n", - "\n", - "\n", - "sample_31171300-d463-4273-91ea-e4e096142b96\n", - "\n", - "sample_31171300-d463-4273-91ea-e4e096142b96\n", + "sample_6a085219-8a90-44c6-aec8-e46cb6f0e693\n", + "\n", + "sample_6a085219-8a90-44c6-aec8-e46cb6f0e693\n", "\n", - "\n", - "\n", - "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", - "\n", - "sample_3eca5579-69e1-49d1-aad6-68dece95000e\n", - "\n", - "\n", - "\n", - "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", - "\n", - "sample_90d40147-910f-4b0a-b637-f6edf0805ca8\n", - "\n", - "\n", - "\n", - "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", - "\n", - "sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", - "\n", - "\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", - "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417\n", - "\n", - "\n", + "\n", "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->sample_4d3d64e6-35b1-4ea3-b9af-60d457d24392\n", - "\n", - "\n", - "wasDerivedFrom\n", + "sample_6a085219-8a90-44c6-aec8-e46cb6f0e693->sample_d8e7688b-117c-4851-bbf9-00f2d0373a69\n", + "\n", + "\n", + "wasDerivedFrom\n", "\n", - "\n", - "\n", - "activity_50\n", - "\n", - "activity_50\n", + "\n", + "\n", + "activity_52\n", + "\n", + "activity_52\n", "\n", - "\n", + "\n", "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->activity_50\n", - "\n", - "\n", - "wasGeneratedBy\n", + "sample_6a085219-8a90-44c6-aec8-e46cb6f0e693->activity_52\n", + "\n", + "\n", + "wasGeneratedBy\n", "\n", - "\n", - "\n", - "50_TotalEnergy\n", - "\n", - "50_TotalEnergy\n", + "\n", + "\n", + "52_TotalEnergy\n", + "\n", + "52_TotalEnergy\n", "\n", - "\n", + "\n", "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalEnergy\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", + "sample_6a085219-8a90-44c6-aec8-e46cb6f0e693->52_TotalEnergy\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", "\n", - "\n", - "\n", - "50_TotalVolume\n", - "\n", - "50_TotalVolume\n", + "\n", + "\n", + "52_TotalVolume\n", + "\n", + "52_TotalVolume\n", "\n", - "\n", + "\n", "\n", - "sample_e633fe84-453a-432e-a469-9d59ab68c417->50_TotalVolume\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", + "sample_6a085219-8a90-44c6-aec8-e46cb6f0e693->52_TotalVolume\n", + "\n", + "\n", + "cmso.hasCalculatedProperty\n", "\n", - "\n", - "\n", - "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", - "\n", - "sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", - "\n", - "\n", - "\n", - "method_50\n", - "\n", - "method_50\n", + "\n", + "\n", + "method_52\n", + "\n", + "method_52\n", "\n", - "\n", + "\n", "\n", - "activity_50->method_50\n", - "\n", - "\n", - "asmo.hasComputationalMethod\n", + "activity_52->method_52\n", + "\n", + "\n", + "asmo.hasComputationalMethod\n", "\n", "\n", - "\n", + "\n", "asmo.AtomicPosition\n", - "\n", - "asmo.AtomicPosition\n", + "\n", + "asmo.AtomicPosition\n", "\n", - "\n", + "\n", "\n", - "activity_50->asmo.AtomicPosition\n", - "\n", - "\n", - "asmo.hasRelaxationDOF\n", + "activity_52->asmo.AtomicPosition\n", + "\n", + "\n", + "asmo.hasRelaxationDOF\n", "\n", "\n", - "\n", + "\n", "asmo.CellVolume\n", - "\n", - "asmo.CellVolume\n", + "\n", + "asmo.CellVolume\n", "\n", - "\n", + "\n", "\n", - "activity_50->asmo.CellVolume\n", - "\n", - "\n", - "asmo.hasRelaxationDOF\n", + "activity_52->asmo.CellVolume\n", + "\n", + "\n", + "asmo.hasRelaxationDOF\n", "\n", - "\n", - "\n", - "temperature_50\n", - "\n", - "temperature_50\n", + "\n", + "\n", + "temperature_52\n", + "\n", + "temperature_52\n", "\n", - "\n", + "\n", "\n", - "activity_50->temperature_50\n", - "\n", - "\n", - "asmo.hasInputParameter\n", + "activity_52->temperature_52\n", + "\n", + "\n", + "asmo.hasInputParameter\n", "\n", - "\n", - "\n", - "pressure_50\n", - "\n", - "pressure_50\n", + "\n", + "\n", + "pressure_52\n", + "\n", + "pressure_52\n", "\n", - "\n", + "\n", "\n", - "activity_50->pressure_50\n", - "\n", - "\n", - "asmo.hasInputParameter\n", + "activity_52->pressure_52\n", + "\n", + "\n", + "asmo.hasInputParameter\n", "\n", "\n", - "\n", + "\n", "asmo.Isothermal–isobaricEnsemble\n", - "\n", - "asmo.Isothermal–isobaricEnsemble\n", + "\n", + "asmo.Isothermal–isobaricEnsemble\n", "\n", - "\n", + "\n", "\n", - "method_50->asmo.Isothermal–isobaricEnsemble\n", - "\n", - "\n", - "asmo.hasStatisticalEnsemble\n", + "method_52->asmo.Isothermal–isobaricEnsemble\n", + "\n", + "\n", + "asmo.hasStatisticalEnsemble\n", "\n", - "\n", - "\n", - "potential_50\n", - "\n", - "potential_50\n", + "\n", + "\n", + "potential_52\n", + "\n", + "potential_52\n", "\n", - "\n", + "\n", "\n", - "method_50->potential_50\n", - "\n", - "\n", - "asmo.hasInteratomicPotential\n", + "method_52->potential_52\n", + "\n", + "\n", + "asmo.hasInteratomicPotential\n", "\n", "\n", - "\n", + "\n", "matwerk.E457491\n", - "\n", - "matwerk.E457491\n", - "\n", - "\n", - "\n", - "method_50->matwerk.E457491\n", - "\n", - "\n", - "wasAssociatedWith\n", - "\n", - "\n", - "\n", - "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0\n", - "\n", - "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0\n", + "\n", + "matwerk.E457491\n", "\n", - "\n", + "\n", "\n", - "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->sample_eff249bf-3e51-4842-8ee4-2d21dbc9cf37\n", - "\n", - "\n", - "wasDerivedFrom\n", - "\n", - "\n", - "\n", - "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->activity_50\n", - "\n", - "\n", - "wasGeneratedBy\n", - "\n", - "\n", - "\n", - "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->50_TotalEnergy\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", - "\n", - "\n", - "\n", - "sample_7ca1c3c0-4d1d-4b4c-ae6e-25267e204ff0->50_TotalVolume\n", - "\n", - "\n", - "cmso.hasCalculatedProperty\n", + "method_52->matwerk.E457491\n", + "\n", + "\n", + "wasAssociatedWith\n", "\n", "\n", - "\n", + "\n", "unit.K\n", - "\n", - "unit.K\n", + "\n", + "unit.K\n", "\n", - "\n", + "\n", "\n", - "temperature_50->unit.K\n", - "\n", - "\n", - "asmo.hasUnit\n", + "temperature_52->unit.K\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "3e24a6fa-26bf-4ddc-af88-99271ac841b7\n", - "\n", - "Temperature\n", + "\n", + "\n", + "2f52cdc1-de9d-4ece-ba7b-9f0490dcc4b3\n", + "\n", + "Temperature\n", "\n", - "\n", - "\n", - "temperature_50->3e24a6fa-26bf-4ddc-af88-99271ac841b7\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "temperature_52->2f52cdc1-de9d-4ece-ba7b-9f0490dcc4b3\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "c5a19830-28c1-4d87-b914-89766a3dc67a\n", - "\n", - "500.0\n", + "\n", + "\n", + "0763a038-ba3b-430f-9236-9124f66ba771\n", + "\n", + "500.0\n", "\n", - "\n", - "\n", - "temperature_50->c5a19830-28c1-4d87-b914-89766a3dc67a\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "temperature_52->0763a038-ba3b-430f-9236-9124f66ba771\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", "\n", - "\n", + "\n", "unit.GigaPA\n", - "\n", - "unit.GigaPA\n", + "\n", + "unit.GigaPA\n", "\n", - "\n", + "\n", "\n", - "pressure_50->unit.GigaPA\n", - "\n", - "\n", - "asmo.hasUnit\n", + "pressure_52->unit.GigaPA\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "7bb6f5b8-ff70-4056-a3cc-4d3c9fd510ff\n", - "\n", - "Pressure\n", + "\n", + "\n", + "12e3e26c-6458-4747-8c25-9b26a00b7ae2\n", + "\n", + "Pressure\n", "\n", - "\n", - "\n", - "pressure_50->7bb6f5b8-ff70-4056-a3cc-4d3c9fd510ff\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "pressure_52->12e3e26c-6458-4747-8c25-9b26a00b7ae2\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "c402ee74-ffc2-487e-9521-d4599a16514e\n", - "\n", - "0.0\n", + "\n", + "\n", + "5cba3b81-e74c-447d-95e8-3a54cd5e4b32\n", + "\n", + "0.0\n", "\n", - "\n", - "\n", - "pressure_50->c402ee74-ffc2-487e-9521-d4599a16514e\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "pressure_52->5cba3b81-e74c-447d-95e8-3a54cd5e4b32\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", - "\n", - "\n", - "9c6ada05-b00e-4af5-8089-a082b188303b\n", - "\n", - "2001--Mishin-Y--Cu-1--Lammps--Ipr1\n", + "\n", + "\n", + "5b2bd4f0-76ce-402a-a8d5-e07f70a21c98\n", + "\n", + "2001--Mishin-Y--Cu-1--Lammps--Ipr1\n", "\n", - "\n", - "\n", - "potential_50->9c6ada05-b00e-4af5-8089-a082b188303b\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "potential_52->5b2bd4f0-76ce-402a-a8d5-e07f70a21c98\n", + "\n", + "\n", + "label\n", "\n", - "\n", + "\n", "\n", - "50_TotalEnergy->activity_50\n", - "\n", - "\n", - "asmo.wasCalculatedBy\n", + "52_TotalEnergy->activity_52\n", + "\n", + "\n", + "asmo.wasCalculatedBy\n", "\n", "\n", - "\n", + "\n", "unit.EV\n", - "\n", - "unit.EV\n", + "\n", + "unit.EV\n", "\n", - "\n", + "\n", "\n", - "50_TotalEnergy->unit.EV\n", - "\n", - "\n", - "asmo.hasUnit\n", + "52_TotalEnergy->unit.EV\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "530b7c73-cec0-4d7e-9a0c-c507c45a02e5\n", - "\n", - "Totalenergy\n", + "\n", + "\n", + "188b1a42-43c8-4a00-9ba7-c7a0714c16a0\n", + "\n", + "Totalenergy\n", "\n", - "\n", - "\n", - "50_TotalEnergy->530b7c73-cec0-4d7e-9a0c-c507c45a02e5\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "52_TotalEnergy->188b1a42-43c8-4a00-9ba7-c7a0714c16a0\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "a844a6dc-93a2-49a2-b50e-25822be9e8c8\n", - "\n", - "-13.7346\n", + "\n", + "\n", + "187b0c07-140e-43dc-98ae-f5cdb96ead29\n", + "\n", + "-13.7346\n", "\n", - "\n", - "\n", - "50_TotalEnergy->a844a6dc-93a2-49a2-b50e-25822be9e8c8\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "52_TotalEnergy->187b0c07-140e-43dc-98ae-f5cdb96ead29\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", - "\n", + "\n", "\n", - "50_TotalVolume->activity_50\n", - "\n", - "\n", - "asmo.wasCalculatedBy\n", + "52_TotalVolume->activity_52\n", + "\n", + "\n", + "asmo.wasCalculatedBy\n", "\n", "\n", - "\n", + "\n", "unit.ANGSTROM3\n", - "\n", - "unit.ANGSTROM3\n", + "\n", + "unit.ANGSTROM3\n", "\n", - "\n", + "\n", "\n", - "50_TotalVolume->unit.ANGSTROM3\n", - "\n", - "\n", - "asmo.hasUnit\n", + "52_TotalVolume->unit.ANGSTROM3\n", + "\n", + "\n", + "asmo.hasUnit\n", "\n", - "\n", - "\n", - "0ac3490e-672b-467b-b75e-843f37aed5d1\n", - "\n", - "Totalvolume\n", + "\n", + "\n", + "e1402a80-e0dd-407d-9ad6-832d28fe46df\n", + "\n", + "Totalvolume\n", "\n", - "\n", - "\n", - "50_TotalVolume->0ac3490e-672b-467b-b75e-843f37aed5d1\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "52_TotalVolume->e1402a80-e0dd-407d-9ad6-832d28fe46df\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "805d3d26-a251-433e-ab1d-9299f9e2978d\n", - "\n", - "48.2558\n", + "\n", + "\n", + "86ee43ac-61a6-4a7a-ab99-0bb7b9fec751\n", + "\n", + "48.2558\n", "\n", - "\n", - "\n", - "50_TotalVolume->805d3d26-a251-433e-ab1d-9299f9e2978d\n", - "\n", - "\n", - "asmo.hasValue\n", + "\n", + "\n", + "52_TotalVolume->86ee43ac-61a6-4a7a-ab99-0bb7b9fec751\n", + "\n", + "\n", + "asmo.hasValue\n", "\n", "\n", - "\n", + "\n", "matwerk.E447986\n", - "\n", - "matwerk.E447986\n", + "\n", + "matwerk.E447986\n", "\n", "\n", - "\n", + "\n", "matwerk.E457491->matwerk.E447986\n", - "\n", - "\n", - "actedOnBehalfOf\n", + "\n", + "\n", + "actedOnBehalfOf\n", "\n", - "\n", - "\n", - "fba00ae5-f3d0-49ed-bfef-e7c4fc60665a\n", - "\n", - "Pyiron\n", + "\n", + "\n", + "dc0c28b4-24d4-4df7-98fc-ba818b5cdc2b\n", + "\n", + "Pyiron\n", "\n", - "\n", - "\n", - "matwerk.E457491->fba00ae5-f3d0-49ed-bfef-e7c4fc60665a\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "matwerk.E457491->dc0c28b4-24d4-4df7-98fc-ba818b5cdc2b\n", + "\n", + "\n", + "label\n", "\n", - "\n", - "\n", - "9b2379c3-87b2-416b-beca-de848d2468b4\n", - "\n", - "Lammps\n", + "\n", + "\n", + "a85302aa-be2f-4731-b70a-b8a50af24200\n", + "\n", + "Lammps\n", "\n", - "\n", - "\n", - "matwerk.E447986->9b2379c3-87b2-416b-beca-de848d2468b4\n", - "\n", - "\n", - "label\n", + "\n", + "\n", + "matwerk.E447986->a85302aa-be2f-4731-b70a-b8a50af24200\n", + "\n", + "\n", + "label\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 14, From 60f2726b62e740ef697432fb19cea262c601017b Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 2 May 2024 20:10:06 +0200 Subject: [PATCH 12/12] modify tests --- tests/test_workflow.py | 49 ++---------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/tests/test_workflow.py b/tests/test_workflow.py index c0d68bc..3929212 100644 --- a/tests/test_workflow.py +++ b/tests/test_workflow.py @@ -6,51 +6,6 @@ import shutil def test_wf_creation(): - s = KnowledgeGraph() - wf = Workflow(s) + kg = KnowledgeGraph() + #kg.enable_workflow(pr, workflow_environment='pyiron') -def test_lattice_props(): - s = KnowledgeGraph() - wf = Workflow(s) - parent_sys = System.create.element.Cr(graph=s) - #add some defects - parent_sys.delete(indices=[0]) - child_sys = System.create.element.Cr(graph=s) - #trick workflow and add info - wf.parent_sample = parent_sys.sample - wf.structure = child_sys - wf.sample = child_sys.sample - wf.add_structural_relation() - - -def test_add_method(): - for pot in ['meam', 'eam', 'lj', 'ace', 'nequip']: - s = KnowledgeGraph() - wf = Workflow(s) - parent_sys = System.create.element.Cr(graph=s) - #add some defects - parent_sys.delete(indices=[0]) - child_sys = System.create.element.Cr(graph=s) - #trick workflow and add info - wf.parent_sample = parent_sys.sample - wf.structure = child_sys - wf.sample = child_sys.sample - wf.add_structural_relation() - wf.main_id = 2314 - wf.mdict = {"method": "MolecularDynamics", - "temperature": 100, - "pressure": 0, - "dof": ["AtomicPosition", "CellVolume"], - "ensemble": "IsothermalisobaricEnsemble", - "id": 2314, - "potential": {"uri": "https://doi.org/xxx", - "type": pot, - "label": "string" }, - "workflow_manager": {"uri": "xxxx", - "label": "pyiron"}, - "software": [ {"uri": "xxxx", "label": "lammps"},], - "outputs": [{"label": "TotalEnergy", "value": 2.301, "unit": "EV", - "associate_to_sample": True}], - "inputs": [ {"label": "AnotherInput", "value": 0.1, "unit": None },] - } - wf.add_method()