Comments (3)
You must have old code in your branch because that part has already been fixed in 57409d4
Try to pull from origin.
from empy.
By the way, the idea behind n0_func
is to return and accept an np array, as the docstring says: https://github.com/lbolla/EMpy/blob/master/EMpy/materials.py#L63-L81
from empy.
Hmmm... I had just rebased from this repo before I started the fork - my fork on GitHub says it's only 3 (of my own) commits ahead of yours, I think that means it should be current code, right? That would be unfortunate if I'm working on old code.
The commit you referenced (57409d4) shows the following erroneous code on line 137 (the last line here):
def __from_function(n0_func, wls):
wls = numpy.atleast_1d(wls) wls = numpy.atleast_1d(wls)
- if wls.size == 1: + return n0_func(numpy.ones_like(wls))
It passes numpy.ones_like(wls)
to the user-supplied function, which means the user's function is always evaluated at wl = 1.0 meters
. It should instead pass the actual wavelengths array wls
to n0_func()
and then multiply the result by ones_like(wls)
to ensure it's returning an array. I have fixed this in my fork, here:
https://github.com/demisjohn/EMpy/commit/7813056e58b0d4872e176b3593c503f5b4ac9ce2
Thanks for clarifying the purpose of that function, makes perfect sense now. Please let me know if I'm missing something about this error.
from empy.
Related Issues (20)
- What type of mesh are the Ex and Ey modes defined on ?? HOT 10
- Use anisotropic refractive index with FD modesolver HOT 6
- Sellmeier coefficients HOT 1
- EMpy.utils.Multilayer() needs .copy() method HOT 4
- VFDModeSolver fields different from commercial software HOT 11
- EMPy Citation HOT 2
- EMpy installation downgrades matplotlib HOT 5
- Outdated dependency? HOT 2
- ex_modesolver_2: coordinates rotated? HOT 3
- Is EMpy able to simulate gap ring resonator? HOT 3
- cannot import EMpy
- Couldn't install EMpy
- 2D binary grating consists of a cylinder HOT 4
- Simulation result of tar.gz and zip file are different HOT 3
- Docstring for SVFDModeSolver HOT 1
- 1d mode solver HOT 1
- A user manual or program manual? HOT 1
- windows python 3.11 pip install ElectromagneticPython fails due to mismatch in version metadata HOT 2
- Differences in Master and code installed with pip (version 2.0.0) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from empy.