Giter Site home page Giter Site logo

osscar-org / scicode-widgets Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 1.61 MB

A collection of widgets to prepare interactive scientific visualisations, including user code input and validation

Home Page: https://osscar-org.github.io/scicode-widgets/

License: BSD 3-Clause "New" or "Revised" License

Python 99.07% CSS 0.93%
computational-thinking jupyter-widgets

scicode-widgets's People

Contributors

agoscinski avatar divyasuman14 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scicode-widgets's Issues

Cannot using WebDriver send_keys to WidgetCodeInput

For the tests I am using notebook==7.0.2 and used various way to add something to the line like

nb_cell.find_elements(By.CLASS_NAME, "CodeMirror-line")[3].send_keys("a")

clicking workings. I am not sure if is related to osscar-org/widget-code-input#18
but with notebook==6.5.5 I get this error osscar-org/widget-code-input#20
The only thing that works with the WidgetCodeInput correctly is jupyter lab 3.*, but that is not so simple get running in the current testing environment.

Traits are not linked to widget view with widget_code_input 4

Problem

when running two cells

from scwidgets.code import CodeInput
def foo():
    return 'init'
ci = CodeInput(foo)
ci
ci.function_body = """return 'change'"""

the widget view is not updated on the change of the function_body.

Fix

Because with widget 4 the code themes names have changed, the wrong default theme default is not valid anymore and causes this bug. We need to update the default code_theme name.

Unpin NumPy < 2.0

Currently we pin to below numpy < 2.0 because some failure in matplotlib. Need to look into this another time further.

Notebook 7/Lab 4 selenium tests: Elements outside of view are empty

In notebook 7 the text of the cells is only loaded when it is in focus. Even though one can bring the cell into focus by scrolling to it, the automization of the scrolling works not perfectly. For example driver.execute_script('arguments[0].scrollIntoView();', nb_cell) only works if the nb_cell is not too far away. Other commands to move to an elements did not work for me. In addition the cells that can be found with

    nb_cells = driver.find_elements(
        By.CLASS_NAME, "lm-Widget.jp-Cell.jp-CodeCell.jp-Notebook-cell"
    )

are also dependent on the view in the browser. Supporting this would require quite a change how the tests were designed as they assume all nb_cells to be present.

Put the hide all code button within scwidgets

I think it'd be nice to have a hide code button inside scwidgets. I asked chatgpt and it looks it's not hard to have python-side code that does the hiding and showing. One could imagine having this incorporated in the check registry and have a call that hides everything or something like that

@ceriottm

Setting global variables more transparently

In #45 we will set the global variables within a test. This is needed because we need to get the jupyter version. Neverthless it would be nicer if we make this configuration a bit more transparent to developers. One could make a class with static methods to retrieve the globals.

Refactor matplotlib figure tests for lab 4

In #45 I disabled the matplotlib figure tests, because they assume that the whole notebook is loaded, but due to issue #50 we cannot load all matplotlib figure like it is currently done. For now the tests are disabled for lab 4, but the figures have to be loaded by scrolling through the notebook. This needs just some extra logic, but is not that much work. To speed the lab 4 integration however I put this as a task for later.

Upgrade to pytest 8 for tests

I had some problems with pytest-selenium using pytest 8, so I pinned it to <8.0.0. There is a release of pytest-selenium that should work wtih an 8.* version, but it did not work out of the box when I tried. Also coverage had some problems with this option -o testpaths="tests tests/notebooks/*py", the option name might have changed.

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.