Skip to content

Releases: hanjinliu/magic-class

v0.5.13

12 Dec 14:37
Compare
Choose a tag to compare

Bug Fixes

  • Fix annotations for Python 3.8.
  • wraps and FunctionGui was not compatible.
  • Some popup modes was not correctly working.
  • Fix typo of "draggable".

v0.5.12

11 Dec 15:42
Compare
Choose a tag to compare

New Features

  • Built-in macro widget is working! Get executable scripts by str(ui.macro), or show the widget by ui.macro.widget.show(). This widget is already equipped with many functions, such as "create macro" or "run macro".
  • Help widget is working! Use build_help to make illustrated documentation automatically.
  • datetime objects are correctly recorded in macro. With macro-kit>=0.3.3, the datetime module is automatically passed to eval function so that macro can be executed safely.
  • Menu bar objects support rendering similar to Widget.
  • New container variation DraggableContainer is available. Instead of scrolling using scroll bar, this container supports scrolling by mouse drag. Create by @magicclass(widget_type="draggable").

Changes

  • The create_macro method will cause deprecation warning. It will be removed soon. Use ui.macro instead.
  • Delayed matplotlib import.

Bug Fixes

  • MagicValueField was not compatible with latest macro recording system.

v0.5.11

05 Dec 14:47
Compare
Choose a tag to compare

New Features

  • bind_key can bind private methods to keyboard shortcuts now.
  • MagicTemplate can check undesired override when subclassed.

Changes

  • Macro recording functions are now dependent on macro-kit.
  • Try/except block in method-to-widget conversion, because some callable objects is not compatible with magic class construction.
  • The myname="ui" argument in create_macro method is deleted because this change can simplify the code a lot.
  • Block macro recording if it is caused by another function that causes macro recording.

Bug Fixes

  • Tooltips was disabled by magic-class wraps methods (docstrings were not inherited correctly).
  • Magic classes inserted into parent magic class did not update __magicclass_parent__ attribute.
  • Bug fix in container generated by widget_type="list".

v0.5.10

01 Dec 15:51
Compare
Choose a tag to compare

New Features

  • Custom key-binding is working! Decorate method with @bind_key("Ctrl-A") and that's it.
  • New container GroupBoxContainer with option magicclass(widget_type="groupbox")
  • to_clipboard helper function.

Changes

  • show_messagebox are moved to magicclass.utils

v0.5.9

25 Nov 05:02
Compare
Choose a tag to compare

New Features

  • Add traceback of widget creation history and error causing method definition when magic class construction failed.
  • DictWidget similar to ListWidget is available.
  • ProgressWidget is partly working in parallel.
  • show_url function for opening a URL in the default web browser.
  • Any widgets can now be added to menu bar via QWidgetAction.
  • NapariCanvas is available now, which is useful for building simple napari-like widget.
  • MagicTemplate is available, which is useful to make magic class specific attributes discoverable from IDE and console.
  • New container variation based on QMdiArea (widget_type="subwindows").

Changes

  • wraps system was completely re-implemented. Now it actually calls parent method. No API changes.
  • magicclass in magicmenu will actually be docked into the menu bar for integrity of API.

Bug Fix

  • Compatibility of Bound and fields.
  • Make QtConsole compatible to current implementation.

v0.5.8

21 Nov 12:35
Compare
Choose a tag to compare

New Features

  • All the push buttons have running attribute now. This attribute is True only when the function is running in magicgui side, that is, executed from GUI. It is useful when a function need to know how it is called (e.g. don't use thread worker when function is called from script).
  • MagicValueField and vfield can make a field that is more similar to Python property. See the document for details.
  • record option in field function. Use field(..., record=False) to avoid recording value changes in macro.
  • "bind" option supports MagicField now. See the document for details.
  • Bound function for annotation with "bind" options.
  • Traceback of widget creation will be printed when an error occurred during magic-class construction.

Important Changes

  • MagicField is now always referred via __get__. There is not change in API, but fields became immutable.
  • FrozenContainer is no longer used because it doesn't have to be a container. FreeWidget is now used instead. Therefore, Containter's methods are no longer supported.
  • Many methods of ListWidget are renamed because it is no longer a Container. It is much more similar to Python list now.
    • add_itemappend
    • insert_iteminsert
    • pop_itempop

Bug fixes

  • The disgusting spaces in separators are removed.
  • Annotated type works well in magic-class.

v0.5.7

15 Nov 04:28
Compare
Choose a tag to compare

Changes

  • QtPlotCanvas.layers and QtImageCanvas.layers now return LayerList object, which acts much more similar to napari's layer list.
  • show_messagebox function for popping up a message box dialog.

Bug Fixes

  • error_mode="stderr" bug fix.
  • The image layer of QtImageCanvas was off by 0.5 pixel compared to napari and matplotlib.

v0.5.6

11 Nov 03:10
Compare
Choose a tag to compare

Bug Fixes

  • MagicField did not deal with not installed module correctly
  • QtImageCanvas.image property raised error when image was not set.

v0.5.5

11 Nov 01:21
Compare
Choose a tag to compare

Changes

  • Set window geometry to avoid magicgui popping up outside the screen.
  • All the custom widgets are in "magicclass/widgets" folder now so they are all available by from magicclass.widgets import ....
  • Add copy, save and close functions in the menu bar of macro edit.
  • Updates for documentation.

v0.5.4

06 Nov 03:54
Compare
Choose a tag to compare

New Features

  • bind method of magicgui is compatible with magicclass now:
    @set_options(x={"bind": value})
    def func(self, x):
        ...
    The bind callback can be a class methods which take self and an EmptyWidget as arguments.
  • Many new popup modes. Changing the popup mode with popup=False is now deprecated and from now on popup_mode=... should be used.
  • Disable error handling in message box by setting error_mode="stderr".
  • Close button at the upper left corner of magicgui widget if it is not popped up.
  • Parameters class is available, which is very useful to make "set global variable" function like:
    @magicclass
    class A:
        class Set_Parameters(Parameters):
            i = 1
            s = "a"
    ... and a "Set Parameters" button appears in the main widget.
  • @magicclass can be nested in @magicmenu now.
  • qtgraph.Canvas and qtgraph.ImageCanvas have more consistent API now. In both class you can add plot/scatter, connect mouse click callbacks and refer to items.

Bug fixes

  • Compatibility of @magicgui decorator and @wraps decorator.