Skip to content

Commit

Permalink
Add initial example (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
NinadBhat committed Jul 15, 2024
1 parent d75f396 commit 891ea44
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions examples/1_Getting_Started.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Getting Started"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from atomid.annotate import AnnotateCrystal"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Read crystal structure file"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1. Using read_crystal_structure_file function"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"file_path = \"../tests/data/fcc/Al/no_defect/Al.cif\"\n",
"\n",
"annotate_crystal = AnnotateCrystal()\n",
"\n",
"annotate_crystal.read_crystal_structure_file(file_path)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2. Read file during class initiation"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"file_path = \"../tests/data/fcc/Al/no_defect/Al.cif\"\n",
"\n",
"annotate_crystal = AnnotateCrystal(file_path)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Identify Crystal Structure"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[92mCrystal structure: fcc\u001b[0m\n",
"\u001b[92mLattice constant: 4.05\u001b[0m\n"
]
}
],
"source": [
"annotate_crystal.identify_crystal_structure()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Annoate Crystal Structure \n",
"Is identified crystal structures is satisfactory add information to the knowledge graph"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"annotate_crystal.annotate_crystal_structure()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Write ouput crystal structure file"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"annotate_crystal.write_to_file(\"crystal_kg.ttl\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "atomid-venv",
"language": "python",
"name": "atomid-venv"
},
"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.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit 891ea44

Please sign in to comment.