Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scatter plot #37

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/eu_funding_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/solmates_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/how_to/add_a_new_ion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# how to add a new ion to the database

!!! note "Attention"
TODO
8 changes: 8 additions & 0 deletions docs/how_to/create_a_perovskite_composition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# How to create a perovskite composition

A standarized perovskite composition entry can be created using the ions database.
To create one you would need to follow the steps below in which we will create a Cs<sub>0.05</sub>FA<sub>0.76</sub>MA<sub>0.16</sub>PbBr<sub>1.5</sub>I<sub>1.5</sub>
composition entry:

<iframe src="https://scribehow.com/embed/How_to_Create_a_New_Perovskite_Composition_Upload__HdNr9pn5S_2jFM5Ii4FYkA?removeLogo=true" width="100%" height="640" allowfullscreen frameborder="0"></iframe>

4 changes: 4 additions & 0 deletions docs/how_to/export_a_cation_structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# how to add a new ion to the database

!!! note "Attention"
TODO
4 changes: 2 additions & 2 deletions docs/how_to/install_this_plugin.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Install This Plugin

!!! note "Attention"
TODO
This plugin can be installed in an exiting NOMAD Oasis installation by following
the steps described in the [NOMAD documentation](https://nomad-lab.eu/prod/v1/staging/docs/howto/oasis/plugins_install.html).
4 changes: 4 additions & 0 deletions docs/how_to/search_for_ions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# how to add a new ion to the database

!!! note "Attention"
TODO
10 changes: 0 additions & 10 deletions docs/how_to/use_this_plugin.md

This file was deleted.

50 changes: 27 additions & 23 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,53 @@
# Welcome to the `nomad-perovskite-solar-cells-database` documentation

[![NOMAD](https://img.shields.io/badge/Open%20NOMAD-lightgray?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI3LjUuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxNTAwIDE1MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDE1MDAgMTUwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMxOTJFODY7c3Ryb2tlOiMxOTJFODY7c3Ryb2tlLXdpZHRoOjE0MS4zMjI3O3N0cm9rZS1taXRlcmxpbWl0OjEwO30KCS5zdDF7ZmlsbDojMkE0Q0RGO3N0cm9rZTojMkE0Q0RGO3N0cm9rZS13aWR0aDoxNDEuMzIyNztzdHJva2UtbWl0ZXJsaW1pdDoxMDt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMTM2LjQsNjM2LjVjMTUwLjgsMCwyNzMuMS0xMjEuOSwyNzMuMS0yNzIuMlMxMjg3LjIsOTIuMSwxMTM2LjQsOTIuMWMtMTUwLjgsMC0yNzMuMSwxMjEuOS0yNzMuMSwyNzIuMgoJUzk4NS42LDYzNi41LDExMzYuNCw2MzYuNXoiLz4KPHBhdGggY2xhc3M9InN0MSIgZD0iTTEzMjksOTQ2Yy0xMDYuNC0xMDYtMjc4LjgtMTA2LTM4Ni4xLDBjLTk5LjYsOTkuMy0yNTguNywxMDYtMzY1LjEsMTguMWMtNi43LTcuNi0xMy40LTE2LjItMjEuMS0yMy45CgljLTEwNi40LTEwNi0xMDYuNC0yNzgsMC0zODQuOWMxMDYuNC0xMDYsMTA2LjQtMjc4LDAtMzg0LjlzLTI3OC44LTEwNi0zODYuMSwwYy0xMDcuMywxMDYtMTA2LjQsMjc4LDAsMzg0LjkKCWMxMDYuNCwxMDYsMTA2LjQsMjc4LDAsMzg0LjljLTYzLjIsNjMtODkuMSwxNTAtNzYuNywyMzIuMWM3LjcsNTcuMywzMy41LDExMy43LDc3LjYsMTU3LjZjMTA2LjQsMTA2LDI3OC44LDEwNiwzODYuMSwwCgljMTA2LjQtMTA2LDI3OC44LTEwNiwzODYuMSwwYzEwNi40LDEwNiwyNzguOCwxMDYsMzg2LjEsMEMxNDM1LjQsMTIyNCwxNDM1LjQsMTA1MiwxMzI5LDk0NnoiLz4KPC9zdmc+Cg==)](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells)
![](https://github.com/FAIRmat-NFDI/nomad-measurements/actions/workflows/publish.yml/badge.svg)
![](https://img.shields.io/pypi/pyversions/nomad-measurements)
![](https://img.shields.io/pypi/l/nomad-measurements)
[![NOMAD](https://img.shields.io/badge/Open%20NOMAD-lightgray?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIEl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WMxMDYuNC0xMDYsMTA2LjQtMjc4LDAtMzg0LjlzLTI3OC44LTEwNi0zODYuMSwwYy0xMDcuMywxMDYtMTA2LjQsMjc4LDAsMzg0LjkKCWMxMDYuNCwxMDYsMTA2LjQsMjc4LDAsMzg0LjljLTYzLjIsNjMtODkuMSwxNTAtNzYuNywyMzIuMWM3LjcsNTcuMywzMy41LDExMy43LDc3LjYsMTU3LjZjMTA2LjQsMTA2LDI3OC44LDEwNiwzODYuMSwwCgljMTA2LjQtMTA2LDI3OC44LTEwNiwzODYuMSwwYzEwNi40LDEwNiwyNzguOCwxMDYsMzg2LjEsMEMxNDM1LjQsMTIyNCwxNDM1LjQsMTA1MiwxMzI5LDk0NnoiLz4KPC9zdmc+Cg==)](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells)


## NOMAD Perovskite Solar Cells Database
[<img width="280" alt="image" src="assets/perovskite_database_project.png">](https://www.perovskitedatabase.com/)

### Introduction
Welcome to the NOMAD plugin for the Perovskite Solar Cell Database. This project aims to provide an open-access interface for the perovskite solar cells database in NOMAD making the data accessible and interoperable with many other materials science datasets.
The data can be accessed via the NOMAD API and explored in the [NOMAD Solar Cell APP](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells).
Welcome to the NOMAD plugin for the Perovskite Solar Cell Database.
This project aims to provide an open-access interface for the perovskite solar cells database in NOMAD making the data accessible and interoperable with many other materials science datasets.
The data can be accessed via the NOMAD API and explored in the [NOMAD Solar Cell App](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells).

[<img src="assets/screenshot_nomad_app.png">](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells)
It also contains a database of ions used in halide perovskites and a schema to create standarized perovskite composition entries.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Fix typo: 'standarized' should be 'standardized'

Suggested change
It also contains a database of ions used in halide perovskites and a schema to create standarized perovskite composition entries.
It also contains a database of ions used in halide perovskites and a schema to create standardized perovskite composition entries.


Information about the original database is available at [perovskitedatabase.com](https://www.perovskitedatabase.com/).
[<img src="assets/screenshot_nomad_app.png">](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells)


### Key Features

- Detailed schema of perovskite solar cells.
- The perovskite solar cell database.
- A database of ions used in halide perovskites.
- A schema to create standarized perovskite composition entries.
- Integration with NOMAD for data exploration and access via the API.
- Augmented (meta)data including the elements of the perovskite absorbers and several standardized chemical formulas, enabling an easy featurization of the composition for ML applications.

### Installation
To be completed.

### Acknowledgments
Special thanks to Jinzhao Li and all contributors who have made this project possible.

### Related Resources
- [Original Paper on Nature Energy](https://www.nature.com/articles/s41560-021-00941-3)
- [NOMAD Documentation](https://nomad-lab.eu/prod/v1/staging/docs/)

<div markdown="block" class="home-grid">
<div markdown="block">

### Tutorial

To be completed...

- [Tutorial](tutorial/tutorial.md)
- [Sharing a perovskite composition](tutorial/sharing_a_perovskite_composition.md)

</div>
<div markdown="block">

### How-to guides

Coming soon...

How-to guides provide step-by-step instructions for a wide range of tasks, with the overarching topics:
How-to guides provide step-by-step instructions for a wide range of tasks:

- [Install this plugin](how_to/install_this_plugin.md)
- [Use this plugin](how_to/use_this_plugin.md)
- [Contribute to this plugin](how_to/contribute_to_this_plugin.md)
- [Contribute to the documentation](how_to/contribute_to_the_documentation.md)
- [Search for ions used in halide perovskites](how_to/search_for_ions.md)
- [Add a new ion to the database](how_to/add_a_new_ion.md)
- [Export a cation structure](how_to/export_a_cation_structure.md)
- [Create a perovskite composition](how_to/create_a_perovskite_composition.md)

</div>

Expand All @@ -74,3 +67,14 @@ the possible schema annotations and their arguments, and a glossary of used term

</div>
</div>

### Related Resources
- [Original Paper on Nature Energy](https://www.nature.com/articles/s41560-021-00941-3)
- [NOMAD Documentation](https://nomad-lab.eu/prod/v1/staging/docs/)
- Information about the original database is available at [perovskitedatabase.com](https://www.perovskitedatabase.com/).

### Acknowledgments
Special thanks to Jinzhao Li and all contributors who have made this project possible.
This project is supported by the FAIRmat NFDI initiative and also by by the European Union as part of the SolMates project (Project Nr. 101122288).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Remove duplicate word 'by'

The sentence contains a duplicate 'by'. Consider revising to 'supported by the FAIRmat NFDI initiative and also by the European Union'

Suggested change
This project is supported by the FAIRmat NFDI initiative and also by by the European Union as part of the SolMates project (Project Nr. 101122288).
This project is supported by the FAIRmat NFDI initiative and also by the European Union as part of the SolMates project (Project Nr. 101122288).


<img src="assets/solmates_logo.png" alt="SolMates Logo" width="150"> <img src="assets/eu_funding_logo.png" alt="EU Funding Logo" width="150">
4 changes: 4 additions & 0 deletions docs/tutorial/sharing_a_perovskite_composition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sharing a perovskite composition in NOMAD

!!! note "Attention"
TODO
4 changes: 0 additions & 4 deletions docs/tutorial/tutorial.md

This file was deleted.

27 changes: 17 additions & 10 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
site_name: nomad-perovskite-solar-cells-database
site_description: This is a NOMAD plugin for the perovskite solar cells database.


edit_uri: ""
repo_url: https://github.com/FAIRmat-NFDI/nomad-perovskite-solar-cells-database

nav:
- Home: index.md
- Tutorial: tutorial/tutorial.md
- How-to guides:
- Install this Plugin: how_to/install_this_plugin.md
- Use this Plugin: how_to/use_this_plugin.md
- Install this plugin: how_to/install_this_plugin.md
- Contribute to this plugin: how_to/contribute_to_this_plugin.md
- Contribute to the documentation: how_to/contribute_to_the_documentation.md
- Search for ions: how_to/search_for_ions.md
- Add a new ion: how_to/add_a_new_ion.md
- Export a cation structure: how_to/export_a_cation_structure.md
- Create a perovskite compostion: how_to/create_a_perovskite_composition.md
- Explanation: explanation/explanation.md
- Reference: reference/references.md
plugins:
- search
- glightbox

theme:
name: material
palette:
Expand All @@ -26,7 +30,11 @@ theme:
logo: assets/nomad-plugin-logo.png
favicon: assets/favicon.png
features:
- navigation.instant
- navigation.path
- navigation.footer
- navigation.top
icon:
repo: fontawesome/brands/github
custom_dir: docs/theme
markdown_extensions:
- attr_list
Expand All @@ -37,17 +45,16 @@ markdown_extensions:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- mkdocs-click
- pymdownx.extra
- toc:
permalink: True
- pymdownx.arithmatex:
generic: true
- attr_list
- mkdocs-click
- pymdownx.extra

extra:
generator: false
homepage: https://nomad-lab.eu
homepage: https://github.com/FAIRmat-NFDI/nomad-perovskite-solar-cells-database
use_directory_urls: false
extra_css:
- stylesheets/extra.css
Expand Down
94 changes: 86 additions & 8 deletions src/perovskite_solar_cell_database/apps/perovskite_ions_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,93 @@
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
- type: periodictable
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (complexity): Consider using YAML anchors and aliases to define reusable layout configurations.

The layout configuration can be simplified using YAML anchors and aliases to reduce repetition while maintaining the same functionality. Here's how:

widgets:
  - type: periodictable
    scale: linear
    search_quantity: results.material.elements
    layout:
      # Define base layout template
      &base_layout
      minH: 8
      minW: 12
      y: 0
      x: 0

      xxl:
        <<: *base_layout
        h: 9
        w: 13
      xl:
        <<: *base_layout
        h: 9
        w: 12
      lg: &standard_size
        <<: *base_layout
        h: 8
        w: 12
      md:
        <<: *standard_size
      sm:
        <<: *standard_size

This approach:

  • Defines common properties once using &base_layout
  • Uses <<: *base_layout to inherit common properties
  • Only specifies values that differ for each screen size
  • Further reduces duplication by reusing identical sizes with &standard_size

The same pattern can be applied to the scatter_plot widget's layout.

scale: linear
quantity: results.material.elements
search_quantity: results.material.elements
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: scatter_plot
autorange: true
size: 1000
markers:
color:
search_quantity: results.material.topology[0].structural_type
y:
search_quantity: data.pure_substance.molar_mass#perovskite_solar_cell_database.composition.PerovskiteAIon
title: A cation molar mass
x:
search_quantity: results.material.topology[0].n_atoms
title: ""
layout:
xxl:
minH: 3
minW: 3
h: 6
w: 9
y: 0
x: .inf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Invalid x coordinate value '.inf' in xxl layout

The x coordinate value '.inf' is invalid and could cause rendering issues. Please specify a valid numeric value.

xl:
minH: 3
minW: 3
h: 9
w: 18
y: 0
x: 12
lg:
minH: 3
minW: 3
h: 8
w: 12
y: 0
x: 12
md:
minH: 3
minW: 3
h: 8
w: 6
y: 0
x: 12
sm:
minH: 3
minW: 3
h: 6
w: 9
y: 8
x: 0
"""
)
),
Expand Down
2 changes: 1 addition & 1 deletion tests/apps/test_solar_cell_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def test_importing_app():
# This will raise an exception if pydantic model validation fails for the app
from perovskite_solar_cell_database.apps.solar_cell_app import (
from perovskite_solar_cell_database.apps.solar_cell_app import ( # type: ignore
solar_cell_app, # noqa: F401
Comment on lines +3 to 4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (testing): Missing tests for the new scatter plot functionality

The PR adds a new scatter plot widget but there are no tests to verify its configuration and behavior. Consider adding tests that verify:

  1. The scatter plot widget is properly configured with the correct search quantities
  2. The layout parameters are correct for different screen sizes
  3. The autorange and marker settings work as expected

)
Loading