Releases: hanjinliu/magic-class
Releases · hanjinliu/magic-class
v0.5.13
v0.5.12
New Features
- Built-in macro widget is working! Get executable scripts by
str(ui.macro)
, or show the widget byui.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. Withmacro-kit>=0.3.3
, thedatetime
module is automatically passed toeval
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. Useui.macro
instead. - Delayed
matplotlib
import.
Bug Fixes
MagicValueField
was not compatible with latest macro recording system.
v0.5.11
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 increate_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
New Features
- Custom key-binding is working! Decorate method with
@bind_key("Ctrl-A")
and that's it. - New container
GroupBoxContainer
with optionmagicclass(widget_type="groupbox")
to_clipboard
helper function.
Changes
show_messagebox
are moved tomagicclass.utils
v0.5.9
New Features
- Add traceback of widget creation history and error causing method definition when magic class construction failed.
DictWidget
similar toListWidget
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 simplenapari
-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
inmagicmenu
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
New Features
- All the push buttons have
running
attribute now. This attribute is True only when the function is running inmagicgui
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
andvfield
can make a field that is more similar to Pythonproperty
. See the document for details.record
option infield
function. Usefield(..., record=False)
to avoid recording value changes in macro."bind"
option supportsMagicField
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 aContainer
. It is much more similar to Pythonlist
now.add_item
→append
insert_item
→insert
pop_item
→pop
Bug fixes
- The disgusting spaces in separators are removed.
Annotated
type works well in magic-class.
v0.5.7
Changes
QtPlotCanvas.layers
andQtImageCanvas.layers
now returnLayerList
object, which acts much more similar tonapari
'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 tonapari
andmatplotlib
.
v0.5.6
v0.5.5
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
New Features
bind
method ofmagicgui
is compatible withmagicclass
now:The bind callback can be a class methods which take@set_options(x={"bind": value}) def func(self, x): ...
self
and anEmptyWidget
as arguments.- Many new popup modes. Changing the popup mode with
popup=False
is now deprecated and from now onpopup_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:... and a "Set Parameters" button appears in the main widget.@magicclass class A: class Set_Parameters(Parameters): i = 1 s = "a"
@magicclass
can be nested in@magicmenu
now.qtgraph.Canvas
andqtgraph.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.