Skip to content

Commit

Permalink
Merge pull request #50 from pyscal/query_building
Browse files Browse the repository at this point in the history
Query building
  • Loading branch information
srmnitc authored Nov 28, 2023
2 parents ceea7d3 + 4c9b981 commit 44e8585
Show file tree
Hide file tree
Showing 27 changed files with 15,606 additions and 3,865 deletions.
7,802 changes: 4,330 additions & 3,472 deletions examples/01_getting_started.ipynb

Large diffs are not rendered by default.

1,597 changes: 1,597 additions & 0 deletions examples/02_grain_boundaries.ipynb

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions examples/02_using_databases.ipynb

This file was deleted.

120 changes: 120 additions & 0 deletions notebooks/create_onto.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"id": "0480f3cb-a9df-4dff-89b6-95747572fb39",
"metadata": {},
"outputs": [],
"source": [
"from owlready2 import *"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "cdab09a3-b991-4c6f-ab11-3d630293e2a9",
"metadata": {},
"outputs": [],
"source": [
"onto = get_ontology(\"http://purls.helmholtz-metadaten.de/msmo/\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "8f470001-3a9c-4cd0-817f-57fa06a10da0",
"metadata": {},
"outputs": [],
"source": [
"class Calculation(Thing):\n",
" namespace = onto\n",
"\n",
"class hasMethod(Calculation >> ComputationalMethod):\n",
" pass\n",
" \n",
"class ComputationalMethod(Thing):\n",
" namespace = onto\n",
"\n",
"#Atomistic Method\n",
"class AtomisticMethod(ComputationalMethod):\n",
" pass\n",
"\n",
"class DensityFunctionalTheory(AtomisticMethod):\n",
" pass\n",
"\n",
"class MolecularDynamics(AtomisticMethod):\n",
" pass\n",
"\n",
"class MolecularDynamicsMinimization(MolecularDynamics):\n",
" pass\n",
"\n",
"class MolecularDynamicsNPT(MolecularDynamics):\n",
" pass\n",
"\n",
"class MolecularDynamicsNVT(MolecularDynamics):\n",
" pass\n",
"\n",
"#data properties\n",
"class hasPressure(MolecularDynamics >> float):\n",
" pass\n",
"\n",
"class hasTemperature(MolecularDynamics >> float):\n",
" pass\n",
"\n",
"class usesPotential(MolecularDynamics >> str):\n",
" pass\n",
"\n",
"class AbinitioMolecularDynamics(AtomisticMethod):\n",
" pass\n",
"\n",
"\n",
"#Monte Carlo\n",
"class MonteCarloMethod(ComputationalMethod):\n",
" pass\n",
"\n",
"class KineticMonteCarloMethod(MonteCarloMethod):\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "677852fc-e05a-4922-a808-47761f25ffcb",
"metadata": {},
"outputs": [],
"source": [
"onto.save(file = \"msmo.owl\", format = \"rdfxml\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "22b6e284-2b54-4851-a379-1a8df26f4705",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
142 changes: 142 additions & 0 deletions notebooks/data_read.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "bec4e0e1-2e16-4241-89e0-a7bbf8a53d8c",
"metadata": {},
"source": [
"# DC3 dataset"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "df95f07a-00a8-42f9-9a18-ba8532a5a512",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from pyscal3.core import System\n",
"import pyscal3.crystal_structures as pcs"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "00abae5c-4123-4456-8144-cf6362ea2bfd",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sys = System('datasets/T_0.04Tm_snapshot_1')"
]
},
{
"cell_type": "markdown",
"id": "2be601e0-9ea5-4c63-9cd6-67e99fa95306",
"metadata": {},
"source": [
"Lacks all information about the underlying structure:\n",
"\n",
"- species (LAMMPS)\n",
"- lattice constant \n",
"- Crystal structure name\n",
"- Bravais lattice\n",
"- Basis positions\n",
"- Basis occupancy\n",
"- Lattice vectors\n",
"- Space group symbol (?)\n",
"- Space group name (?)"
]
},
{
"cell_type": "markdown",
"id": "5ba58cff-3b6b-44b9-ad5b-92e14e61d517",
"metadata": {},
"source": [
"How we do currently"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "dd472cdf-ef2c-4ad4-9852-39370c715f5a",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Al\n"
]
}
],
"source": [
"atoms, box, sdict = pcs.make_crystal('fcc', lattice_constant=1,\n",
" element='Al', return_structure_dict=True)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "aed4d624-b25a-48b3-8bbe-6140acc5e711",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"{'natoms': 4,\n",
" 'species': [1, 1, 1, 1],\n",
" 'scaling_factors': [1.0, 1.0, 1.0],\n",
" 'positions': [[0.0, 0.0, 0.0],\n",
" [0.5, 0.0, 0.5],\n",
" [0.0, 0.5, 0.5],\n",
" [0.5, 0.5, 0.0]]}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sdict"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "712b32c7-1d6b-4fbb-ae65-64dbebc5a3b2",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit 44e8585

Please sign in to comment.