generated from FAIRmat-NFDI/nomad-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fcd7c5c
commit 8e71217
Showing
7 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
def test_importing_app(): | ||
# this will raise an exception if pydantic model validation fails for th app | ||
from nomad_tadf_molecules.apps import myapp | ||
|
||
# This will raise an exception if pydantic model validation fails for the app | ||
from nomad_tadf_molecules.apps import tadf_molecules # noqa: F401 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"smiles":"C=Cc1ccc(COc2ccc(C(C)(C)c3ccc(O)cc3)cc2)cc1","doi":"https:\/\/doi.org\/10.1039\/D1TC05010A","compound_names":"[\"4-(2-(4-((4-Vinylbenzyl)oxy)phenyl)propan-2-yl)phenol\",\"4-(2-(4-((4-vinylbenzyl)oxy)phenyl)propan-2-yl)phenol\",\"Bisphenol A\",\"P4CzCN\u2013BCz\"]","phase":"{\"specifier\":\"solution\",\"host\":\"toluene\"}","photoluminescence_quantum_yield_value":null,"photoluminescence_quantum_yield_unit":null,"delayed_lifetime_value":null,"delayed_lifetime_unit":null,"peak_emission_wavelength_value":493.0,"peak_emission_wavelength_unit":"nm","singlet_triplet_energy_splitting_value":0.17,"singlet_triplet_energy_splitting_unit":"eV","host":"toluene","specifier":"solution","iupac_name":"4-(2-(4-((4-Vinylbenzyl)oxy)phenyl)propan-2-yl)phenol","abbreviated_name":"4-(2-(4-((4-vinylbenzyl)oxy)phenyl)propan-2-yl)phenol"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
data: | ||
m_def: nomad_tadf_molecules.schema_packages.mypackage.MySchema | ||
name: Markus | ||
m_def: nomad_tadf_molecules.schema_packages.tadf_molecules.TADFMolecule | ||
photoluminescence_quantum_yield: 0.1 | ||
peak_emission_wavelength: 400 | ||
delayed_lifetime: 3 | ||
singlet_triplet_energy_splitting: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import logging | ||
|
||
from nomad.datamodel import EntryArchive | ||
from nomad_tadf_molecules.parsers.myparser import MyParser | ||
from nomad_tadf_molecules.parsers.tadf_molecules import TADFMoleculesParser | ||
|
||
|
||
def test_parse_file(): | ||
parser = MyParser() | ||
parser = TADFMoleculesParser() | ||
archive = EntryArchive() | ||
parser.parse('tests/data/example.out', archive, logging.getLogger()) | ||
|
||
assert archive.results.material.elements == ['H', 'O'] | ||
parser.parse('tests/data/molecule30.json', archive, logging.getLogger()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# ruff: noqa: PLR2004 | ||
import os.path | ||
|
||
from nomad.client import normalize_all, parse | ||
|
||
|
||
def test_schema(): | ||
def test_tadf_schema(): | ||
test_file = os.path.join('tests', 'data', 'test.archive.yaml') | ||
entry_archive = parse(test_file)[0] | ||
normalize_all(entry_archive) | ||
|
||
assert entry_archive.data.message == 'Hello Markus!' | ||
assert entry_archive.data.photoluminescence_quantum_yield == 0.1 | ||
assert entry_archive.data.peak_emission_wavelength.magnitude == 400 | ||
assert entry_archive.data.delayed_lifetime.magnitude == 3 | ||
assert entry_archive.data.singlet_triplet_energy_splitting.magnitude == 2 |