-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from Jashcraf/use_pathlib
Use pathlib, added test to make sure materials work and modified setup.cfg to install material data too
- Loading branch information
Showing
4 changed files
with
25 additions
and
33 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
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,28 +1,25 @@ | ||
import numpy as np | ||
import poke.materials as mat | ||
import pytest | ||
import os | ||
|
||
# def test_create_index_model(): | ||
def test_create_index_model(): | ||
|
||
# # TODO: The file import system doesn't work on the GH Actions test | ||
# TODO: The file import system doesn't work on the GH Actions test | ||
|
||
# # prealloc lists | ||
# reference = [] | ||
# test = [] | ||
# prealloc lists | ||
reference = [] | ||
test = [] | ||
|
||
# # pick a complex material and a dielectric | ||
# materials = ['Al','HfO2'] | ||
# pick a complex material and a dielectric | ||
materials = ['Al','HfO2'] | ||
|
||
# # load refractive indices from a certain wavelength | ||
# wvl = [0.51660,0.5060] | ||
# ns = [0.51427,1.9083754098692] | ||
# ks = [4.95111,0] | ||
# for material,wave,n,k in zip(materials,wvl,ns,ks): | ||
# n_callable = mat.create_index_model(material) | ||
# load refractive indices from a certain wavelength | ||
wvl = [0.51660,0.5060] | ||
ns = [0.51427,1.9083754098692] | ||
ks = [4.95111,0] | ||
for material,wave,n,k in zip(materials,wvl,ns,ks): | ||
n_callable = mat.create_index_model(material) | ||
|
||
# reference.append(n + 1j*k) | ||
# test.append(n_callable(wave)) | ||
reference.append(n + 1j*k) | ||
test.append(n_callable(wave)) | ||
|
||
# # np.testing.assert_allclose(reference,test) | ||
# pass | ||
return np.testing.assert_allclose(reference,test) |