Coder Social home page Coder Social logo

Comments (3)

wmvanvliet avatar wmvanvliet commented on August 15, 2024 2

Ah, the np.log10() call needs protection to prevent no.log10(0) of course. My bad :) PR incoming

from mne-python.

welcome avatar welcome commented on August 15, 2024 1

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

from mne-python.

drammock avatar drammock commented on August 15, 2024

Thanks for the report. It appears it's happening because the maximum value of your data is zero (which may indicate a mistake somewhere in your script; is data with no positive values plausible for you?)

The error is happening here:

def _get_range(brain):
"""Get the data limits.
Since they may be very small (1E-10 and such), we apply a scaling factor
such that the data range lies somewhere between 0.01 and 100. This makes
for more usable sliders. When setting a value on the slider, the value is
multiplied by the scaling factor and when getting a value, this value
should be divided by the scaling factor.
"""
val = np.abs(np.concatenate(list(brain._current_act_data.values())))
fmin, fmax = np.min(val), np.max(val)
if 1e-02 <= fmax <= 1e02:
fscale_power = 0
else:
fscale_power = int(np.log10(fmax))
if fscale_power < 0:
fscale_power -= 1
fscale = 10**-fscale_power
return fmin, fmax, fscale, fscale_power

@wmvanvliet you wrote this code in your UI event system work (#11891), any chance you have time to take a look?

from mne-python.

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.