GithubHelp home page GithubHelp logo

Comments (3)

lbolla avatar lbolla commented on May 21, 2024

You must have old code in your branch because that part has already been fixed in 57409d4

Try to pull from origin.

from empy.

lbolla avatar lbolla commented on May 21, 2024

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.

demisjohn avatar demisjohn commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.