Giter VIP home page Giter VIP logo

Comments (2)

1ozturkbe avatar 1ozturkbe commented on August 22, 2024

Never mind, figured it out. Made the mistake of leaving a 1/log(1) in the data, giving inf... Problem resolved.

It is odd that this gives an indexError though.

from gpfit.

whoburg avatar whoburg commented on August 22, 2024

Thanks @1ozturkbe. Agreed that this should fail more gracefully. I reduced your code and data to a MWE:

import numpy as np
from gpfit.fit import fit

logL = np.array([
    float("-inf"),
    -2.083896,
    -1.390749,
    -1.021651,
    -0.762140,
    -0.579818,
    -0.432494,
    -0.316234])

logh = np.array([
    float("-inf"),
    8.095855,
    8.789002,
    9.194467,
    9.482149,
    9.705293,
    9.887614,
    10.041765])

cstrt, rms_error = fit(logh,logL, 2, "SMA")

This gives an IndexError; it should fail more gracefully, probably by raising a ValueError for the -inf.

Let's leave this open to make sure we fix it.

from gpfit.

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.