Skip to content

Commit

Permalink
Added Ions Database Search Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepe-Marquez committed Nov 19, 2024
1 parent 0a881f6 commit fa47fe3
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ where = ["src"]
perovskite_solar_cell = "perovskite_solar_cell_database:perovskite_solar_cell"
solar_cell_app = "perovskite_solar_cell_database.apps:solar_cells"
perovskite_composition = "perovskite_solar_cell_database:perovskite_composition"
ion_parser = "perovskite_solar_cell_database:ion_parser"
ion_parser = "perovskite_solar_cell_database:ion_parser"
perovskite_ions_app = "perovskite_solar_cell_database.apps:perovskite_ions"
12 changes: 12 additions & 0 deletions src/perovskite_solar_cell_database/apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from nomad.config.models.plugins import AppEntryPoint

from perovskite_solar_cell_database.apps.perovskite_ions_app import perovskite_ions_app
from perovskite_solar_cell_database.apps.solar_cell_app import solar_cell_app

solar_cells = AppEntryPoint(
Expand All @@ -12,3 +13,14 @@
""",
app=solar_cell_app,
)

perovskite_ions = AppEntryPoint(
name='Halide Perovskite Ions',
description="""
This app allows you to search **ions of halide perovskites** within NOMAD. The filter
menu on the left and the shown default columns are specifically designed
for perovskite ions exploration. The dashboard directly shows useful
interactive statistics about the data.
""",
app=perovskite_ions_app,
)
81 changes: 81 additions & 0 deletions src/perovskite_solar_cell_database/apps/perovskite_ions_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import yaml
from nomad.config.models.ui import (
App,
Axis,
Column,
Dashboard,
Menu,
MenuItemHistogram,
MenuItemTerms,
SearchQuantities,
)

schemas = [
'*#perovskite_solar_cell_database.composition.PerovskiteAIon',
'*#perovskite_solar_cell_database.composition.PerovskiteBIon',
'*#perovskite_solar_cell_database.composition.PerovskiteXIon',
]
# noqa: E501
perovskite_ions_app = App(
label='Halide Perovskite Ions Database',
path='perovskite-ions',
category='Halide Perovskites',
description='Search Ions Used in Halide Perovskites',
search_quantities=SearchQuantities(include=schemas),
columns=[
Column(quantity='results.material.elements', selected=True),
Column(
quantity='results.material.chemical_formula_iupac',
selected=True,
),
Column(
quantity='data.iupac_name#perovskite_solar_cell_database.composition.PerovskiteAIon',
selected=True,
title='IUPAC Name',
),
Column(
quantity='data.smiles#perovskite_solar_cell_database.composition.PerovskiteAIon',
selected=True,
title='SMILES',
),
],
menu=Menu(
title='Ions Database',
items=[
MenuItemTerms(
quantity='data.abbreviation#perovskite_solar_cell_database.composition.PerovskiteAIon',
show_input=True,
title='A cation Abbreviation',
),
MenuItemTerms(
quantity='data.smiles#perovskite_solar_cell_database.composition.PerovskiteAIon',
show_input=True,
title='A cation SMILES',
),
MenuItemTerms(
quantity='data.iupac_name#perovskite_solar_cell_database.composition.PerovskiteAIon',
show_input=True,
),
MenuItemHistogram(x=Axis(search_quantity='results.material.n_elements')),
],
),
dashboard=Dashboard.parse_obj(
yaml.safe_load(
"""
widgets:
- layout:
xxl: {minH: 8, minW: 12, h: 9, w: 13, y: 0, x: 0}
xl: {minH: 8, minW: 12, h: 9, w: 12, y: 0, x: 0}
lg: {minH: 8, minW: 12, h: 8, w: 12, y: 0, x: 0}
md: {minH: 8, minW: 12, h: 8, w: 12, y: 0, x: 0}
sm: {minH: 8, minW: 12, h: 8, w: 12, y: 0, x: 0}
type: periodictable
scale: linear
quantity: results.material.elements
"""
)
),
filters_locked={
'results.eln.sections': ['PerovskiteAIon', 'PerovskiteBIon', 'PerovskiteXIon']
},
)
2 changes: 1 addition & 1 deletion src/perovskite_solar_cell_database/apps/solar_cell_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
label: Solar Cells
path: solarcells
category: Use Cases
category: Halide Perovskites
description: Search solar cells
readme: 'This page allows you to search **solar cell data**
within NOMAD. The filter menu on the left and the shown
Expand Down

0 comments on commit fa47fe3

Please sign in to comment.