Skip to content

Commit

Permalink
Cleaning some of the folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepe-Marquez committed Oct 11, 2024
1 parent cb88a03 commit c171666
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1,722 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"cell_type": "markdown",
"metadata": {},
"outputs": [
{
"ename": "ImportError",
"evalue": "cannot import name 'AnalysisSettings' from 'nomad_auto_xrd.auto_xrd_analysis' (/home/pepe_marquez/NOMAD/nomad/plugins/nomad-auto-xrd/src/nomad_auto_xrd/auto_xrd_analysis.py)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[8], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnomad_auto_xrd\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mauto_xrd_analysis\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m (\n\u001b[1;32m 2\u001b[0m AnalysisSettings,\n\u001b[1;32m 3\u001b[0m run_analysis_existing_spectra,\n\u001b[1;32m 4\u001b[0m run_analysis_with_patterns_archive,\n\u001b[1;32m 5\u001b[0m )\n",
"\u001b[0;31mImportError\u001b[0m: cannot import name 'AnalysisSettings' from 'nomad_auto_xrd.auto_xrd_analysis' (/home/pepe_marquez/NOMAD/nomad/plugins/nomad-auto-xrd/src/nomad_auto_xrd/auto_xrd_analysis.py)"
]
}
],
"source": [
"from nomad_auto_xrd.auto_xrd_analysis import (\n",
" AnalysisSettings,\n",
" run_analysis_existing_spectra,\n",
" run_analysis_with_patterns_archive,\n",
")\n"
"# Running Auto XRD Analysis\n",
"\n",
"We can now run inference in our train models. We will data coming from a NOMAD archive in \n",
"the first example and the mdoels that we have in the archive."
]
},
{
Expand All @@ -32,15 +17,28 @@
"outputs": [],
"source": [
"# from nomad_auto_xrd.auto_xrd_analysis import run_analysis\n",
"\n",
"settings = AnalysisSettings(\n",
" # structure_references_directory='References',\n",
" # xrd_model='Models/XRD_Model.h5',\n",
" max_phases=5,\n",
" min_confidence=30,\n",
" include_pdf=True,\n",
"from nomad_auto_xrd.auto_xrd_analysis import (\n",
" AnalysisSettings,\n",
" run_analysis_existing_spectra,\n",
" run_analysis_with_patterns_archive,\n",
")\n",
"run_analysis_with_patterns_archive(settings, 'model_metadata.archive.json', 'xrd_archive.json', 'custom_results.json')"
"\n",
"settings = AnalysisSettings()\n",
"run_analysis_with_patterns_archive(\n",
" settings,\n",
" 'model_metadata.archive.json',\n",
" 'xrd_archive.json',\n",
" 'custom_results.json'\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Optionally, we can run it as it is classically done in AutoXRD, specifying the model path,\n",
"the path to the cif files and the path to the folder where the patterns are located in \n",
"`.xy` format. We can also override the default parameters of the model."
]
},
{
Expand All @@ -49,6 +47,7 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"settings = AnalysisSettings(\n",
" structure_references_directory='References',\n",
" patterns_folder_directory='Spectra',\n",
Expand All @@ -57,7 +56,10 @@
" min_confidence=30,\n",
" include_pdf=True,\n",
")\n",
"run_analysis_existing_spectra(settings, 'model_metadata.archive.json', 'custom_results.json')"
"run_analysis_existing_spectra(\n",
" settings,\n",
" 'model_metadata.archive.json',\n",
" 'custom_results.json')"
]
}
],
Expand Down
Loading

0 comments on commit c171666

Please sign in to comment.