-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use pytest-mpl to test
test_energy_band_alignment_diagram
- Loading branch information
Showing
6 changed files
with
133 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,5 +49,5 @@ jobs: | |
pip show -V ase | ||
- name: Run tests | ||
run: pytest tests/unit_tests.py | ||
run: pytest --mpl tests/unit_tests.py | ||
|
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Generate reference figures for testing plotting functions" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"path_for_ref_images = \"testIm\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Generate test fig for test_energy_band_alignment_diagram" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Figure saved as BandAlignment.pdf\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import macrodensity as md\n", | ||
"\n", | ||
"fig = md.energy_band_alignment_diagram(\n", | ||
" {\n", | ||
" \"ZnO\": [4.4, 7.7],\n", | ||
" \"MOF-5\": [2.7, 7.3],\n", | ||
" \"HKUST-1\": [5.1, 6.0],\n", | ||
" \"ZIF-8\": [0.9, 6.4],\n", | ||
" \"COF-1M\": [1.3, 4.7],\n", | ||
" \"CPO-27-Mg\": [2.9, 5.9],\n", | ||
" \"MIL-125\": [3.8, 7.6],\n", | ||
" \"TiO2\": [4.8, 7.8],\n", | ||
" },\n", | ||
" ylims=(-10, 0.0),\n", | ||
" arrowhead=0.15,\n", | ||
")\n", | ||
"fig.savefig(f\"{path_for_ref_images}/BandAlignment.png\", bbox_inches=\"tight\", transparent=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "macrodensity2", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"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.11.4" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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