neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
395 stars 116 forks source link

Sporadic Failure of RXD. #2939

Open 1uc opened 3 months ago

1uc commented 3 months ago

I've seen RXD fail sporadically for no obvious reason. I'd like to start collecting CI runs that failed. Please post any failures you notice so we can get a grip on how often it happens; and if it's always the same issue or multiple different issues.

Rerunning CI makes the issue "go away".

1uc commented 3 months ago

Today we have:

test/rxd/test_pltvar.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../lib/python/neuron/__init__.py:1357: in __call__
    return _do_plot_on_plotly(*args, **kwargs)
../../../lib/python/neuron/__init__.py:1330: in _do_plot_on_plotly
    col = _get_color(variable, val, cmap, lo, hi, val_range)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

variable = Species(regions=[Region(..., nrn_region='i', geometry=<neuron.rxd.geometry.RxDGeometry object at 0x1108d20f0>, dx=0.25...l=0)[Region(..., nrn_region='i', geometry=<neuron.rxd.geometry.RxDGeometry object at 0x1108d20f0>, dx=0.25, name=None)]
val = 0.0
cmap = <matplotlib.colors.LinearSegmentedColormap object at 0x11ffdcd40>
lo = nan, hi = 4.5899531198959383e-41, val_range = nan

    def _get_color(variable, val, cmap, lo, hi, val_range):
        if variable is None or val is None:
            col = "black"
        elif val_range == 0:
            if val < lo:
                col = color_to_hex(cmap(0))
            elif val > hi:
                col = color_to_hex(cmap(255))
            else:
                col = color_to_hex(cmap(128))
        else:
            col = color_to_hex(
>               cmap(int(255 * (min(max(val, lo), hi) - lo) / (val_range)))
            )
E           ValueError: cannot convert float NaN to integer

../../../lib/python/neuron/__init__.py:1223: ValueError
=============================== warnings summary ===============================

https://github.com/neuronsimulator/nrn/actions/runs/9663498233/job/26655821145#step:18:6160

ramcdougal commented 3 months ago

We should also probably think about what PlotShape should do if it encounters a NaN. It shouldn't with any reasonable model... but it probably shouldn't crash either.

1uc commented 3 months ago

Do you know why it occasionally generates nans during CI runs?

ramcdougal commented 3 months ago

That was news to me. No clue as yet.

1uc commented 1 month ago

This looks like another one: https://github.com/neuronsimulator/nrn/actions/runs/10352129871/job/28652083843