Giter Club home page Giter Club logo

Comments (3)

martinRenou avatar martinRenou commented on August 17, 2024

That is really weird... I displayed the traceback using print_stack and it shows that the second external event has not the same origin. We should try to replicate it using a core widget and post an issue in ipywidgets.

In the meantime I can only try to help you with your use case. If what you want to do is format the float numbers in the cells you can do:

import ipysheet

sheet = ipysheet.sheet()
ipysheet.cell(0, 0, -0.4, numeric_format='0.000')
display(sheet)

from ipysheet.

krey avatar krey commented on August 17, 2024

Thanks @martinRenou

numeric_format seems useful. I'd also like to replace non-numeric inputs with the empty string.

I tried to replicate the issue using core widgets (Select.options instead of Cell.value) but didn't succeed.

Let me know if you have any ideas

p.s. Do you think #66 is unrelated?

from ipysheet.

martinRenou avatar martinRenou commented on August 17, 2024

I honestly have no clue. This is really internal behavior of traitlets and ipywidgets and I'm not really aware of it.
But this 'old': ['-0.4000'], 'new': ['-.4'] thingy is really odd, I don't see why it should happen. I guess it's a bug.

The thing is that you are setting the value of the cell in the callback of an observe call, which is not really common use case.
I guess what you would need is a traitlets validator instead?

from ipysheet.

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.